Followup: Opening a Thickbox iframe in Flash

My previous post, Opening a Thickbox iframe in Flash, became the most commented post in my blog history thanks to Hugo and Jason . =D

I’m really excited to see that people are reading my blog as always, but unfortunately, it seems that the code that I posted wasn’t working for them. I spent some time debugging the files Jason sent me, and I realised that the code I posted indeed didn’t work anymore, although the same code worked for me for another file still.

I haven’t found out why, but I’ve found a new solution to the problem, and this time, I’ve posted source files. The FLA is in Flash 8 format since the ExternalInterface works in Flash 8 onwards anyway. =]

The solution I found to make it work was adding the following param to the swfObject:

so.addParam("allowScriptAccess", "always");

I hope this zip helps people who’re trying to do this!

Source Files: http://www.designfission.com/opening-thickbox-in-flash.zip

21 Responses to this post.

  1. wanni's Gravatar

    Posted by wanni on 21.10.07 at 5:21 pm

    I miss talking cock with u on msn!! Gahh

  2. DarkSuiyoken's Gravatar

    Posted by DarkSuiyoken on 21.10.07 at 5:21 pm

    haha, i miss using the comp also. first time use comp after 2 weeks, feel so stunned. lol

  3. Andy Ford's Gravatar

    Posted by Andy Ford on 21.10.07 at 5:21 pm

    Finally! If only you knew how little there is on this subject. A simple problem with a not-so-simple solution.

    Many thanks for posting the ZIP!!! and hard work on this solution.

    - Andy

  4. DarkSuiyoken's Gravatar

    Posted by DarkSuiyoken on 21.10.07 at 5:21 pm

    you’re welcome. :)

  5. theboyofspewn's Gravatar

    Posted by theboyofspewn on 21.10.07 at 5:21 pm

    Thank you very much for posting this! I was looking for a method to display an iframe either “in” or “above” my flash interface, and this solution worked wonders. I did convert it over to use the Flash/Javascript gateway instead of ExternalInterface, as I already have a gateway open for other functions.

    Small interesting note, in your .zip - the HTML link does not always work, while the flash does. I have noticed in IE6 the HTML link does not work, and sometimes in IE7 it won’t. At first it didn’t work for me in IE7, and then I changed the link to read “http://www.yahoo.com?……” instead of “.com/?” and it started working, but still doesn’t work for me in IE6 for some strange reason.

    Now then, I need to go thank the writer of ThickBox for writing such a nice code…..

  6. GoddeR's Gravatar

    Posted by GoddeR on 21.10.07 at 5:21 pm

    your awsome man. everywhere i looked i saw everyone kept saying not possible. Great solution!

  7. charles's Gravatar

    Posted by charles on 21.10.07 at 5:21 pm

    great tip, thanks. i looked around and this is the advice that finally helped.
    one thing tho…any way to set a title to the thickbox?

  8. DarkSuiyoken's Gravatar

    Posted by DarkSuiyoken on 21.10.07 at 5:21 pm

    I’m glad this helped people. =]

    Charles: I’m sure it can be done with some hacking into the CSS and javascript code. I’m pretty busy recently to help you out with this though, try asking around in the Thickbox forums. I’m sure someone would be glad to help you out with this.

  9. Tinker's Gravatar

    Posted by Tinker on 21.10.07 at 5:21 pm

    DarkSuiyoken:

    Thanks a lot man…
    Your sample is working for now :)
    However there are a couple of points I don’t quite get in the actionscript code.

    - The “tb_show” js-function is followed by “null”. Why?
    - At the end of the “ExternalInterface.call” the call is ended by declaring “false”, why?

    As I wanted a “modal” functionality I have appendend this to my ExternalInterface call and omitted the “false” statement, everything seems to work ok.

    Anyway thanks again :)

  10. DarkSuiyoken's Gravatar

    Posted by DarkSuiyoken on 21.10.07 at 5:21 pm

    Hi Tinker,

    The parameters I am passing is what the default Thickbox function is asking for. The tb_show function in thickbox looks like that :

    function tb_show(caption, url, imageGroup)

    The null is for a caption, while the true/false is for the imageGroup.

    I’m glad this helped another person!

  11. Malkauns's Gravatar

    Posted by Malkauns on 21.10.07 at 5:21 pm

    Hi,
    great work - just what I was searching for. It works fine on Firefox and Safari. Are there any ideas, how to get it work on IE6 or IE7?
    Thanks a lot for the solution!

  12. Kemal's Gravatar

    Posted by Kemal on 21.10.07 at 5:21 pm

    hi…

    I tried your source files… they work perfect…

    but if i wanna change anything it doesnt work anymore….

    This is what I did:
    I changed the base.fla file and modified only the background-color. I saved it as a flash8 fla-file and published it with flashplayer 8…

    but when i edit this line

    var so = new SWFObject(”base.swf”, “sotester”, “550″, “400″, “8″, “#FFFFFF”);

    into base2.swf…. it doesnt work anymore :S

    i really dont know what to do anymore… i tried a lot of different things cant get it to work…

    weird isnt it…

  13. DarkSuiyoken's Gravatar

    Posted by DarkSuiyoken on 21.10.07 at 5:21 pm

    hmm that is weird indeed. but if all else fails, why not let the filename remain as base.swf? =P

  14. Charles's Gravatar

    Posted by Charles on 21.10.07 at 5:21 pm

    Thank you so much for this solution,

    I have been looking for one for over a month and just when I thought of trashing the project, I found your solution. I am a web designer/developer who built a website based on a customers design in Joomla using thickbox to show the link contents. After creating an interactive map in flash, I had to call thickbox through when a link in the map is clicked on…now it works perfectly well…thank you soo much…

    Cheers mate

  15. DarkSuiyoken's Gravatar

    Posted by DarkSuiyoken on 21.10.07 at 5:21 pm

    that’s great to hear Charles. I’m glad you benefited from this.

  16. hugo's Gravatar

    Posted by hugo on 21.10.07 at 5:21 pm

    Ahahahah that’s me again :D

    This one is working great for me! Thank you sooooooooo much!

    Greetings from Rio de Janeiro, Brazil :D

  17. Flash Programmer Wanted!'s Gravatar

    Posted by Flash Programmer Wanted! on 21.10.07 at 5:21 pm

    [...] The following websites have explanations, I just basically need someone to show me how to implement it into my website and flash movie.http://designfission.com/blog/2007/10/21/followup-opening-a-thickbox-iframe-in-flash/http://codylindley.com/thickboxforum/comments.php?DiscussionID=36&page=1#Item_0 [...]

  18. Ben's Gravatar

    Posted by Ben on 21.10.07 at 5:21 pm

    Thanks a ton for this. It really helped me out.

    One thing though, for anyone trying to load an ASP page into the thickBox frame: you’ll need to leave out the “/” before the question mark. I don’t know why this is, but I couldn’t get my pages to load until I removed it.

  19. Nick's Gravatar

    Posted by Nick on 21.10.07 at 5:21 pm

    exactly what I was looking for as we were doing a flash map that needed to popup windows using ThickBox functionality.

    Jus for reference, IE7 gave me fits because of when I put the wmode=transparent but once that was adjusted it ran cross browser with no problems.

    God Bless you sir!

  20. DarkSuiyoken's Gravatar

    Posted by DarkSuiyoken on 21.10.07 at 5:21 pm

    You’re welcome!

    I’m glad this is helping people until now. :)

  21. GC's Gravatar

    Posted by GC on 21.10.07 at 5:21 pm

    I have been banging my head on this for some time, thanks so much for posting the zip. Guess I am just not good at following directions!

Respond to this post