A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Gotoandplay in xml

  1. #1
    Junior Member
    Join Date
    Jul 2010
    Posts
    11

    Gotoandplay in xml

    Hi there.
    I load an external html content page through contents.xml file, in page.swf, which loads in main.swf like external file.
    The code of contents.xml is this:


    Actionscript Code:
    <?xml version="1.0" encoding="utf-8"?><xml>
        <content>
            <description><![CDATA[<br><br><font color="#ffffff"  size="15"> </font><font color="#FFFFFF" size="20" style="font-family:Calibri">Contact</font><br><br><p align="left"><font color="#ffffff" style="font-family:Calibri" size="15"><b>Company Name</b><br><br>Adress<br><br><b>T.</b>(+30) phone<br><br><b>F.</b>fax<br><br><a href="mailto:info@mail.com"><b>E.</b>info@mail.com</a><br><br><img style="border:20px solid black;" src="map.jpg" height="400" width="600" ></font></p>]]></description>
        </content>
    </xml>

    In this code i want to have a link (like e-mail link for example) which redirects in specific frame of main.swf. Like _root.gotoAndPlay("frame"); but in xml.

    Can i do this and how?

    Thank you in advance

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    You cannot have the actionscript codes inside the XML, but the frame number you can

    Just make a new node, type in the frame number you want, and make a button to execute
    Actionscript Code:
    _root.gotoAndPlay(xml.firstChild.childNodes[1].firstChild.nodeValue);
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    Actually you can.

    you would use your CDATA tags to make an HTML ASFUNCTION link to call whatever function in your flash movie you wanted.. (and parameters)


    basically in your Flash movie.. you have a generic function

    function genericFunction(targetClip, frameNum){
    targetClip.gotoAndStop(frameNum);
    }


    actually I think you can only pass one parameter via the ASFUNCTION link..

    so you'd need to split up the parameter sent by some character..

    targetClip|frameNum

    etc..

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