Posts by iamdok

567 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Ireland
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
iamdok says

CrackerJack,

Thank you kindly for your help. All is working now. I actually had to add in the extra line you mentioned above to avoid it reowing an error. I’ve also given a unique name to each image once its loaded, using the loop I had already in place. I’ve traced out the names and its returning as expected. I also had to be careful of the location of the unload() method of the loader, in relation to the event.target.content code.

If you are interested in the working code, or for anyone else reading this thread. you can find it here:

http://pastie.org/405914

Thanks again.

567 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Ireland
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
iamdok says

Hey CrackerJack,

Attempting to name each image in the way you have suggested gives the following error:

Error #2078: The name property of a Timeline-placed object cannot be modified.

/* function gotPic(e:Event):void { var pic:DisplayObject =(e.currentTarget.content); pic.name = “pic” + p; frame = new MovieClip(); frame.addChild(pic); } */

Am I implementing your suggestion incorrectly?

567 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Ireland
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
iamdok says

Hi All,

I’m loading multiple images using XML and I then wish to target each image individually. So I need each image to have an instance name. Is there a common practice way to achieve this dynamically? eg .(“pic ” + [i])?

Is it possible to give each image an instance name as it is being loaded and placed on the display list. So that this name can be referred to later in the code to target that specific image? Right now I’m assigning the event.target.content to a variable which is used again for each new image. But afterwards I don’t really have a way to target an individual image except vis its index position in the display list perhaps! (awkward)

Another way I could think of would be to include image name or title tags in the xml file structure and then use an array to store these titles. (maybe this wouldn’t help)

Is there a standard way to target multiple images loaded vis XML when they are in the diaplay list at the same time?

I’m a relative new comer to AS3 , so please forgive any blinding oversights.

Cheers.

567 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Ireland
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
iamdok says

pablokreative,

Thanks for your quick reply. The problem was exactly as you suggested(sequence of lines and placement of p++). When I changed as you have written it all runs properly but i get a text error at the very end, saying url not found. I then removed the p++ and the trace function from the loop and place it in the parent loadPix function and there is no longer an error. Sweet. Thanks again.

567 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Ireland
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
iamdok says

Hi All,

Its my first adventure into loading content using XML and I have a quick question regarding loading XML images. There seems to be many people with experience loading content with XML in these forums, so I hope someone could shed some light on this issue.

I’m trying to learn how to load multiple images from an XML file and place each image in a new location(all working correctly). The only problem is that my first image is always shown loaded twice and as a consequence the final image is ommitted!

I’ve assigned a trace function to let me know when each image is loaded stating the index number, and to trace when all mage have finished loading. This works fine, but oddly enough, the repeated image mentioned above seems to have different index numbers, [0] & [1]! But there is no problem with the xml file.

Additionally when I set the index variable to start at 1 instead of 0 then the second image is loaded in twice! which points to the error being in the code. See the code here on pastie in a nice twilight theme! CODE

Its probably something very simple that I’m not seeing. Any help would be greatly appreciated. Cheers

by
by
by
by
by
by