Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Actionscript/javascript problem

Options
  • 05-06-2006 2:15am
    #1
    Registered Users Posts: 4,413 ✭✭✭


    Hello, one of my recent websites has requred my to call a new window from a flash button of set dimensions, to do this I needed to call a javascript function from the flash button that I had inside my html page. The code seems to be ok and has worked for other people but I cant seem to get it working on my page. The actionscript behind the flash button is as follows:
    on (release) {
    getUrl ("javascript:newWindow('ico.html')");
    }

    And the script function is as below:
    <script language="javascript" type="text/javascript">

    function newWindow(newWin){
    newWindow = window.open(newWin,"popUp","width=700,height=500")
    newWindow.focus()
    }
    </script>

    Is there any problem here Im missing? If so what other ways would you recommend I could use action script to call a new window from a flash object. Thanks :)


Comments

  • Registered Users Posts: 255 ✭✭Pixel8


    Try this but just change the dimensions and page link:

    on (release) {
    javascript("window.open('map.htm','','width=857,height=610,resizable=no,scrollbars=yes,toolbar=yes,top='+((screen.availHeight/2)-(348/2))+',left='+((screen.availWidth/2)-(264/2))+'');void(0);");
    }


    The other code used above positions your new window in the centre of the screen. You only need to use this code on the flash button, you dont need any script inside your html page.


  • Registered Users Posts: 64 ✭✭Legend_Killer


    you can create a popup with the following:

    on (release) {
    getURL('javascript:window.open("popup.html","PopupNameHere","height=400,width=400");void(0)')
    }


  • Registered Users Posts: 4,413 ✭✭✭chupacabra


    The above dont work for me, does testing it locally change anything? Thanks for your help.


  • Registered Users Posts: 255 ✭✭Pixel8


    Test it on your server... it should work locally as well once your html file is in the same folder as your FLA/SWI or SWF file.


  • Registered Users Posts: 4,413 ✭✭✭chupacabra


    Unfortunatley it still doesnt work. Nothing happens at all when I click the flash button. Thanks for your help.


  • Advertisement
  • Registered Users Posts: 255 ✭✭Pixel8


    Ok, you must be using Dreamweaver or something like that to do your Flash button? I dont think Dreamweaver supports actionscripting on flash buttons. You'll need to make the button in Flash or SwishMax.


  • Registered Users Posts: 4,413 ✭✭✭chupacabra


    No Im using Flash 8 professional.


  • Registered Users Posts: 255 ✭✭Pixel8


    I dont use Flash myself, i use SwishMax but there should be a debug panel somewhere in it... What does the debug panel say when you click the flash button?


  • Registered Users Posts: 4,413 ✭✭✭chupacabra


    Nope debug comes up blank, no noticable errors that the software can detect anyway. Hmm this is quite puzzling.


Advertisement