Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > HTML and JavaScript

Reply
 
Thread Tools Rate Thread Display Modes
Old 09-30-2004, 01:24 AM   #1
javaFla
Registered User
 
Join Date: Sep 2004
Posts: 4
Default hyperlink to JavaScript to flash

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
javaFla is offline   Reply With Quote
Old 09-30-2004, 02:51 PM   #2
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
Default

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
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 09-30-2004, 02:52 PM   #3
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
Default

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.
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 10-01-2004, 01:23 AM   #4
javaFla
Registered User
 
Join Date: Sep 2004
Posts: 4
Default

Thanks a bunch tg. Your info opened up a simpler way to do it(sending, retrieving them via the URL)

JF
javaFla is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:14 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.