473,422 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,422 software developers and data experts.

dynamic movie clip from assets

112 100+
what i have is a portfolio site for my design company and i use a loadvars object to get a list of jobs we've done and some info about them.



next we made this movieclip in flash that represents a small tree, what i want to do is create a tree for each entry in the database and have each one display unique data on it. so far what i have is:


Expand|Select|Wrap|Line Numbers
  1. include('FolioItem.as');
  2. // here is where the code will go to load
  3. // the portfolio objects and then randomly
  4. // position trees with their info on it
  5. var c:LoadVars = new LoadVars();
  6. var itemArray:Array;
  7. //initialize values
  8. c.id = "";
  9. c.name = "";
  10. c.description = "";
  11. c.date = "";
  12. c.type = "";
  13. c.image = "";
  14. c.url = "";
  15. c.onLoad = function()
  16. {
  17.     //first get the count
  18.     var count = c['n'];
  19.     //initialize the array to hold all the info
  20.     itemArray = new Array(count);
  21.     //now loop to create the classs objects for each index in the array
  22.     for(var x =0; x < count; x++)
  23.     {
  24.         var f:FolioItem = new FolioItem(c['id'+x],
  25.                                         c['name'+x],
  26.                                         c['description'+x],
  27.                                         c['date_complete'+x],
  28.                                         c['type'+x],
  29.                                         c['image'+x],
  30.                                         c['url'+x]);
  31.         itemArray[x] = f;
  32.  
  33.     }
  34. }
  35. //send
  36. c.sendAndLoad("/conn/loadfolio.php", c, "POST");
  37.  


and the FolioItem class:

//define a class to manage each portfolio entry
Expand|Select|Wrap|Line Numbers
  1. class FolioItem
  2. {
  3.     public var id;
  4.     public var name;
  5.     public var desc;
  6.     public var date;
  7.     public var type;
  8.     public var imageurl;
  9.     public var url;
  10.     public function Song(i:String, n:String, de:String, da:String, t:String, iurl:String, u:String)
  11.     {
  12.         id = i;
  13.         name = n;
  14.         desc = de;
  15.         date = da;
  16.         type = t;
  17.         imageurl = iurl;
  18.         url = u;
  19.     }
  20. }
  21.  


now what my problem is is how do i create instances of the tree movieclip and dynamically add them to the stage and then know which one is clicked on so i can load the appropriate information to a larger display.



im new to flash but i am a programmer so i know techniques and concepts im just fuzzy on how i might do something like this in flash...



thanks alot,

ken
Jul 15 '09 #1
0 1720

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: torbs | last post by:
I have a problem when I use javascript to get the length and position of a movie I recieve from a rtsp stream. The length and position is extremely high and not the actual length and position of...
0
by: Dionysusmtl | last post by:
I'm working on a flash portfolio that loads examples of our work (jpgs) into a movie. For example, it started off using an xml list to display certain images but I found it necessary to draw info...
10
elamberdor
by: elamberdor | last post by:
Hello All! Well, I can load in swf's just loverly, but what I have is a sliding menu, with buttons in it, that when pressed, load an image into an empty movieclip. I really just need to know how...
2
by: teenIce | last post by:
Hi all, Please help me with this problem. I'm new in flash and actionscript, sorry if my question is too easy. I have a variable name _root.test at Scene 1, and I have a movie clip name Answer,...
0
by: RLW | last post by:
Hi, I inherited a Flash usability problem: It's a self assessment test created in Flash. I think it was originally built using individual flash files for each question and arrays. Now it has...
0
by: deluxmilkman | last post by:
I have a movie clip with a gradient mask. now I would like to have the bounding box of this movie clip reduced to the visible(masked) area, so that I can get its x and y positions. is it even...
2
by: robtyketto | last post by:
Greetings, I have workable code to allow movie clips to be dragged around. However I can't find an example of a drag n drop where the movie clip has to be placed with a certain range/xy...
1
Fary4u
by: Fary4u | last post by:
Hi i'm trying to design the picture gallery ever thing works fine but whn i've make test movie or export the swf file it's runs fine but problme i'm using this with in movie clip & i think...
1
by: gusheneshin | last post by:
hi everyone im Using this code to Creat a Movie Clip and load a movie "SWF" into this Flash ------------ stop(); loady._x = 226.4;this.createEmptyMovieClip("loady",5);
1
by: angelicdevil | last post by:
ok wat i m trying to do it get flash to read a xml file and load the titles in xml as a button into the imagetitles movie clip made on stage in flash . so that when i click on a title it displays...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.