Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Javascript to Flash communication problem

sending variables to embedded flash from javascript

1:30 pm on Jun 12, 2003 (gmt 0)

New User

10+ Year Member

joined:June 11, 2003
votes: 0


*newbie alert* :)

heres my problem, thanks for any help you can give me...

I've got an <iframe> with a button in it that calls a js method that I want to use to send to a flash movie in the parent window.

I can only get this to work if I put the flash object in another frame. So the button in the first frame calls:

var var1
function sendVars (){
parent.frames[1].myFlash.setVariable("stepNo", var1);

...and passes the var1 to the second frame in the parent and onto the flash object. This works fine.

My problem is the margin around the flash object in the iframe throws out my design. I tried putting the flash object staight into a cell that was aligned with the rest of the page and used:

parent.myFlash.setVariable("stepNo", var1);

...it didnt work (ie the vars did not go to flash) did I get the js right?

alternatively is there a way of aligning the contents of the iframe so that I dont get the margin and scrollbars (the space I have on screen for the .swf is set).

1:51 pm on June 12, 2003 (gmt 0)

New User

10+ Year Member

joined:June 11, 2003
votes: 0


I've kind of sorted it out for myself by setting the <iframe marginwidth="0" scrollin="no">, but I still cant get the js right when the .swf isnt in an iframe. This way seems a neater way of doing it so can anyone suggest where Im going wrong?

btw heres a link to the macromedia technotes on js-to-flash communicattion....

[macromedia.com ]