PDA

View Full Version : Flash and JavaScript


Gil Levinson
01-23-2005, 01:42 PM
Hi,

I try to call to some javascript function from my flash document but nothing
happen.
How do i include a .jsfl file in my flash actions.

I'm trying to call to getDocumentCOM()'s properties and methods as i saw
in some samples but i always get an empty string as the result.

I don't need the javascript to be as a panel only for run time to be able
access the layers and the movie clips in my flash document.

Please help

Thanks in advance
Gil

tdoublea
01-23-2005, 09:26 PM
Welcome Gil Levinson.

JSFL can only be used within the FLash IDE. JSFL commands cannot be excuted during run-time of an SWF.
the MMExecute command in actionscript can be used to run JSFL commands but are used only in swfs run in the IDE as a custom panel (WindowSWF), XMLtoUI, or timeline effect preview.

If you would like to use the dom's properties in your movie, you could run a command to fl.trace these in the output you prefer, and then copy that from the output panel and place it in your actionscript.


-hope it helps

** it's probably a type-o, but it is getDocumentDOM().

-t

Gil Levinson
01-24-2005, 04:46 AM
Thank you for your reply but i'm not sure i understand,

1. What do you mean that i have to work only in IDE ?
2. How do i execute a function in .jsfl file from the flash document ?
(as i worte before i get an empty string if i use MMexecute)
3. How do i run a command with fl.trace ?
4. Is it possible to access the layers and the elements in those layers
in my flash document in runtime with dom's properties?
5. Can you send me a very simple .fla file where i can see how to
call the dom's properties from a flash ?

Thank you
Gil

hangalot
01-24-2005, 11:32 AM
welcome,
1. jsfl only works inside the flash editor meaning flash mx 2004 program thus at design time
2. mmexecute only works in a windowSWF, read the documentation about that
3. fl.trace is to do a trace in jsfl not run a command
4. yes!
5. i posted some examples here: http://johan.plasmapudding.com/index.php?id=196