Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

Trying to bring a .png to the stage through xml and a combo box

This is a discussion on Trying to bring a .png to the stage through xml and a combo box within the PHP | mySQL | Flash CS3 forums, part of the Flash CS3 eng category; Hi! I'm very new to AS and Flash, but my company wants me to develop an interactive slide that ...


Go Back   Forum Flash CS3 Flash CS4 > English Forums > Flash CS3 eng > PHP | mySQL | Flash CS3

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 20-05-08, 19:11
Junior Member
 
Join Date: May 2008
Posts: 2
Rep Power: 0
Zane5100 is on a distinguished road
Trying to bring a .png to the stage through xml and a combo box

Hi!

I'm very new to AS and Flash, but my company wants me to develop an interactive slide that brings in data from a xml file and builds a combo box (cbClasses) and then populates a text area (taReq) in addition do calling an image to the stage.

So far, I've got the xml to work with the combo box and the text area, but I can't figure out how to call the image associated with the tag.

Here's what I've got so far:

Code:
//import controls
import flash.net.*;
import fl.controls.ComboBox;
//var declarations
var xmlData:XML;
var classDataLoader:URLLoader = new URLLoader();
var classreqDataLoader:URLLoader = new URLLoader();
//loading xml data
classDataLoader.load(new URLRequest("classes.xml"));
classDataLoader.addEventListener(Event.COMPLETE,loadCompleteClass);
//function extracting data from xml
function loadCompleteClass(event:Event):void 
{
 xmlData = new XML(classDataLoader.data);
 for (var i in xmlData.crclass) 
 {
  cbClasses.addItem({label:xmlData.crclass.name[i]});
  }
 }
//EventListeners for combo box
cbClasses.addEventListener(Event.CHANGE, showReq);
//function populating text area
function showReq(event:Event):void 
{
 var itemSelected:Number = cbClasses.selectedIndex;
 taReq.text = xmlData..requirement[itemSelected];
 }


HTML Code:

  Class 5
  Bouffant Caps, Hoods, Beard Cover, Face Mask, Coveralls, Gloves, Shoe Covers, Booties
  file = "class5.png" width = "144" height = "415"

 

  Class 6
  Bouffant Caps, Hoods, Beard Cover, Face Mask, Coveralls, Gloves, Shoe Covers, Booties
  file = "class6.png" width = "144" height = "415"

 

  Class 7 (Cleanroom)
  Bouffant Caps, Hoods, Beard Cover, Face Mask, Coveralls, Gloves, Shoe Covers, Booties
  file = "class7cr.png" width = "144" height = "415"

 

  Class 7 (Benches)
  Bouffant Caps or Hoods, Beard Cover, Face Mask, Smock, Gloves
  file = "class7bn.png" width = "144" height = "415"

 

  Class 7 (Vestibules)
  Bouffant Caps or Hoods, Beard Cover or Face Mask, Smock, Gloves
  file = "class7vs.png" width = "144" height = "415"

 

  Class 8
  Bouffant Caps, Beard Cover, Smock
  file = "class8.png" width = "144" height = "415"

 


Thank you in advance for any assistance!

Last edited by Zane5100; 20-05-08 at 19:15.. Reason: To correct posting of code
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)  
Old 20-05-08, 19:16
Junior Member
 
Join Date: May 2008
Posts: 2
Rep Power: 0
Zane5100 is on a distinguished road
Re: Trying to bring a .png to the stage through xml and a combo box

Sorry, I posted this in the wrong thread.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Flash CS3 Combo Box transferring variables to submit button help spencersmb Flash CS3 eng 1 22-10-08 08:51
Actionscript 3 Classe stage kaos Actionscript 3.0 base 3 30-08-08 07:25
Actionscript 2 Help with Combo box oliveros_daryl Flash CS3 eng 4 23-08-08 20:56
menu e stage stradiwatt Actionscript 3.0 base 1 22-03-08 13:25
lo stage, incomprensioni nella manipolazione con la classe stage nextframe Actionscript 3.0 base 6 30-12-07 07:54


All times are GMT. The time now is 23:43.


Powered by vBulletin versione 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap


FlepStudio
by Filippo Lughi
P.IVA 03605860406