A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 23

Thread: launching popup windows from flash

  1. #1
    Junior Member
    Join Date
    Nov 2001
    Posts
    28

    Smile

    i am trying launch a pop window for each one of the thumbnail images within my flash portfolio but i can't exactly figure out how to do this. i have the javascript to do it from within a web browser but i really need this to work from flash. anyone know how to do this?

  2. #2
    FK's Super Loquacious Randomite ad_mtk2's Avatar
    Join Date
    Jun 2001
    Location
    Calgary, AB Born of bread in Bristol, UK
    Posts
    1,273
    you will need to use the FS command.

    try here and scroll down to wear it says 'FSCommand':

    http://www.macromedia.com/support/fl...up_windows.htm


    hope that helps

  3. #3
    GAME ON!!!! megatoon's Avatar
    Join Date
    Jun 2001
    Location
    The Lonely End of the Rink
    Posts
    3,481
    http://www.flash-db.com/PopUp/

    Try this generator, fill in waht you need. Then paste the code into the GET URL of the button

  4. #4
    Junior Member
    Join Date
    Nov 2001
    Posts
    28
    cool...i had a feeling an fscommand would be necessary. haven't used this feature before...hopefully i can get it working. thanks for the tip!

  5. #5
    Junior Member
    Join Date
    Nov 2001
    Posts
    28

    popup no workie :(

    man i cant get this **** to work right. i attached the geturl javascript to the button in my flash movie and when i click it it launches a blank browser window (not popup window) and is named 'untitled'. this is what i attached to my button:

    on (release) {
    getURL("javascript:openNewWindow('http://www.mywebsite.html','thewin','height=30,width=400, toolbar=no,scrollbars=no')", "_blank");
    }


    i also put this in the published flash document as the tutorial says:

    <script language="JavaScript">
    function openNewWindow(URLtoOpen, windowName, windowFeatures) {
    newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
    </script>

    can anyone tell me why it is not pointing to the .html documents i created for my popup images???

  6. #6
    Junior Member
    Join Date
    Jun 2002
    Posts
    29

    on (release) {
    getURL("javascript:openNewWindow('http://www.mywebsite.html','thewin','height=30,width=400, toolbar=no,scrollbars=no')", "_blank");
    }
    If your page is named mywebsite.html then the code should be:

    on (release) {
    getURL("javascript:openNewWindow('mywebsite.html', 'thewin','height=30,width=400,toolbar=no,scrollbar s=no')");
    }

    "_blank" is not needed because you are already telling it to:
    openNewWindow

    Yes??

    Same tutorial can be found here >> http://www.cbtcafe.com/flash/ but in Quicktime .mov format.

  7. #7
    Junior Member
    Join Date
    Nov 2001
    Posts
    28

    no dice

    i went into my flash file, removed the _blank tag and now when i click my thumbnail in my flash movie it does nothing at all. ???

  8. #8
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    You can't call javascript functions from within Flash.

    Use

    on (release) {
    getURL("javascript:window.open('http://www.mywebsite.html','thewin','height=30,width=400, toolbar=no,scrollbars=no')", "_blank");
    }

  9. #9
    Junior Member
    Join Date
    Jun 2002
    Posts
    29
    SJT... really? it seems to work fine for me.



    humphooey... are you still placing:

    <script language="JavaScript">
    function openNewWindow(URLtoOpen, windowName, windowFeatures) { newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
    </script>

    between the < head > tags?



  10. #10
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    You can't in IE for Mac, might as well just do it all through actionscript anyway...

  11. #11
    Junior Member
    Join Date
    Nov 2001
    Posts
    28

    Smile

    iArt....yes i still have that in my <head> section

    i know very little about javascript so i am just copying and pasting the script from the tutorial and changing filename's where necessary. it still launches a blank window when i trigger the button inside my flash movie...but it appears that it can not seem to locate the pages i created for the individual image pages i created for the popup windows. there must be one little scripting error somewhere. i will keep tinkering... thanks!

  12. #12
    Junior Member
    Join Date
    Nov 2001
    Posts
    28
    if SJT is right then that may be the source of the problem. i am trying to preview it in IE5 for Mac. i wasn't aware that IE may not support this feature

  13. #13
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    Basically, none of the javascript functionality used with FSCommands works.
    This doesn't really make any difference, as you can do it all from within flash anyway.

    window.open is the actual javascript call to make, so there is no difference really. Edit your button code and replace openNewWindow with window.open

  14. #14
    Junior Member
    Join Date
    Nov 2001
    Posts
    28
    okay one thing i noticed though:

    I was looking at the source code from the one tutorial and it included the following:

    <!-- URL's used in the movie-->
    <A HREF=javascript:openNewWindow('http://www.macromedia.com','thewin','height=400,width=400 ,toolbar=no,scrollbars=yes') ></A>

    when i publish my movie from flash it does NOT list anything under <!--url's used in movie--> i have 5 different buttons in my flash movie, each one is supposed to launch a different popup window (or url). am i supposed to manual add the <ahref> ... </a> contents to my html document or is flash supposed to do that automatically? if so why isnt it appearing in my source file?

  15. #15
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    Flash does it, i'm not sure why they aren't appearing in your published files

  16. #16
    Junior Member
    Join Date
    Nov 2001
    Posts
    28

    problemo...

    okay i must have a problem with Flash not publishing the html document correctly b/c there is absolutely nothing under the url tag and under the <!-- text used in the movie--> it repeats the text contained in one of my movieclips about 50 times. i manually inserted the code after the <!-- URL's used in the movie--> line but i still get just a blank browser window.

    f' it. i give up

  17. #17
    Senior Member
    Join Date
    Dec 2001
    Posts
    197
    Originally posted by humphooey
    i am trying launch a pop window for each one of the thumbnail images within my flash portfolio but i can't exactly figure out how to do this. i have the javascript to do it from within a web browser but i really need this to work from flash. anyone know how to do this?
    -------------------------------------------
    I just made a POP UP window thing I went to that Db generater place entered my URL copyed the code , I went to action on the invisible button , on release url thing _self
    after I did all 6 photos I saved as then published settings all 3 then OK then I went to preview plublish HTML . thats all you got to do. you must make sure when adding the code from the Db generater you enter ONLY the code within "javascript" not the QUOTES . CHECK this URL .. to see if this is what you want to do .

    removed as inappropriate content for Flashkit

    <mod edit>sorry, G13 site.
    david p.
    [Edited by david petley on 06-07-2002 at 11:55 PM]

  18. #18
    For medicinal use only.
    Join Date
    Apr 2002
    Posts
    33
    i had the same problem...

    try this, it worked for me.



    on(release){
    getURL("JavaScript:window.open('http://www.your_url.com/webpage.html','name_your_window','height=200,width =200');void(0);");
    }




    put this action on the button you want the pop-up window to open(in flash not html).

  19. #19
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    Oops yeah, sorry... I forgot void(0);

  20. #20
    Junior Member
    Join Date
    Nov 2001
    Posts
    28

    finally

    i looked it this again today and now the popup windows come up fine for some reason. i just followed the example verbatim from this site:

    http://www.cbtcafe.com/flash/popupwi...upwindows.html

    the only problem i see is if the user does not close the current popup window, when you go to select another thumbnail from my swf movie, instead of launching a new popwindow it will swap the new graphic with the current one. so since my images are different dimensions, they either get clipped or there is a space around the image in the popup window. is there an attribute i can add to the js to make it automatically resize the popup window for each image?

    thanks for the support though, i am glad this is finally working

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center