Groups | Blog | Home
all groups > flash data integration > april 2005 >

flash data integration : can I use a pull down menu to take me to a page


livingwithanangel
4/30/2005 12:00:00 AM
have a multi page SWF that uses external JPEGS and SWF's accessed via an XML
file. I wish to be able to go to a certain page by having a pulldown contents
list menu (html or flash based?). How would I go to the page I wish to using
this and the XML file? So I assume that the menu would tell the swf to go to a
certain file name based on information in the xml file?
thanks
tomeanand NO[at]SPAM hotmail.com
5/2/2005 12:00:00 AM
hi livingwithanangel

try this
1st frame of the file paste this code

var myXML:XML = new XML();
var title_array:Array = new Array();
myXML.ignoreWhite = true;
myXML.load("loadSWF.xml");
myXML.onLoad = function(success) {
if (success) {
child_length = this.firstChild.childNodes;
for (var i = 0; i<child_length.length; i++) {
title_array.push({label:child_length.firstChild,
data:child_length.attributes["id"]});

}
}
};

after 4 or 5 frames
paste this code

stop();
list.dataProvider = title_array;
var changeObj:Object = new Object();
changeObj.change = function(evt) {
swf_txt.text = evt.target.selectedItem.data;
};
list.addEventListener("change", changeObj);

create a textbox with instance name of swf_txt and combo box with an instance
name of list

Anand
livingwithanangel
5/2/2005 12:00:00 AM
thanks - I can't access the main swf for editing though - is the code above a
new separate flash doc I need to create, just for the menu?

Here is an example from the "pages.xml" file that the current swf uses to
access the pages:
<pages>
<page> images/01.jpg </page>
<page> images/02.jpg </page>

thanks

AddThis Social Bookmark Button