A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Can't get this to work! HELP!

  1. #1
    Junior Member
    Join Date
    Apr 2002
    Posts
    28
    OK for some reason I cannot get Flash MX to open pop ups using Javascript, I've even used the FlashDB code generator and I can't get them to work. Here's code from my button
    on (release) {
    getURL ("javascript:Mikewindow=window.open('http://www.anotherdimensiontattoo.com/tattoos.html','Mike','width=800,height=600,left=0, top=0,
    toolbar=No,location=No,scrollbars=No,status=No,res izable=No,fullscreen=No'); NewWindow.focus();
    void(0);");
    }

    What am I doing wrong?

  2. #2
    Junior Member
    Join Date
    Apr 2002
    Posts
    29
    Well, what I've done in the past is just have Flash call a javascript function in my HTML page.

    So in your html page is:

    function launchwin(winurl,winname,winfeatures)
    {
    newwin = window.open(winurl,winname,winfeatures);
    }


    And in flash:

    getURL ("javascript:launchwin('URL' , 'newwindow' , 'height=480,width=620')" );

    (This is code I have from something I made in flash 5. Haven't directly tested it with MX.)

  3. #3
    Junior Member
    Join Date
    Apr 2002
    Posts
    28
    Originally posted by dogheadbone
    Well, what I've done in the past is just have Flash call a javascript function in my HTML page.

    So in your html page is:

    function launchwin(winurl,winname,winfeatures)
    {
    newwin = window.open(winurl,winname,winfeatures);
    }


    And in flash:

    getURL ("javascript:launchwin('URL' , 'newwindow' , 'height=480,width=620')" );

    (This is code I have from something I made in flash 5. Haven't directly tested it with MX.)
    So would the toolbar, menubar, etc options be controlled in the flash code or the html code under winfeatures?

  4. #4
    I'm having the same exact problem. Not certain if it's browser issues or the flash 6 player ...

    When I send viewers to my site (created with MX) who don't have the Flash 6 Player ... THEY GET A BLANK SCREEN! How do I resolve this through publish settings?

    Thanks. Please respond.

    Frank

    the problem : http://www.angelettidzine.com/temp.html

  5. #5
    Junior Member
    Join Date
    Apr 2002
    Posts
    29
    Originally posted by TonyFL
    So would the toolbar, menubar, etc options be controlled in the flash code or the html code under winfeatures?
    I believe the Javascript function I mentioned, launchwin(), opens a window without any toolbars and all that stuff by default. But you could use the javascript function you had originally too. In that case, yes, you would pass those FROM flash where "winfeatures" would be.

    In my example, when flash passes 'URL' that matches up with 'winurl,' 'newwindow' is sent to 'winname', and 'height=480,width=620' is indeed sent to 'winfeatures'.

    Don't forget to encapsulate the fuction on your HTML page between javascript tags. (How do you get this message board to ignore HTML tags by the way?)

  6. #6
    Junior Member
    Join Date
    Apr 2002
    Posts
    28
    You should make a detect plugin to check for Flash 6 player... or you should save it as a flash 5

  7. #7
    Junior Member
    Join Date
    Apr 2002
    Posts
    28
    alright I'm bein a big dummy... does the javascript get embedded in the html of the page the movie is in or in the html of the page I am popping up?

  8. #8
    Junior Member
    Join Date
    Apr 2002
    Posts
    28
    I've tried everything and nothing will work.. I think it has to do with Flash MX... I tried using JavaScript window.open and the URL and I just got a blank window that said [object] and another smaller window with no toolbar/menubar that was a 404. Does anyone know how to do this?

  9. #9
    Junior Member
    Join Date
    Apr 2002
    Posts
    29
    TonyFL,

    Sorry I haven't been able to help you. Maybe you should use a different function than window.open?

    Here is the url to my example. It was created with MX and works:

    http://www.dogheadbone.com/client_area/tony/main.html

    Here's the source in a .sit archive. If you're on a pc, I think you can still open a .sit file with the latest version of WinZip:

    http://www.dogheadbone.com/client_area/tony.sit

  10. #10
    Junior Member
    Join Date
    Apr 2002
    Posts
    28
    You're awesome man that's exactly what I need but I can't open it!! Can you just post the .fla?

  11. #11
    Junior Member
    Join Date
    Apr 2002
    Posts
    28
    Nevermind I got stuffit and got it working thanks! I will let you know when I get it working... here's the site I'm working on just so you can see what I'm using it for
    http://www.tones321.com/welcometoanotherdimension.swf
    'm using it for the artist portfolio pages...

    THANKS!!!

  12. #12
    Junior Member
    Join Date
    Apr 2002
    Posts
    5
    Hi TonyFL,

    I know I'm a little late to the party here... but I thought I'd post this small script for you just in case you're still having trouble:

    on (release) {
    getURL ("javascript:window.open('yourpage.html','yourpage ','scrollbars=yes,width=500,height=600,top='+((scr een.height-600)/2)+',left='+((screen.width-500)/2));void(0);");
    }

    I haven't put any JavaScript in the .html file at all and it works like a champ as published for Flash 5 from Flash MX.

    It may be a little too simple for what you're trying to achieve, but from what I have gleaned from this thread, it might just be the thing you need.

    Nice site you're working on! I hope this helps.

    Cheers!

  13. #13
    Junior Member
    Join Date
    Apr 2002
    Posts
    28
    Well, got it working by embedding in the html. Thanks anyways Bert but I will remember the one you gave me. Here's the working example. I'm gonna spice up the HTML pages some.
    http://www.anotherdimensiontattoo.co...dimension.html

    Tony

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