Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-18-2005, 06:45 PM   #1
Navarone
Don
 
Navarone's Avatar
 
Join Date: Feb 2003
Location: Akron, Ohio USA
Posts: 2,077
Default scrolllPane loading images issue?

I have a question on how to do something. First I on my stage I have a scrollPane that I want to use for displaying thumbnail images. So in the library I have a movieClip with a Loader component, an instance name of "myLoader".

Now I have been successful in getting the movieClip into the scrollPane and loading an image, but I want to run through a for loop to load all the images.

How would I go about do this.

ActionScript Code:
var myScrollPane:mx.containers.ScrollPane; myScrollPane.contentPath = 'mc_container'; // MyPicVars = new LoadVars(); MyPicVars.load("jetPlane.txt"); MyPicVars.onLoad = function(success) {     if (success) {         trace("loaded");         Rc = this["Rc"];         for (i=0; i<=Rc-1; i++) {             trace(this["pic"+i]);             myScrollPane.content.myLoader.contentPath = "jetPlane/"+this["pic"+i];         }     } else {         trace("not loaded");     } };
__________________
Damn the torpedoes! Full speed ahead.
Navarone is offline   Reply With Quote
Old 08-18-2005, 08:17 PM   #2
Navarone
Don
 
Navarone's Avatar
 
Join Date: Feb 2003
Location: Akron, Ohio USA
Posts: 2,077
Default

I added a new emptyMovieClip as the myScrollPane.contentPath The trace(mc_container.myLoader.contentPath), list out the correct images in the output box, but I still can't get the images to load.
ActionScript Code:
var myScrollPane:mx.containers.ScrollPane; myScrollPane.contentPath = 'mc_holder'; // MyPicVars = new LoadVars(); MyPicVars.load("jetPlane.txt"); MyPicVars.onLoad = function(success) {     if (success) {         trace("loaded");         Rc = this["Rc"];         var my_mc:MovieClip;         for (i=0; i<=Rc-1; i++) {             //trace(this["pic"+i]);             my_mc = myScrollPane.content.attachMovie("mc_container", "mc"+i, i, this.getNextHighestDepth());             my_mc._x = 5;             my_mc._y = 5+(i*80);             mc_container.myLoader.contentPath = "jetPlane/"+this["pic"+i];             trace(mc_container.myLoader.contentPath)             my_mc.i = i;                myScrollPane.invalidate();         }     } else {         trace("not loaded");     } };
__________________
Damn the torpedoes! Full speed ahead.
Navarone is offline   Reply With Quote
Old 08-18-2005, 08:19 PM   #3
sleekdigital
I like pizza!
 
Join Date: Feb 2003
Location: PA
Posts: 1,310
Send a message via AIM to sleekdigital Send a message via MSN to sleekdigital Send a message via Yahoo to sleekdigital
Default

EDIT: I wrote this in response to the first post, did not read second yet

Well in each iteration of the loop you are just replacing what you did in the previous iteration. Maybe do this instead....

ActionScript Code:
var myScrollPane:mx.containers.ScrollPane; // myScrollPane.contentPath = 'mc_container'; // instead make this a blank mc (so have a blank mc in lib with linkage "blank") myScrollPane.contentPath = "blank"; // MyPicVars = new LoadVars(); MyPicVars.load("jetPlane.txt"); MyPicVars.onLoad = function(success) {      if (success) {           trace("loaded");           Rc = this["Rc"];           var currentClip;           for (i=0; i<=Rc-1; i++) {                trace(this["pic"+i]);                currentClip = myScrollPane.content.attachMovie("'mc_container'", "pic"+i, i);                currentClip.myLoader.contentPath = "jetPlane/"+this["pic"+i];           }      } else {           trace("not loaded");      } };

Also, I'm pretty sure I have mentioned before that I have code that does exactly what you are describing here...
http://www.layer51.com/proto/d.aspx?f=1396
sleekdigital is offline   Reply With Quote
Old 08-18-2005, 08:28 PM   #4
Navarone
Don
 
Navarone's Avatar
 
Join Date: Feb 2003
Location: Akron, Ohio USA
Posts: 2,077
Default

I have seen what you have on your link, but doesn't what you have use XML?
__________________
Damn the torpedoes! Full speed ahead.
Navarone is offline   Reply With Quote
Old 08-18-2005, 08:32 PM   #5
sleekdigital
I like pizza!
 
Join Date: Feb 2003
Location: PA
Posts: 1,310
Send a message via AIM to sleekdigital Send a message via MSN to sleekdigital Send a message via Yahoo to sleekdigital
Default

It does, but it would be simple for you to create an xml object inside of flash based on whatever you are currently using.
sleekdigital is offline   Reply With Quote
Old 08-18-2005, 08:35 PM   #6
Navarone
Don
 
Navarone's Avatar
 
Join Date: Feb 2003
Location: Akron, Ohio USA
Posts: 2,077
Default

Will XML run from a cd rom?
__________________
Damn the torpedoes! Full speed ahead.
Navarone is offline   Reply With Quote
Old 08-18-2005, 08:36 PM   #7
sleekdigital
I like pizza!
 
Join Date: Feb 2003
Location: PA
Posts: 1,310
Send a message via AIM to sleekdigital Send a message via MSN to sleekdigital Send a message via Yahoo to sleekdigital
Default

my_mc = myScrollPane.content.attachMovie("mc_container", "mc"+i, i, this.getNextHighestDepth());

this should probably be ...
my_mc = myScrollPane.content.attachMovie("mc_container", "mc"+i, i);
sleekdigital is offline   Reply With Quote
Old 08-18-2005, 08:37 PM   #8
sleekdigital
I like pizza!
 
Join Date: Feb 2003
Location: PA
Posts: 1,310
Send a message via AIM to sleekdigital Send a message via MSN to sleekdigital Send a message via Yahoo to sleekdigital
Default

The xml doesn't have to exist anywhere accept inside the flash movie itself. but certainly you could put an xml file on the cd rom just the same as you would any other text file.

You could create the xml object in flash based on your loaded variables or whatever you want.
sleekdigital is offline   Reply With Quote
Old 08-18-2005, 08:56 PM   #9
Navarone
Don
 
Navarone's Avatar
 
Join Date: Feb 2003
Location: Akron, Ohio USA
Posts: 2,077
Default

O, I'll have to read up on it and see how to do it.
__________________
Damn the torpedoes! Full speed ahead.
Navarone is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:23 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.