PDA

View Full Version : hyperlink to JavaScript to flash


javaFla
09-30-2004, 01:24 AM
I am trying to call a .html file with an embedded .swf, from a hyperlink, then pass arguments/values to it that tell it what resources to load.

My approach so far ;

//build a new html doc in JavaScript, embed swf
myHTML='<HTML>\n'; etc.
myHTML+='<EMBED src="myfile.swf"....></EMBED>\n';

//open new window with the html
mywindow=window.open();
myDocument=mywindow.document;
myDocument.write(myHTML);

//finally my attempt to pass the values...
myDocument.setVariable("myVar",'strng2')

Please help if you see whats wrong or know a better way ...thanks

tg
09-30-2004, 02:51 PM
so if your writing out the entire html doc like this in javascript, then you can grab the url, strip out everything beyond the '?' (if you use get to send variables) then grab they variable value pairs, they should all be separated with '&'.

tg
09-30-2004, 02:52 PM
oops...

pass them into flash via flashvars.
also, don't forget to include the <object> tags in your html, unless you don't want ie to view the page of course.

javaFla
10-01-2004, 01:23 AM
Thanks a bunch tg. Your info opened up a simpler way to do it(sending, retrieving them via the URL)

JF