Is it possible add link to a duplicated movieclips dynamically?
A movieclip named “box” on the stage and duplicated using the following code
width = _root.box._x;
for (i=0; i<10; i++){
_root.box.duplicateMovieClip ("box" add i, i);
_root["box" add i]._x = width * i;
}
That is the root created the movieclips box1, box2 and sofar… How can we create different links to these mcs that are created on the fly?
I’ve also tried the following code but i’m getting the only link that “file10.html”
width = _root.box._x;
for (i=0; i<10; i++) {
_root.box.duplicateMovieClip("box" add i, i);
_root["box" add i]._x = width*i;
_root["box" add i].onRelease = function() {
getURL("file" add i add "." add "html");
trace("file" add i add "." add "html");
};
}
system
September 17, 2004, 1:34pm
2
I really dont know if this is what your looking for but it may be so heres my 2 cents,
width = _root.box._x;
for (i=0; i<4; i++) {
_root.box.duplicateMovieClip(“box” add i, i);
_root[“box” add i]._x = width*i;
_root[“box” add i].onRelease = function() {
getURL(“http://www.kirupa.com ”, “_blank”);
};
}
that will make them all open kirupa.com , but you had a trace so this probably isnt what your looking for,
hope it helps,
Ben
system
September 18, 2004, 8:42am
3
I’m sorry that this is not what exactly i mean. In the example you’ve given we can go to only one url of each button that are duplicated. I want to link each duplicated one to different webpages. Hope u can understand
system
September 18, 2004, 9:21am
4
Is it possible add link to a duplicated movieclips dynamically?
A movieclip named “box” on the stage and duplicated using the following code
width = _root.box._x;
for (i=0; i<10; i++){
_root.box.duplicateMovieClip ("box" add i, i);
_root["box" add i]._x = width * i;
}
That is the root created the movieclips box1, box2 and sofar… How can we create different links to these mcs that are created on the fly?
I’ve also tried the following code but i’m getting the only link that “file10.html”
width = _root.box._x;
for (i=0; i<10; i++) {
_root.box.duplicateMovieClip("box" add i, i);
_root["box" add i]._x = width*i;
_root["box" add i].onRelease = function() {
getURL("file" add i add "." add "html");
trace("file" add i add "." add "html");
};
}
width = _root.box._x;
for (i=0; i<10; i++) {
_root.box.duplicateMovieClip(“box” add i, i);
_root[“box” add i].ivar = i;
_root[“box” add i]._x = width*i;
_root[“box” add i].onRelease = function() {
trace(“file” add this.ivar add “.” add “html”);
};
}
system
September 18, 2004, 9:27am
5
My God, this time it’s working… thanks a lot
could u pls explan why u’ve used “this.ivar” and what does it mean?
system
September 18, 2004, 9:29am
6
My God, this time it’s working… thanks a lot
could u pls explan why u’ve used “this.ivar” and what does it mean?
just a property we have created, you can call it anything you want.