A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Opening a browser window (javascript)

  1. #1
    Junior Member
    Join Date
    Jun 2002
    Posts
    26

    Opening a browser window (javascript)

    Hello again, another question!

    I have a little window open code (that works in normal HTML).
    Here's the code:
    -----------------cut
    Nowe=null;

    function Otworz(s,w,src) {

    var Xpos=((screen.width/2)-(s/2));
    var Ypos=((screen.height/2)-(w/2));

    Nowe=window.open('main.html','',
    'toolbar=no,
    menubar=no,
    location=no,
    personalbar=no,
    scrollbars=no,
    status=no,
    directories=no,
    resizable=no,
    width='+s+',height='+w+',
    left='+Xpos+',top='+Ypos);

    Nowe.focus()

    }
    -----------------cut

    It works perfectly in browser (as HTML), but when inserted into 3DFA as Javascript element, it doesn't seem to work (but "Compile" button in Javascript window reports no problems...). What shoul i do? I can't go for "Open URL", beacuse it'll be an presentation (EXE), not the web page...

    HELP!
    Thanks in advance..

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244

    Re: Opening a browser window (javascript)

    Originally posted by skipp604
    Hello again, another question!

    I have a little window open code (that works in normal HTML).
    Here's the code:
    -----------------cut
    -----------------cut

    It works perfectly in browser (as HTML), but when inserted into 3DFA as Javascript element, it doesn't seem to work (but "Compile" button in Javascript window reports no problems...). What shoul i do? I can't go for "Open URL", beacuse it'll be an presentation (EXE), not the web page...

    HELP!
    Thanks in advance..
    Ok Firstly the javascript element in 3dfa is NOT the same thing as putting javascript in an HTML page. It is there for controling elements and actions WITHIN 3dfa only.

    You can call javascript in the browser via the OpenUrl call and send any valid javascript this way even calling a function like the one above. It is done as follows.

    In the OpenURL action put
    javascript:thefunction(whatever)

    You can easily make popup windows using this method. Look at http://deadyeti.com/blanius/popwindow/popupcoder.html where you can genereate the appropriate code.

    As for making a presentation, well you cannot publish to a porjector in 3dfa and even if you could you cannot open a new window that way without opening a browser. You can make a nice presentation in a browser though, just force it to fullscreen (IE5+ only)

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