Close floatbox from flash button

Page: 1

Author Post
dinospeed
Guest
Hi.
I really need some help for this.

I am opening a floatbox (html content) with a swf embedded on a html page.
Can I put a close button in that swf this code is not working on the button:

on (release) {

getURL("javascript:fb.end(true)");

}

Do I have to put the float box css and js in the opened html window.

Thanks for all the help.
Administrator
Registered: Aug 2008
Posts: 3382
Putting the floatbox.js and css in the html (iframed) content would work, but there's a simpler way. Just use parent.fb.end instead of fb.end.

There reference to fb is in the context of the window that the code is executing in. That window is the iframe's window, and does not have floatbox loaded and so does not have a global fb variable. But the parent window does have floatbox loaded. So parent.fb works.
dinospeed
Guest
Thanks for the tip.
It worked with the first solution, yet I will take the other to consideration, so it wont have to load the js and css in the new window.

Thanks for all the great support.

Page: 1