FORUMS: list search recent posts

XML and Flash

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
XML and Flash
on Oct 8, 2007 at 8:29:20 pm

Hi folks, first post in the Flash Forum ...

I'm playing with Flash and XML... I need a button that exsist in a movie clip to call up a URL. I believe in my case I need the actionscript to exsit on the button.. for example:

on (release) {

thisSite is a variable in the root.

This works if I have the variable already set.. but how do get the variable thisSite to populate from the XML? And what if i have several buttons?

Here's my XML

My action script in the first frame in the root is like this

//var thisSite = "";
var x:XML = new XML();
//ignore white spaces in XML document
x.ignoreWhite = true;
//create array for storing urls for photos
var urls:Array = new Array;
//create array for storing captions
var captions:Array = new Array;
//not sure what this array is about
var whoIsOn:Number;
//make an item variable
x.onLoad = function () {
//array varaible to store all photo elements
var photos:Array = this.firstChild.childNodes;
for(i=0;i urls.push (photos[i].attributes.url);
captions.push (photos[i].attributes.caption);
caption.text = captions[0];
whoIsOn = 0;
item = urls[0];
trace (captions[0]);
_global.product = urls[0];


x.load ("websites.xml");

Thanks everyone!

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved