-
API drawn duplicated button states....
Hi
Anyone help with this code, what it does is draw a box dynamically and assign an onPress action to the box so when it is pressed the boxs alpha value is reduced from 100 to 50, however, the duplicated clips do not do this! Any reasons why? I thought that if you duplicate a movieClip it also has all the properties of the original and the onPress action would still work!
//My code//
stop();
this.createEmptyMovieClip("heading", 1);
heading.beginFill(0x9595FF, 100);
heading.lineStyle(0.25, 0x666666, 100);
heading.moveTo(0, 0);
heading.lineTo(150, 0);
heading.lineTo(150, 20);
heading.lineTo(0, 20);
heading.lineTo(0, 0);
heading.endFill();
heading.onPress = function() {
heading._alpha = 50;
};
for (i=0; i<1; i++) {
heading.duplicateMovieClip("heading"+i, i+10);
this["heading"+i]._x = 150+i*0;
}
-
Senior Member
You only set it up for the initial 'heading' not the dups.
in your loop try...
this["heading"+i].onPress = function(){ this._alpha = 50; }
That might do it, i didn't test it but it looks right.
Chris
http://www.**********-dms.com
-
You are a god, Thankyou very much indeed, i have been pulling my hair out over this for a few days!
-
Senior Member
Thank you, Thank you
http://www.**********-dms.com
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
|