|
-
Simple quesiton for createEmptyMovieClip in AS2
Hi there,
I was working on dynmic loading contents, I have done some code to list all thumbs on the stage and was going to assign URL for each moveclip.
It seems doesn't work for assigning links at the moment. Would you please help me take a look of this? Anything wrong?
Cheers
Code:
var thumbHorizontalGap = 110;
//var url:String = "http://img0.gmodules.com/ig/images//weather_welcome_image.jpg";
var arrURLs:Array = ["http://l.yimg.com/us.yimg.com/i/us/ga/gameart2/perilendhouse/perilendhouse-100.gif", "http://l.yimg.com/us.yimg.com/i/us/ga/gameart2/sallyssalon/sallyssalon-100.gif", "http://l.yimg.com/us.yimg.com/i/us/ga/gameart2/riseofatlantis/riseofatlantis-100.gif"];
for (var i:Number = 0; i < arrURLs.length; i++) {
var url:String = arrURLs[i];
_root.createEmptyMovieClip("vThumb"+i, i+1000);
vidThumb = eval("vThumb"+i);
vidThumb._y = i*thumbHorizontalGap;
vidThumb.loadMovie(url);
vidThumb.onRollOver = function() {
getURL("http://www.google.com","_self");
};
//trace(vidThumb);
}
/*
function openURL(url) {
getURL(url);
}
*/
-
PHP Code:
var thumbHorizontalGap = 110; //var url:String = "http://img0.gmodules.com/ig/images//weather_welcome_image.jpg";
var arrURLs:Array = ["http://l.yimg.com/us.yimg.com/i/us/ga/gameart2/perilendhouse/perilendhouse-100.gif", "http://l.yimg.com/us.yimg.com/i/us/ga/gameart2/sallyssalon/sallyssalon-100.gif", "http://l.yimg.com/us.yimg.com/i/us/ga/gameart2/riseofatlantis/riseofatlantis-100.gif"];
for (var i:Number = 0; i < arrURLs.length; i++) { var url:String = arrURLs[i];
vidThumb = this.createEmptyMovieClip("vThumb"+i, i+1000); vidThumb.createEmptyMovieClip("holder",1); vidThumb._y = i*thumbHorizontalGap; vidThumb.holder.loadMovie(url);
vidThumb.onRollOver = function() { trace(this._name); //getURL("http://www.google.com","_self"); }; }
create a holder to load images. The replace the mc they are loaded into, thus deleting your rollOver code.
gparis
-
wowow.. AWESOME!
I was curious, why we have to create another MC to load the image. humm... in my code, vidThumb has already assigned to be a MC and loads images.
Cheers
-
why we have to create another MC to load the image
The (images) replace the mc they are loaded into, thus deleting your rollOver code
gparis
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|