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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Actionscript/javascript problem

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


    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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 Posts: 4,415 ✭✭✭chupacabra


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


  • Registered Users, Registered Users 2 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, Registered Users 2 Posts: 4,415 ✭✭✭chupacabra


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


  • Advertisement
  • Registered Users, Registered Users 2 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, Registered Users 2 Posts: 4,415 ✭✭✭chupacabra


    No Im using Flash 8 professional.


  • Registered Users, Registered Users 2 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, Registered Users 2 Posts: 4,415 ✭✭✭chupacabra


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


Advertisement