Wednesday, 6 February 2008

onEnterFrame in AS3

the old 'onEnterFrame' syntax has been removed in AS3 It seems everything has to be handled by the eventListener. Here's a simple


import flash.events.Event;
addEventListener(Event.ENTER_FRAME, dosmthng);
//
private function dosmthng(Event){
trace("smthng"+Event)//output:smthng[Event type="enterFrame" bubbles=false ...
}

and to remove it? Well, it’s a listener so you have to remove the Event Listener with :

removeEventListener(Event.ENTER_FRAME,funcToCall)

Besides ENTER_FRAME we have other Public Constants to use:

  • ACTIVATE
  • ADDED
  • ADDED_TO_STAGE
  • CANCEL
  • CHANGE
  • CLOSE
  • COMPLETE
  • CONNECT
  • DEACTIVATE
  • ENTER_FRAME
  • FULLSCREEN
  • ID3
  • INIT
  • MOUSE_LEAVE
  • OPEN
  • REMOVED
  • REMOVED_FROM_STAGE
  • RENDER
  • RESIZE
  • SCROLL
  • SELECT
  • SOUND_COMPLETE
  • TAB_CHILDREN_CHANGE
  • TAB_ENABLED_CHANGE
  • TAB_INDEX_CHANGE
  • UNLOAD

Flash ReferenceError: Error #1065: Variable Application is not defined.

If you are receiving this error when publishing your flash as3 swf it is because you need to declare your class as public. Private classes can not be used as document classes because they are out of the class package and therefore are not a part of the private scope.

I’ve seen a bunch of people with this problem so I hope this helps. (courtesy of http://optimastudios.com)

AS3 stage properties

getting the Stage Properties in AS3 has changed.
Just use stage.stageWidth and stage.stageHeight ..NOT Stage.width and Stage.height !

Friday, 2 November 2007

flash cs3 help file location in windows XP

For linking the Sepy's help to flash cs3 help files, the location for
windows XP:
C:\Document and Settings\All Users\Application Data\Adobe\Flash CS3\\Configuration\HelpPanel\Help\
windowsVista:
C:\ProgramData\Adobe\Flash CS3\\Configuration\HelpPanel\Help\
Mac: HD:/Library/Application Support/Adobe/Flash CS3//Configuration/HelpPanel/Help/

Tuesday, 7 August 2007

make text legible and sharp

Flash tends to lose it's sharpness when it comes to fonts. Althought they look perfectly sharp within the IDE, the published movies often are not that sharp anymore.

There are a few simple rules or workarounds to maintain the sharpness.

  • odd values for font sizes (9,11,13,15) cannot be scaled as well. use font sizes of even values.

  • defining the font as dynamic gives better quality, but don't forget to embed the appropriate fonts in the properties Bar

Monday, 6 August 2007

wmode @ key flash bug

I often encountered the problem that some of my flash files did not accept the @ symbol in forms. I had to use the US keyboard @-sign location to add it. this issue only seemed to be on PC, as macs did not have that issue.
The reason for this seems to come up as soon as you publish your movie in wmode( transparent window mode), then the movie only can accept US keyboard-key locations.

more here:
http://blog.headlondon.com/archives/no-wmode-please-were-british/


One Workasround could be:

keyPresser = new Object();
keyPresser.onChanged = function(intxt:TextField) {
if (34 == ((Key.getAscii())) || 64 == ((Key.getAscii()))) {
in
txt.text = intxt.text.slice(0,intxt.text.length-1) +”@”;
}
};
Key.addListener(keyListener);
input_txt.addListener(keyPresser);

FileReference onComplete is not fired on Mac OS

onComplete not fired on Mac OS.
from what I could research on the internet, this issue seems still not have been resolved in flash player 9. partial solutions given here

but further research in progress.