Cryoma Member of the Year
Reputation: 198
Joined: 14 Jan 2009 Posts: 1819
|
Posted: Tue Jun 23, 2009 5:11 pm Post subject: XML & Flash. |
|
|
I kinda doubt anyone knows AS around here, but here goes.
So I have an XML file.
In it is a list of icons and stuff.
Example:
| Code: | <icons>
<icon image="icon1.png" tooltip="LimeWire" text="blah1" url="http://1" />
<icon image="icon2.png" tooltip="Rubik's Cube" text="blah2" url="http://2"/>
</icons> |
In flash, I have the code to load the icons and display them, and a code to load some text from the xml file when you click on the icon.
I got rid of the text bit, because instead of loading the text, I want to go to the url in the text file.
So here's the code for the part where you click on the icon.
| Code: | function released()
{
//BONUS Section
var sou:Sound = new Sound();
sou.attachSound("sdown");
sou.start();
home.tooltip._alpha = 0;
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home["item"+i];
t.xPos = t._x;
t.yPos = t._y;
t.theScale = t._xscale;
delete t.icon.onRollOver;
delete t.icon.onRollOut;
delete t.icon.onRelease;
delete t.onEnterFrame;
if(t != this._parent)
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,0,0,1,true);
}
else
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,100,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,200,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,250,1,true);
var tw5:Tween = new Tween(theText,"_alpha",Strong.easeOut,0,100,1,true);
theText.text = t.content;
var s:Object = this;
tw.onMotionStopped = function()
{
s.onRelease = unReleased;
}
}
}
} |
All I really need is this:
| Code: | function released()
{
//BONUS Section
var sou:Sound = new Sound();
sou.attachSound("sdown");
sou.start();
getURL("xml-url");
} |
But how do I get it to getURL the url from the XML file?
|
|