Flash: Some characters could not be converted to outlines…
Wierd, ran into this trying to track down another problem with Flash. I reinstalled from the Web Premium DVD just Flash CS3, which took like 45 minutes (WTF?!), booting up flash, opened a file tried publishing and got that error...and none of the fonts (just myriad pro) showed up anymore.
Restarting the machine fixed it.
Flash: 4 XML and TextField tips
Tip1:
Which converting back and forth between XML and Objects (e.g parsing), you can't use E4X like primitives e.g.
if(xml.@someAttribute != null) //won't work
Use
if(xml.hasOwnProperty("@someAttribute"){
instead.
Tip2:
Similar when comparing XML nodes you should probably convert it to a string first e.g.
switch(xml.@name.toString()) {
case "config":....
Tip3:
When dealing with TextFields and you to embed text into the fla, but want to scroll a textfield, and avoid loading text. By default the textfield will maximize to fit the size of whatever text is pasted into it, making it hard to layout
A solution is to use two dynamic TextFields, one for the scrolled display, the other a text holder, just paste the text into that making it as big as needed, then hiding it and copying the first textfield. via
body_txt.htmlText = hideMe_txt.text;
hideMe_txt.visible = false;
Tip4:
embed fonts with textfields in a layer masked by another layer with a graphic not over the clip. That way you can be sure what your getting, when working on the Timeline you will see everything, but when published it won't be visible. You can also and get precise letters, rather than embedding the entire font family in the library.
Flash:Flickering Animation, dissapearing animation => corrupted symbol
This is something I've hit a few times across several projects. At some unknown event, animated movie clips will start flickering, like if you have a character the head will start to dissapear on or off. Once one clip is broken, EVERY animation across the Fla will have flickering issues. Like simple tweens will show the first few frames, cut out completely then show the last.
Not sure how this is caused, guessing it's more frequent if your merging Fla's. The only solution I've found is going through animation by animation and trying them out in a separate Fla. Finding the one that flickers, and deleting it and replacing it with a backup will correct...the entire file!
Flash: Centering and Scaling
Been working on some fluid layout and centering projects. For reference:
- stage.width + stage.height - the size of the content on the stage.
- stage.stageWidth + stage.stageHeight - that dimensions of the monitor the flash player is currently consuming
- loaderInfo.width + loaderInfo.height - that of the Fla's publish settings
Got the 2nd and 3rd confused, so only started seeing problems when they were published (doh!)
Flash: Beware the Garbage Collector
Of all the major changes in AS3, this has been the most problematic....things hanging out off the display list, unreachable. I discovered a new way to get these "voices from the grave" to happen this eve.
We are instantiating new MovieClip classes for the stage via
-
-
MovieClipClassReference = getDefinitionByName(styleMC) as Class;
-
try{
-
curPageClip = new MovieClipClassReference (curPageText);
-
}catch (e:Error){
-
curPageClip = new MovieClipClassReference ();
-
}
The idea being sometimes they accept an argument, in other times they don't. If it doesn't work the first time, then we try the second. Unfortunately this means that there are now 2 MovieClips, with all their assets hanging out in memory, but lacking the brains/script because the constructor errored out! In our case the error was 'voices from beyond' as the sounds embedded on the timeline were playing in the background even though there only appeared to be one instance on the stage stopped at the beginning.
The short solution for us was to have all classes accept a constructor, even if they don't do anything with it. A cleaner approach is to introspect the class looking for the amount of arguments in the constructor...
-
-
var desc:XML = describeType(MovieClipClassReference );
-
var xmlL : XMLList = desc..constructor.parameter;
-
trace("Constructor Parameters " + xmlL.length());
-
if( xmlL.length() == 1) {
-
curPageClip = new MovieClipClassReference (curPageText);
-
}else if( xmlL.length() == 0) {
-
curPageClip = new MovieClipClassReference ();
-
}
Flash: Actionscript 3.0 ReferenceError: Error #1056 Cannot create property
Also discovered here Quote:
In Flash CS3, when you have instances (Movieclips) on the main timeline (Stage) with instance name on them and “Automatically declare stage instances” is off (File->Publish Setting->Flash->Actionscript 3.0 setting), You will need to declare properties for the document class with the same instance names or else you will get the error messages…
Like:
Cannot create property ANamedClipOnTheTimeline_mc on com.yoursite.DocumentLevelClass
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
at com.yoursite.DocumentLevelClass()
In my case this was due to copying a button that didn't belong, hidden behind another clip. To Find it I selected all, Right Clicked, selected distributed to layers, and then deleted the offending layer named that of the clip named in the error.
