This is a list of bugs or mis- or strange behaviours of flash, which may not be confirmed by macromedia:
(”Misbehavior” implies some expectation of what behavior should be. The definition of “bug” then becomes “anything someone, somewhere, does not like or expect”. It’s easier if you concisely yet clearly describe how someone can see what you’re seeing, and then submit it as a possible change request to the dev team.)
Mouse.hide() method fails once you right click on the stage,
this bug only exists in flash player 7
Bitoperations on Mac may give you wrong results if some overflow (to bit 31) occurs.
Corrected in MX.
Speed on Mac differs significantly from pc if you don’t use framerates like 16,21,31,59
The length of urls inside of a html textfield is limited to (something like) 137 characters. If you need more you have to use asfunction to reference a function which calls getUrl with the longer url. See http://www.macromedia.com/support/flash/ts/documents/url_127_limit.htm
Numbers with leading zeroes are evaluated to 0 eg. 07 is evaluated to 0 instead of 7 in trace(07)
Corrected in MX, numbers with leading 0 are recognized as octal numbers
with(Math){num = random();} produces an error
a = function(){} a.prototype.a0 = **true**; a.prototype.__proto__.a1 = **true**; a.prototype.__proto__.__proto__ = {} a.prototype.__proto__.__proto__.a2 = **true**; x=new a(); for(i=0; i<6; i++)trace(i+" "+x[["a"+i]);
Crashes the player
Appears to be corrected in player 6.
you can’t change the color of dynamic html text inside different frames of a button. use normal text instead.
gotoAnd... doesn’t work with labels inside a onClipEvent handler
//this doesn't work: onClipEvent(keyUp){ gotoAndStop("myLabel"); } //workaround 1: adding "this" to the goto-command: onClipEvent(keyUp){ this.gotoAndStop("myLabel"); } //workaround 2: put the label in a variable onClipEvent(keyUp){ myLabel="myLabel"; gotoAndStop(myLabel); } // workaround 3: use a controler clip (by androse) _root.createEmptyMovieClip('timelineControler_mc', 1); _root.timelineControler_mc.onEnterFrame = function() { if( this.change == true) { this.change = false; trace("timelineControler_mc called, going to label "+this.gotolabel); _root.gotoAndPlay(this.gotolabel); } } // and then when you need to gotoAndPlay() : _root.timelineControler_mc.gotolabel = 'mylabel'; _root.timelineControler_mc.change = true;
I found out why it doesn’t work: The flash compiler translates framelabels to framenumbers. But inside a onClipEvent handler it doesn’t search the framelabel INSIDE the movie but in the parent-timeline of the movie.
NOTE (by Stan V.) The labels are not really compiled to numbers, they stay as a string in the SWF (MX, MX2004). Even if placed on the root (gotoAndPlay(’label’); However Flash still converts scene offsets to numbers. The described bug doesn’t manifest itself here in MX2004.
Well this explains the problems I had using frame labels when I first got Flash 5. I remember getting very frustrated and frequently resorting to using framenumbers instead. For some reason I didn’t encounter it at all after a while - must have subconciously avoided it - aversion therapy or something....
One more thing to mention: if you are using scenes, even gotoAndPlay with framenumbers is faulty. Same workaround here, use it with “this.”
This bug is still in full effect in mx
This bug is still in full effect in Flash 7 (MX 2004).
Math.pow( 0, 2 ) returns NaN
but 0^2 = 0 * 0 = 0 corrected in mx
* n = “l” + ++i; is converted to n = “l”+++i; when switching from expert to normal mode. Use () around ++i to avoid that.
MX: If you enter hexadecimal numbers into a componentparameter of type number, the value is set to 0.
workaround: Use type string and parseInt inside your component.
F5: An empty inputfield on stage can slow down your as-animations extremely.
workaround: Put something into the field, maybe a blank, or set the focus to it.
MX: long names for your objects in library are truncated in the exchange window (which open if you press exchange in the properties panel)
workaround: use short names (welcome to the millenium edition of flash)
MX: If you have a masklayer and put something else on it, and leave this new thingy selected, the masklayer is not updated
workaround: deselect it
MX: mc.getBytesLoaded shows the uncompressed size of the swf, not the bytes which have to be downloaded
MX: Sorting of Arrays of objects doesn’t work with for in loops
workaround: after sorting you have to use “for i=0” loops
MX: Sorting of the xml.childnodes array doesn’t work at all
workaround: you have to use your own sorting routines
Wrong display of imported Bitmaps, eg. if you import a png and publish the movie, the upper left and rigth edge are doubled, while the right und the bottom edge are cutted.
workaround: add a transparent 1 pixel frame to your bitmaps
NOTE (by Stan V.) One pixel is enough if the bitmap is pixel aligned and not moving. If it has to move or it’s not pixel aligned, use 2px transparent border instead. NEVER EVER make a bitmap cross the zero coords of the scene or a movie clip (it doubles the lines there too).
Autoformat destroys code, try it by yourself:
//before formatting for (i=1; i<=10; i++) { if (i==5) { continue; } trace(i); } //after formatting for (i = 1; i <= 10; i++) { if (i == 5) { } trace(i); }
ups, don’t you miss something ? (continue is gone) workaround: use an external actionscript editor, or simply don’t use autoformat
workaround (ugly): create an external actionscript file consisting only of ‘continue;’, then wherever you need a continue statement, #include it.
now that is ugly!
Moving a frame to a layer directly following a nonempty folder does not work. The frame is moved to a layer inside the folder.
Workaround: Insert an empty layer after the folder
ASBroadcaster.broadcastMessage doesn’t re-evaluate the listeners list, if a listener is removed. So listeners may be jumped over if you remove more than one at the time. You can find a possible workaround at the end of ASBroadcaster.
Clicking at the end of a dynamicly created input field doesn’t allow you to insert characters. A possible workaround is to use the Selection-object to temporarely set the cursor to the beginning of the textfield, eg.
_root.createTextField("_text", 100, 0, 0, 200, 30); var tf = _root[["_text"]; tf.html = true; tf.embedFonts = true; tf.multiline = true; tf.wordWrap = true; tf.type = "input"; tf.htmlText = '<font face="arial">' + System.capabilities.version + '</font>'; tf.onSetFocus = function() { var ci = Selection.getCaretIndex(); Selection.setFocus(this); Selection.setSelection(0,0); Selection.setSelection(ci,ci); }
AdamLounds - Confirmed this bug, but can only reproduce when using embedFonts. Thanks for the suggested workaround
Keyframes in masks or in masking graphics, send masked MCs back to frame 1 and fires load event there
workaround: memorize your relevant MC data like _currentFrame or variables in the _parent of your MC every frame (via enterFrame event) and reset it in onClipEvent(load) script
example:
onClipEvent (enterFrame) { this._parent[[ this._name add "_currentframe" ] = this._currentframe } onClipEvent (load) { this.gotoAndPlay(this._parent[[ this._name add "_currentframe" ]) }
MX: this could be a workaround for the ‘textField tabbing cursor (caret) non-disappearing problem’ : (credits go to Ralf Siegel)
// respects to // ralf siegl (audiofarm.de) _global.bulldozer = {thickness:400, plate:""}; bulldozer.onSetFocus = function(oldFocus, newFocus) { this.ci = Selection.getCaretIndex(); Selection.setFocus(this); Selection.setSelection(0,0); Selection.setSelection(this.ci,this.ci); var e = newFocus.text.length - this.thickness; newFocus.text = newFocus.text.substring(0, e); var t = oldFocus.text; oldFocus.replaceSel(this.plate); oldFocus.text = t + this.plate; } Selection.addListener(bulldozer); for (var i = 1; i <= bulldozer.thickness; i++) { bulldozer.plate += " "; }
Unloading a swf from a level > 0 which has references to a runtime shared library doesn’t release its memory.
Jpgs wider than 2880px are cropped or simply not loaded.
Mouse.hide doesn’t work if the text of a dynamic textfields contains a link.
mc.onLoad is only called if the script attached to mc is not empty.
If you invoke a method of an object inside a with statement, super does not work correctly inside that method.
getURL(”mailto:info@helpqlodhelp.com”) doesn’t work in projector on W2K and WinXP with Outlook Express as default email-client it works on Win98 though
cure: Open the player in a hexEditor and find some strings like mailto, http, https, ... Change the heathenish “mailto” to the old testamentary “nailto”. Now it works :) (It seems like the player trys to start the wrong program if it recognizes mailto-links, thanks to albu for pointing that out)
Bitmaps below 1639 pixel are not shown correctly.
When Korean Fonts are embeded in dynamic text field and input text field, none of Korean letters displays.
textfield.autoSize
DESCRIPTION if textfield.autoSize is set to either “right”, “left” or “center”, and the TextFormat.align property is set to “right” the textfield “grows” on a enterFrame basis(, although there is no such event triggered by any code in my example). e.g.: if autoSize is set to “right” it grows to left.
STEPS TO REPRODUCE i made a little example that shows this pretty well. just copy paste the code below into a new fla file and test the movie.
_root.createTextField("test_txt", ++depth, 300, 20, 0, 0); test_txt.border = true; test_txt.variable = "testVal"; test_txt.embedFonts = false; test_txt.type = "input"; test_txt.selectable = true; test_txt.multiline = false; test_txt.text = "JUST CLICK INTO ME."; test_txt.textColor = 0xFF160B; test_txt.autoSize = "right"; // <<<< test_fmt = new TextFormat(); test_fmt.font = "_sans"; test_fmt.size = 12; test_fmt.color = 0xFF160B; test_fmt.align = "right"; // <<<<< test_txt.setTextFormat(test_fmt);
/* These value pairs work fine: ----------------- test_txt.autoSize = "left" test_fmt.align = "left"; ----------------- test_txt.autoSize = "right" test_fmt.align = "left"; ----------------- test_txt.autoSize = "center"; test_fmt.align = "left"; ----------------- test_txt.autoSize = "right"; test_fmt.align = "center"; ----------------- test_txt.autoSize = "center"; test_fmt.align = "center"; ----------------- test_txt.autoSize = "left"; test_fmt.align = "center";
these don't: ----------------- test_txt.autoSize = "left"; test_fmt.align = "right"; ----------------- test_txt.autoSize = "right"; test_fmt.align = "right"; ----------------- test_txt.autoSize = "center"; test_fmt.align = "right"; */
cheers, cmyk
// the swf file this code generates crashes the players (standalone/plugin/...) doc = new XML('<body><h1><h2>line1<br/>line1,5</h2></h1><h3>line2</h3></body>'); doc2 = doc.cloneNode(true); // doc2.appendChild(doc2.firstChild.firstChild); // this works doc2.insertBefore(doc2.firstChild.firstChild, doc2.firstChild); // this doesn't
Some bugs I found: I created a page with many identical-ish flash movies (different “txt” variables in the FlashVars) as text preview boxes with an embedded font.
something like
createTextField("txtMovie",100,0,0,100,30);
txtMovie.type = "input";
txtMovie.variable="txt";
txtMovie.text=txt;
txtMovie.embedFonts = true;
txtMovie.setTextFormat(myfontFmt);
With a single text box it works every time, but the project I’m working on means that we have 15 of them on the HTML page. In IE5, some of them (tends to be about 4, but varies) have invisible text boxes - you can’t edit them or see them and the cursor remains as a pointer rather than switching to an I bar, but a debug textbox shows that the textField object is there and that it has the correct contents, text length, text width etc etc.
My workaround was to create the textfield in frame 1, destroy it and then recreate it at frame 2 (even at the same depth with the same instance name) and then sit in a loop between frames 3 and 4.
This works better, but the problem still occurs, so I had to put in a manual javascript button to restart the movie (which gives users a workaround, but sucks somewhat). In IE6, all the movies are fine even without the faffing about.
Update, Nov03
The bug is still present in IE6, just lessened. I have now isolated the problem - the Stage object isn’t set up properly until the movies are displayed on screen (I was using Stage.height and Stage.width to create a textbox the same size as the movie). A loop at the beginning of the movie to wait until Stage.height is non-zero fixes the problem. Yay me!
The second problem was that textfields as above with no content (ie txt=”“) are not editable when using an embedded font. To work around this I called the following code from within the txtMovie.onChanged() function
if (txtMovie.length) { if (currentlymyfont == 0) { txtMovie.embedFonts = true; txtMovie.setTextFormat(myfontFmt); txtMovie.onSetFocus(); currentlymyfont=1; } } else { txtMovie.embedFonts = false; txtMovie.setTextFormat(sansFmt); currentlymyfont=0; }
so that the font of the textfield is reset to an internal font when the textfield is empty. I set sansFmt = new TextFormat(”_sans”, pointsize, col); and myfontFmt = new TextFormat(”myfont”, pointsize, col);
Use setNewTextFormat() instead of setTextFormat()
put a simple vector line on a frame. duplicate the line by pressing ctrl+D. now you have selected the new duplicated line. but changing its color also affects the color of the base vector.
MacOS specific When pasting text containing special characters (like é, è, â, etc) into a textfield of a movie rendered with FlashPlayer on MacOS X (in browser or standalone), the special characters are displayed as black square boxes. All the rest of the text (normal ASCII) is displayed ok. This is a MacOS-specific problem. I haven’t tried in MacOS 9 or less.
Have you tried checking the ASCII codes of the pasted text? Don’t forget that windows has “weird” font encodings for anything over ASCII 128. Compare the character codes with expected values. Fonts often use rectangular boxes to denote character codes which it doesn’t have information about.
MX04
- Scrollwheel in AS-editor scrolls 1 row down but 1 page up.
MC’s loaded in _levelx run slower than when loaded in _level0.someMC, at least in the Mac FP 7.
XML and onLoad events
If you try to load a zero-length XML file in Flash, the onLoad never fires. If the XML file does not exist or if it has some bytes, the onLoad fires. Safari is even worse. Safari does not fire onLoad for non-existent XML files, unlike the other browsers.
If you rotate an component in the editor, the component gets wrong dimensions. You can test this by rotating the standard button component or one of your selfmade components in the editor. The component gets the bounding box width and height as it’s width and height and nothing as it’s _rotation parameter. This works in preview and published flash, but is quite annoying if you’re trying to create your own components. No known workarounds.
Flash Projector bug - special characters
It seems that a Flash projector executable deployed in a folder that contains special characters like (è,é,ê,ë,ì,í...and so on) can’t load external files anymore. Although less probable, this could happen when deploying large flash projects on a localized Windows system (for example in a Spanish Windows system, Program Files folder is actually named Archivos Del Program)
Inspectable Objects Cause Crashes
Flash can crash when the Component Definition for a symbol in the Library is set by Inspectable meta tags. The behavior appears only when a property contains multiple variables, but the crashes don’t happen every time it parses the metadata.
Confirmation and additional information
Partial Solution When you update any Inspectable properties, set the class in the Component Definition dialog, then go back and clear it. Clearing the class leaves the properties in place. This minimizes any instability because Flash parses the metadata every time it builds a SWF.
Extending a class
Three classes C (the superclass), B and D (subclasses).
class C { function C() { trace( "C constructor"); } } class B extends C { function B() { super(); trace( "B constructor" ); } } class D extends C { function D() { super(); trace( "D constructor" ); } }
Calling “new D()” results in the expected output...
C constructor D constructor
Calling “new B()” does not quite do what it says on the tin...
B constructor
Note the absence of the superclass constructor, despite calling “super()”. Rename the class “B” to follow “C” alphabetically and it will behave like “D”.
This could cause major headaches extending “XML” or something similar!
This is an MTASC bug - and can be avoided by explicitly importing the classes.