ive found that when i use ExternalInterface to call a JS alert, that my movie will often hang. I get the JS alert like i should, no JS errors....it just locks up the swf. without having the time to dig deeper, i found a quick fix, and called the alert with a setTimeout, like this:
ExternalInterface.call("setTimeout", "alert('"+someAlertString+"')", 50); if i remember correctly, though, it was kinda picky about how i passed that 2nd param. i may have concatenated that 2nd param in a string on the line before and passed that string, or i may have passed the alert string as a 4th param.....i dont remember. i do remember that calling alert through setTimeout solved the problem though. On 11/14/06, Chris Akins <[EMAIL PROTECTED]> wrote:
Greetings, all. I've been working on an interactive quiz for a while now, and it's working correctly, except that some parts of it break after making a call to any JavaScript function. I've been trying fruitlessly to debug this for a small eternity now, and I've finally run out of ideas. Could someone try to reproduce this effect? I've been able to reproduce the bug (?) with the following setup: The components are a button symbol and three movie clips. One movie clip has three frames with a static graphic on each frame; each frame has a stop() statement on it, and nothing else. Attached to it at the root level is onClipEvent(enterFrame){ this._x=_root._xmouse; this._y=_root._ymouse; } This clip should be named 'pointer', and reside alone on the top layer. The second movie clip has the following code attached to it: onClipEvent(load){ onRollOver=function(){ Mouse.hide(); _root.pointer.gotoAndPlay(2); } onRollOut=function(){ Mouse.show(); _root.pointer.gotoAndPlay(1); } } The third and final movie clip has the same code attached to it, save that its onRollOver send the pointer clip to frame 3, rather than frame 2. The button has the following code attached to it: on(release){ flash.external.ExternalInterface.call("alert", "alert called"); } After clicking the button and thereby making the JS call, the pointer clip stops following the system mouse movements. I've seen this behavior using both fscommand and ExternalInterface, exporting for Flash Player 6 and 8. The consistency makes me believe either that it's a bug in the way that Flash handles calls to JavaScript, or that it's a really really basic error in my AS. Many Thanks, Chris Akins _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
-- John Van Horn [EMAIL PROTECTED] _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com