PDA

View Full Version : createEmptyMovieClip + geturl problem



jdulberg
January 5th, 2004, 03:12 PM
I am using createEmptyMovieClip to create MC's based on values from an array. The MC's are placed into the FScrollPaneSymbol component. They load ok however the getURL that should be loaded from the array doesn't work. I've only been able to get it working if I put in an onEnterFrame function but that makes it assign the last url from the array to all the MC's.



foo.onEnterFrame = function() {
for (q in portfolio.sections[0].items) {
//loader[thumbX] is a dynamically created MC
loader["thumb"+q].onRelease = function() {
geturl(portfolio.sections[0].items[q].mpg);
}
}


If the array values are 1,2,3 it assigns the geturl for each of the MC's to "3";

Any ideas how I can fix this problem? Do I even have to use the onEnterFrame for the ScrollPane/MC's?

THanks!

Jason

yusuf
January 6th, 2004, 02:37 PM
you can do it that way:
on the orriginal thumb mc:

onClipEvent(load){
this.onRelease = function() {
getURL(portfolio.sections[0].items[q].mpg);
}
}
The for loop doesn't work because the previous data is overwritten... also with duplicate mc the onEnterFrame function won't work, it's not duplicated into the new instance. The load function works fine.
Maybe you should declare your array as a _globale one so you have acces to it more easaly

jdulberg
January 6th, 2004, 03:34 PM
Thanks for your reply... the for loop issue makes sense. I tried the onClipEvent code however it errored out saying that clip events are only permitted on movie clips. Does this not work with dynamically created movie clips? My swf does not have any static movie clips. It loads everything with actionscript.

Thanks for your suggestions!

Jason