A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [F8] How do i incorporate javascript?

  1. #1
    Member
    Join Date
    May 2007
    Location
    London
    Posts
    53

    [F8] How do i incorporate javascript?

    ok i am having sooo much trouble trying to figure this out, i really don't get a chance to use flash that often but am trying to teach myself. I am opening an external swf into a new window but i want to be able to specify the dimensions of the new window and have no address bar ect. I was told to incorporate javascript and have this script:

    PHP Code:
    on (release) { 
    getURL("javascript:window.open('test.swf','newWindow','toolbar=0,location=0,directries =0,status=0,menubar=0,scrollbars=0,resizable=0,width=345,height=345,left=0,top=0')"); 

    The thing that doesn't work is the dimensions of the new window and i think it is because of how i am using the script. I am simply putting this script over the button. Is this correct? Anybody done something like this before that does work?

  2. #2
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,046
    You should be using ExternalInterface for the Javascript call:
    Code:
    ExternalInterface.call("window.open", "test.swf", "newWindow", "width=345,height=345");
    Now with your code before, was the window at least opening? Just not the correct size?

  3. #3
    Member
    Join Date
    May 2007
    Location
    London
    Posts
    53

    it didn't work ...

    Hi,

    I tried that code and it didn't work. I just put it on my button right? Nothing happening, no window even tried to pop up.

    With my previous code a window looks like it starts to open but then quits every time.

    I'm not sure how the javascript bit works, should i have a html page with some javascript in somewhere in my folders? Or maybe some script on the main timeline? I am so lost and confused.


    thanks,

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    See this technote

    gparis

  5. #5
    Member
    Join Date
    May 2007
    Location
    London
    Posts
    53
    thanks for getting back to me. I have tried this one before and just tried it again to double check and maybe this will help figure out why it is not working.

    I tried clicking on both the getURL_javascript swf and FSCommand swf but never worked. The javascript one tired to open and then quit and the FSCommand swf did nothing.

    Any ideas what it can be?

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