this.addEventListener(Event.ENTER_FRAME, cpF1);
this.addEventListener(Event.ENTER_FRAME, cpF2);
function cpF1(e:Event):void{trace("cpF1")}function cpF2(e:Event):void{trace("cpF2")}
Don’t expect to have traces like “cpF2″ only. You’ll have “cpF1 cpF2″ traced on every frame. This is a very hard to find mistake, if you expect an object to have only one onEnterFrame listener but you add another.
1086: Syntax error: expecting semicolon before line
Have you ever seen this error, when trying to move your fla from AS2 to AS3:
“Location: tempInit, Line 2 Description: 1086: Syntax error: expecting semicolon before line.”
In my case the problem was that I had a movieclip with a Linkage identifier in my AS2 file that contained space in the name. When I moved to AS3 all my Linkage identifiers were converted to class names and when I tried to compile my AS3 flash file I got this error above.
So be careful when you name your linkage identifiers. Better use “camel case” instead of using spaces. This will help you move your AS2 fla file to AS3 fla file without seeing this error.
If you use a standart timeline animation with a shape tween above a button and you want to call a function that sets the events for the button from a frame – put the call to the function after the shape tween is over. If the shape tween is over the button, the shape receives the Mouse events and the button won’t work.
In a comment on my previous post [AS3] Skinning Flash Components I was asked to show how to change the size of the thumb of the Slider component. After some experiments with the component here is the way it can be done:
Using PNG in a MovieClip with Blend mode set to Overlay causes strange artifacts in Flash player 10
As you can see in the flash demo below, in Flash player 10 the left image has strange artifacts while in the right image there are no artifacts.
I used Alpha: 99% for the Movie clip with the PNG and the artifacts were gone. I’m not sure what causes the artifacts in FP10 and if this solution is the right one, but it worked for me.
Today I run into this strange problem while trying to scale a Sprite containing dynamic TextField. As you can see in the flash demo below, when you scale the Sprite the TextField retains its position in the Sprite container.
After searching and trying a lot of different URLs for the Subversion repository of SWFAddress I finally found the right URL for my Tortoise SVN client. The address is:
Unfortunately there is a bug filed against the use of the stopAllSounds()and the FLVPlayback component. The stopAllSounds method breaks the play/pause button in FLVPlayback component.
The bug is currently deferred, so I can’t give you a potential fix date for this.
Regards,
Chris Bedford
Chris Bedford | Sr. Technical Writer | Adobe Systems
But I found a workaround using instanceof and checking if the object is instanceof Sound or instanceof FLVPlayback and then I call the Sound object’s stop() or the FLVPlayback component’s stop().
This is not very professional solution, but when I found a better one I’ll post it here.