PDA

View Full Version : Scrollpane, loaded with MCs using AS


climbersaurus
04-26-2004, 01:31 AM
Hey everyone,

I'll get straight to the issue:

I have a scrollpane which loads up some jpegs. I basically do this by duplicating a blank MC and then loadMovie(url of jpeg).

For some odd reason, I can't trap the onRelease or onPress method of the MC, although, my trace reveals the name of the movie clip.

Here's a sample:



scrollContent.attachMovie("myMovie", "myMovie", layer);
scrollContent.myMovie.duplicateMovieClip("myMovie" + x, layer);
.
.
.
scrollContent["myMovie" + x].loadMovie(thumbs + item[x].attributes.thumb);
scrollContent["myMovie" + x].onRelease = function() {
trace('hello world');
}


I've also attached the fla source.

The images load up fine... any pointers or leads on this would be great!

Thanks in advance! I really appreciate everyone's effort on this site (it's quite amazing)

- S

climbersaurus
04-26-2004, 01:49 AM
Now that I look closer at the key frames, I noticed a stop(); on the 3rd frame. I'm assuming this is why I can't click the MC to get an onPress event.

I guess I'll just have to find another way... any suggestions would be apprecated!

Thanks

climbersaurus
04-26-2004, 01:56 PM
okay, well looks like I found the problem. When the loadMovie() method is called, all of the methods of the movie clip is overwritten.


MovieClip.prototype.onLoad = function() {
this.onRelease = function() {
trace('hello world');
}
}


Anyways I hope the above code helped someone. If anyone has more insight on this, feel free to post! thanks

climbersaurus
04-26-2004, 03:18 PM
I keep on answering my own questions, well that, and people on this forum. This link pretty much answered a lot of questions:

http://www.actionscript.org/forums/showthread.php3?t=40439&highlight=gallery