Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash & XML

Status
Not open for further replies.

whoknows361

Technical User
Sep 22, 2005
228
US
hello all. this might be basic - but I have been looking online & have not found what I want. And I need to note - that my array skills are below average. :(

I want to have a flash file & lets say that user clicks on "shoes". Then I want a mc on the stage to begin to fill with, of course, all of my shoes (well thumbnails of them & maybe a title). I want the titles & pic locations to be in an xml file.

I know how to load xml data into flash individually if I prescribe how big the mc that the data is being loaded into will be.

However, how do I do this if I don't know how many items will be loaded? I want the user to click on shoes & then I want a mc to load with thumbnails & titles of each pic, to include buttons over each pic & I want the mc which they are being loaded into to increase in size as needed. (as well as a scrollbar)..

Now this is a lot - so can anyone show me to a tutorial that I can use which would explain this..



Thanks in advance
Jonathan
 
thanks for the post newbie -

But what about if I wanted the mc that the xml file (containing the pic paths, etc) was being loaded into to adjust its size to the number of items that was loading into it - automatically.

Coupled with the scrollbar would adjust for the size of the mc which was created from the xml file.

I hope I am being clear

Thanks again

Jonathan
 
Hi there,
if youre loading pics/swfs into your mc , the size of the mc changes automatically as you add more content dynamically.

When u load a pic into the mc it automatically set it to (0,0), so you need to grab the width of the pic and write some sort of script that will add that width/height onto the x/y values, if you follow me.

The problem is that the widths and heights of the loaded images arent immediately available to your script until they have completely loaded.

To ensure u can get the dimensions, u need to use the MovieClipLoader class, and use the onLoadInit to detect when the images have finished loading, before proceeding.]

What i would do is 1. create container mc, 2. loop thru xml data (stored in an array or whatever), 3.one by one create holder mc's inside the container, and load the images using movieClipLoader, when each one has finished loading, position the MC inside the container mc. Then grab the width of the container to use with your scrollbar.

Hope this helps...

James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top