Log in

View Full Version : Using XML to supply data to Flash to launch Lightbox



datapusher
03-17-2009, 03:43 AM
I have a flash movie that launches a modal window from a few hardcoded buttons. it works great for those buttons.

However, what I need to do is load a list of text links that are located in an xml file yet have the same behavior as the hardcoded links, i.e. the user clicks on those text links in the flash movie and a modal window is launched and displays the content on top of the flash movie.

Here is a snippet from my"serv_portfolio.xml" XML file:
Code:


<?xml version="1.0" encoding="iso-8859-1"?>

//this code goes to another section we are not worried about right now
<books>
<book>
... (N/A)
</book>
</books>


//Here are the text links that should launch a modal window
<paragraph>
<ptext>
<name><![CDATA[<TEXTFORMAT LEADING="2"><P ALIGN="left"><FONT FACE="Verdana" SIZE="10" COLOR="#666666">
KTLA<br> // Should Launch an Iframe html page w/ KTLA Video
Daily News (pdf)<br> // Should Launch an Iframe to a PDF
NAPTE trailer<br> // Should Launch an external SWF Video
</FONT></TEXTFORMAT>]]></name>
<pages></pages>
<author></author>
</ptext>
<ptext>
<name><![CDATA[<TEXTFORMAT LEADING="2"><P ALIGN="left"><FONT FACE="Verdana" SIZE="10" COLOR="#0080FF">
<b>Trailers:</b></font>
<FONT FACE="Verdana" SIZE="10" COLOR="#666666"><br><br>
Trailer Reel<br> // Should Launch an Iframe html page w/ Video
Love Is the Drug<br> // Should Launch an Iframe html page w/ Video
Valley Of The Wolves<br> // Should Launch an Iframe html page w/ Video
Suicidal<br> // Should Launch an Iframe html page w/ Video
All Aboard America<br> // Should Launch an Iframe html page w/ Video
Pimp Chronicles<br> // Should Launch an Iframe html page w/ Video
Flip The Script // Should Launch an Iframe html page w/ Video
</FONT></TEXTFORMAT>]]></name>
<pages></pages>
<author></author>
</ptext>
</paragraph>

I am at a loss as to what to add as my actionscript code and also how I should code the xml file.

Any and all help is appreciated.

oh and not sure if this will help, but i am using Flash CS3 and the modal windows to be launched will either be html files (iframes) or swf video clips.

Thanks