Embedding Foreign Characters in Dynamic XML text Box.

Posted: January 12th, 2010 | Author: Liza | Filed under: As3, Flash, XML, cs3 | Tags: , , , , , , , | No Comments »

I had a problem with a Russian font not appearing in a text area, although the font would work when I traced it.

The font was originally Avenir, but there was nothing appearing when I embedded the Cyrillic characters.

I tried to change it to Arial and still no luck.

The solution was changing the font to Arial Unicode and embedding the Cyrillic characters.

picture-1

picture-2


Depth Management in AS3 = Z Order

Posted: September 30th, 2009 | Author: Liza | Filed under: As3, Flash, Uncategorized | Tags: , , , | No Comments »

I had a bit of trouble trying to figure out how to move the depth of an object on the stage in AS3 today. Its actually called Z-order in AS3, not Depth. Instead of just using the AddChild function, which put the Movie Clip on the top of the display list, I used AddChildAt, which set the depth of the Movieclip while it was adding it.

So instead of adding the child this way:

global.base.bgSprite.addChild(whiteTriangle);

where the movieclip was just dumped on top of everything

I used this

global.base.bgSprite.addChildAt(whiteTriangle, 1);

The 1 moved the depth of the movieclip to the base.

p.s. this was an external ActionScript file.


Plugging in External Classes to Gaia Framework Files

Posted: June 19th, 2009 | Author: Liza | Filed under: As3, Flash, gaia framework | Tags: , | No Comments »

I probably go on about Gaia Flash Framework, its mainly because that’s what I used to learn AS3 and I’m still figuring it out.

One of the main problems I have with it is plugging in external classes to the Gaia packages.

These are the basic steps to adding an external class, ill be updating this if I find any more issues.

1. Import the class to the main package import area.
2. Create individual private variables for any of the class instances or movie clips.
3. Instantiate the object in the constructor
4. Add the function to the list.

Also don’t forget to add any movie clips (and instances) onto the stage and create linkages in the library if necessary.

If you get a 1009 error its probably because you havnt published the project.


Accessing the stage in Gaia Framework

Posted: June 14th, 2009 | Author: Liza | Filed under: As3, Flash, Uncategorized, cs3, cs4 | Tags: , , , | No Comments »

I have had alot of trouble trying to access the stage from Gaia Framework, but thanks to David, I’m finally getting the hang of it.

I needed to access the stage width (when resized) to create a a bar to sit behind the navigation on my site.

First I had to add this to the class constructor:

addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);

Then create the following 2 functions:

private function onAddedToStage(event:Event):void
{
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
stage.addEventListener(Event.RESIZE, onResize);
onResize();
}

private function onResize(event:Event = null):void
{
navBackBar.width = stage.stageWidth;
navBackBar.x = 0 - ((stage.stageWidth - Gaia.api.getWidth()) / 2);
}

navBackBar is the name of the movieclip on the stage.  You can see it behind the navigation on my site.


5000: Error migrating from CS3 to CS4

Posted: June 14th, 2009 | Author: Liza | Filed under: As3, Flash, cs3, cs4 | Tags: , , , , , | No Comments »

I have moved more than 1 Gaia Framework file from Flash CS3 to CS4 and got this error.

5000: The class ‘Work’ must subclass ‘flash.display.MovieClip’ since it is linked to a library symbol of that type.

The solution is to import the MovieClip class into the import area and to extend the main class as a MovieClip.

In my case from this:

public class Logger
{

to this:

public class Logger extends MovieClip
{


Flash AS3 Print Job Class PC Error

Posted: April 21st, 2009 | Author: Liza | Filed under: As3, Flash, Printing | Tags: , , , | 2 Comments »

I had a nightmare week trying to figure this problem out.  Basically i was printing 4 pages from what appeared to be a really unstable xml file in a flash swf.  Initially I thought it might have been special characters in xml or a problem with the Print Job Class.

I had no idea why the print job class worked (for 3 pages or more) on a MAC and not a PC.  after investigation by a few of our developers it was kicking up an error about “Timing out”, and there was a pretty simple solution.

It was timing out because the script time limit was too short for a PC to process more than 3 pages at a time, so i increased the script time (in Publish Settings)  to 60 seconds and it worked.

Publish Settings

Nightmare Over