dcsimg
A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: ugghh. javascript popup

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    144

    ugghh. javascript popup

    ...
    this["clip" + i].url_btn.url = obj_xml[i].attributes.links;
    this["clip" + i].url_btn.onRelease = function() {
    getURL ("javascript:NewWindow=window.open(url ,'newWin','width=400,height=300,left=0,top=0,toolb ar=No,location=No,scrollbars=No,status=No,resizabl e=No,fullscreen=No'); NewWindow.focus();");
    }
    }
    }

    is it possible to stick a variable in a javascript statement like that? can't get it to work.

  2. #2
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,320
    Pretty sure it will work. you not tested this already??

    _paul
    .: To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Twitter - Linkedin
    bringmadeleinehome.com

  3. #3
    Senior Member
    Join Date
    Apr 2001
    Posts
    144
    'test.html' works. url doesn't - which makes me think its not going through.

  4. #4
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,320
    put a trace in your code to make sure that 'url' is getting passed

    _paul
    .: To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Twitter - Linkedin
    bringmadeleinehome.com

  5. #5
    Senior Member
    Join Date
    Apr 2001
    Posts
    144
    yeah, tried it - it says undefined.
    this is driving me nuts.

    edit -

    actually, maybe I screwed up the trace.
    here's me code:
    ...
    _root.mc_body["clip" + i].url_btn.url = obj_xml[i].attributes.links;
    _root.mc_body["clip" + i].url_btn.onRelease = function() {
    getURL("javascript:NewWindow=window.open(url ,'newWin','width=400,height=300,left=0,top=0,toolb ar=No,location=No,scrollbars=No,status=No,resizabl e=No,fullscreen=No'); NewWindow.focus();");
    trace(url);
    }

    thats right, isn't it?
    Last edited by freddiemiles; 11-03-2003 at 07:43 PM.

  6. #6
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    How about...

    _root.mc_body["clip" + i].url_btn.url = obj_xml[i].attributes.links;
    trace(_root.mc_body["clip" + i].url_btn.url);
    ...

    Or even...
    trace(obj_xml[i].attributes.links);

  7. #7
    Senior Member
    Join Date
    Apr 2001
    Posts
    144
    merci, oldnewb.

    it comes up with the urls:
    test.html
    test2.html
    test3.html
    etc.

    by the way, if I replace that javascript
    with getURL(this.url, "_blank"); it works

    so I tried this.url in place with no luck.

    edit:

    maybe it has to be like "'" + this.url + "'" or something.
    Last edited by freddiemiles; 11-03-2003 at 08:31 PM.

  8. #8
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,320
    Does the html pages reside within the same directory as your swf moivie.

    _paul
    .: To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Twitter - Linkedin
    bringmadeleinehome.com

  9. #9
    Senior Member
    Join Date
    Apr 2001
    Posts
    144
    Yeah, they are.

  10. #10
    Senior Member
    Join Date
    Apr 2001
    Posts
    144

    example

    I attached an example.

    anyone ever experienced this?
    Attached Files Attached Files

  11. #11
    Senior Member
    Join Date
    Apr 2001
    Posts
    144

    solution

    on (release) {
    param="javascript:NewWindow=window.open('"+this.ur l_txt+"','newWin','width=400,height=300,left=0,top =0,toolbar=No,location=No,scrollbars=No,status=No, resizable=No,fullscreen=No'); void(0);"
    getURL(param);
    }

  12. #12
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,320
    Ah very cool

    Also the reason it didn't work before was because url_txt didnt =="the page.html". it was as the page.html. Missing the quotes. Only just relised, glad you finaly got it working.

    _paul
    .: To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Twitter - Linkedin
    bringmadeleinehome.com

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