homepage Welcome to WebmasterWorld Guest from 54.227.11.45
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Javascript to Flash communication problem
sending variables to embedded flash from javascript
matt_poole




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

Hi,

*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 (){
var1++;
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).

 

matt_poole




msg:1486610
 1:51 pm on Jun 12, 2003 (gmt 0)

ok,

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 ]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved