Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

Anks

Members
  • Posts

    9
  • Joined

  • Last visited

Anks's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Awesome! thank you so much for your help!
  2. Awesome! Can't thank you both enough for the help and patience with me here! I now I have one successful image being added from my XML document to the stage! Now the next step I have to do is add all the pictures to the stage from the XML document. Carl, about using numChildren to achieve this.... trace("numChildren " + LoaderMax.getLoader("xmlDoc").numChildren); I've added this trace to my code but it seems to be throwing an error "Property numChildren not found on com.greensock.loading.XMLLoader and there is no default value."? I'm assuming this is supposed to trace the number of imageloaders I have in my xml document?
  3. Thanks so much carl. I was on a similar Umm I have a question though. Is it supposed to be tracing "null" when I do trace(image);? Also do you know if there is there a way I can load the node @name? so that I can add multiple images instead of telling it to load each image by its given name?
  4. Just want to make sure im on the right page here. So I've taken a look at the LoaderMax.getContent() method and I'm trying to grab the first image now. My XML looks like this still: <?xml version="1.0" encoding="iso-8859-1"?> I've created an xml loader in my main class and have it being loaded.. So when the app runs it should load the xml. public var queue:XMLLoader; public function Main() { super(); siteXML = "xml/site.xml"; queue = new XMLLoader("xml/port.xml",{name:"xmlDoc", maxConnections:1, estimatedBytes:5000}); queue.load(); } Now on my port.as page when the user gets sent to this page I want to grab the files from the port.xml document loaded with var queue. I've made an init() function and have this there currently... private function init() { var image:ImageLoader = queue.getContent("anaImage"); trace(image); } It isn't working, its throwing the "access a property or method of null object ref error" so I want to know how would I access those images?
  5. Hmm... its not so much of a Gaia question but more of an OOP question. Being able to use XMLLoader and LoaderMax between two class files. Never been very good at that /facepalm. Being able to access the the XMLLoader object I created in the main class, in my port.as class. I'm going to take a look at the LoaderMax.getContent and getLoader methods to see if I can figure it out. I know as of right now it is loading the xml document. Just its a matter of telling port.as to now go into that xml document and grab that information and assign them to the specific display objects.
  6. Any help ? To clarify a bit I need to be able to load this... queue = new XMLLoader("xml/port.xml",{name:"xmlDoc", maxConnections:1, estimatedBytes:5000, onComplete:queueCompleteHandler, onChildComplete:imageCompleteHandler}); queue.load(); in my Main.as class with the other site.xml. Than I need to be able to access the data from my port.as page/class.
  7. Hey there! So I'm new to greensock's XMLLoader as well as Gaia but what I want to do is I want to load all my assets on my page on the main class file when the page is first loading. That way the user doesnt have to wait for the items/images to load once they get onto my page. Now I have a site.xml which looks like this from gaia. <?xml version="1.0" encoding="UTF-8"?> and I have another XML document called port.xml that looks like this. <?xml version="1.0" encoding="iso-8859-1"?> Now my main class file which loads the site.xml looks like this as of right now... public class Main extends GaiaMain { public function Main() { super(); siteXML = "xml/site.xml"; } override protected function onAddedToStage(event:Event):void { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; super.onAddedToStage(event); } } } and I currently have my port.xml being loaded on my port.as page. So when the user clicks on the link to goto the port.as it loads it there. I'm trying to figure out how I can load the port.xml basically when the site is loading for the first time but still be able to access the assets in the port.as so I can apply them on the stage. Sorry for the length of the message, hopefully someone can help me out! Thanks
  8. Thanks so much! I have another question. If I were to switch my xml format to look like this: <?xml version="1.0" encoding="iso-8859-1"?> What would I have to change in order to access the attributes when they are now inside a LoaderMax tag? I've tried this: "loadedImage = e.target.content.LoaderMax as ContentDisplay;" But its just throwing errors for me. Assuming something to do with LoaderMax and ContentDisplay?
  9. I'm trying to figure out how I can assign my attributes(ex. des="") inside my xml document to movieclips/textfields. Right now I've managed to get the images loaded in and I've assigned them to movieclips as you can see below. But I'm having issues with understanding how to pass in the other attributes assigned to that imageloader. Also I'm not entirely sure I am doing the whole "loading the XML" thing properly but any suggestions to clean my code up would be greatly appreciated. Here is my current XML: <?xml version="1.0" encoding="iso-8859-1"?> Here is my code where I am adding my XMLLoader and loading the pictures. private function init() { queue = new XMLLoader("xml/port.xml",{name:"xmlDoc", maxConnections:1, estimatedBytes:5000, onComplete:queueCompleteHandler, onChildComplete:imageCompleteHandler}); queue.load(); } private function queueCompleteHandler(e:LoaderEvent):void { trace("evertything loaded"); addScroller(); hoverCheck(); } private function imageCompleteHandler(e:LoaderEvent):void { loadedImage = e.target.content as ContentDisplay; loadedImage.alpha = 0; thumbHolder = new ThumbHolder(); portArray[imageCounter] = thumbHolder; mainHolder.addChild(thumbHolder); thumbHolder.imgPre.alpha = .8; thumbHolder.x = imageCounter * 210; loadedImage.x = -97.5; loadedImage.y = -60; thumbHolder.imgPre.addChild(loadedImage); border = new Border(); thumbHolder.addChild(border); portArray[imageCounter].name = "thumbHolder"+imageCounter; portArray.push(thumbHolder); TweenMax.from(thumbHolder, 1, {x:-200, alpha:0,rotation:90, ease:Back.easeIn}); TweenMax.to(thumbHolder, 1, {dropShadowFilter:{color:0x000000, alpha:1, blurX:10, blurY:10, distance:1}}); TweenMax.to(loadedImage, 1, {alpha:1, ease:Sine.easeInOut}); imageCounter++; } Thanks in advance! Any help would be greatly appreciated!
×