|
-
change colour on stopDrag();?
I am using the code below which I would like to include the possibility of changing the colour of the text inside a button, is that even possible?
code:
for (mc in this) {
this[mc].onPress = startDrag;
this[mc].onRelease = stopDrag;
}
thisLevel = this
for (i = 0; i<= 3; i++) {
thisLevel ["circle"+i].onPress = stopDrag;
this["circle"+i].onRelease = stopDrag;
}
-
FK'n_dog
not possible with button timelines
you need to use movieclips and the textColor property
for example, the first code, applied to a button instance name - btn -- fails
the second, applied to a movieclip instance name - clip -- works
txt is the instance name of a dynamic textfield
Code:
btn.onRollOver = function(){
btn.txt.textColor = 0x00FF00;
}
clip.onRollOver = function(){
clip.txt.textColor = 0x00FF00;
}
-
 Originally Posted by a_modified_dog
not possible with button timelines
you need to use movieclips and the textColor property
for example, the first code, applied to a button instance name - btn -- fails
the second, applied to a movieclip instance name - clip -- works
txt is the instance name of a dynamic textfield
Code:
btn.onRollOver = function(){
btn.txt.textColor = 0x00FF00;
}
clip.onRollOver = function(){
clip.txt.textColor = 0x00FF00;
}
Thank you for helping a_modified_dog!
So you mean creating Mcs instead of buttons? The code your using does not seem to enable the clips to be dragged though as my code above or am I missing something? I was hoping to create an application where clip_mcs are dropped onto an area, say, area_mc and when they are dropped they change colour.
-
FK'n_dog
i have attached a simple fla
note how the movieclip has 3 frame labels
_up, _over, _down
these labels simulate a button rollOver and press event
without additional coding
Last edited by a_modified_dog; 08-17-2007 at 06:33 PM.
-
Spot on!
Thank you a_modified_dog it works brilliantly! As I have 20-odd clips on the stage is there a way to have the code apply to all of them without having to write this code 20-odd times?
I really appreciate your help, cheers for this
-
FK'n_dog
use a numbered sequence for the clip instance names - clip1 clip2 clip3....
you can cycle thro' the numbers in a loop to set the events
simple file with 5 clips attached
Last edited by a_modified_dog; 08-17-2007 at 06:33 PM.
-
Thank you for persisting with me and for solving my problem(s) (yet again!!) a_modified_dog!!!
Gabriel
-
FK'n_dog
you're welcome
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
|