PDA

View Full Version : Passing jsfl variable to actionscript


vodo
03-12-2008, 05:06 PM
Hi,

I think I am actually going mad with this! Is there any simple way of passing a variable from a jsfl file into actionscript?

I am basically getting the path of a swf in jsfl that I want to use in the loadMovie variable.

Any ideas?

Cheers

TomPac
03-13-2008, 11:25 AM
Im not an expert but can you paste some code so ill understand what exactly youre trying?

vodo
03-13-2008, 03:27 PM
sure:



var randomMovie = fl.browseForFileURL("select", "Import File");

doc.getTimeline().layers[0].frames[0].actionScript = "loadMovie(randomMovie , randomMovie);"




I want the the randomMovie variable to be passed to the action script. If I use that code now then it just puts this into the actionscript, instead of the url.


loadMovie(randomMovie , randomMovie);


Now after this I find I have another problem. I'm loading the swf in because it has lots of movieclips in that won't work if i just import it. But if I was to use the final swf on a differnt comp or upload it then it won't work because the location would be wrong.

is there any way to load a swf into a fla and then export it with all its movieclips working?

I doubt I am making any sort of sense here.

quincewyss
03-18-2008, 08:51 PM
Are you trying to make it copy code to your clipboard?

I found when creating the string you need to delimite " and \.

the weird part is when you do this you need to do it for the java and the flash string so " looked like \\\" and \n looked like \\n


Also with your code copy it to the clipboard. not everyone will have the same location for ther actions.


Hope this helps.

Quince