A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Javascript alert in Flash using XML value? Help

  1. #1
    Animator
    Join Date
    Jan 2001
    Location
    Dubai
    Posts
    200

    Unhappy Javascript alert in Flash using XML value? Help

    Hi there

    I am getting the data from XML file for each record, the XML node is as below:

    <img thumbEvents='true' thumbnail='The-Strangers.jpg' large='The-Strangers.jpg' TitleEn='The Strangers' ChannelName_en_gb='SHOWCINEMA 2' DateTime='February 14 March' Time='10:00' Id='123'/>
    Each item has one Id which links to a more information page, I have taken the Id into a variable on first frame:

    _root.Id.text=obj.Id;
    There is a button on stage, over which i have written this code to check if the value is passing into the variable or not by :

    Id = _root.Id.text;
    on (release) {
    //getURL("http://www.domain.com?Id=126");
    getURL("javascript:alert('"Id"')");
    }
    But cant get it working even after uploading onto the FTP.

    Can anyone help me fixing this concatenation issue, or correct me if i am putting the incorrect javascript.

    Much appreciated

    Fahad
    [email protected]
    I won't change directions and i won't change my mind, How much difference does it made?

  2. #2
    AS3 Mod
    Join Date
    Sep 2007
    Location
    O-H-I-O
    Posts
    2,385
    PHP Code:
    on (release) {
        
    //getURL("http://www.domain.com?Id=126");
        
    getURL("javascript:alert('" _root.Id.text "')");


  3. #3
    Animator
    Join Date
    Jan 2001
    Location
    Dubai
    Posts
    200
    Thanks sstalder, That really helped and it worked correctly, i applied the code without the '

    on (release) {
    //getURL("http://www.domain.com?Id=126");
    getURL("http://www.domain.com?Id=" + _root.IdNum.text + "", "_Blank");
    }
    Best Regards
    Fahad.
    [email protected]
    I won't change directions and i won't change my mind, How much difference does it made?

Tags for this Thread

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