|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Ok, I'm a newb
![]() And I have a problem: I want to make completely dynamical buttons in which I want to set the text field. I have a pretty plain movie in which I have created a button which only has an UP-state. In this button is a dynamic text field, which has the instance name dynText. What I want to do is to drag, say like 10, instances of the button on to the stage and give them unique instance names. For ex button1, button2.... button10. Then I would like to be able to change the text on each button individible... Please, help - anybody??? |
|
#2
|
|||
|
|||
|
First drag your button instances onto the stage, then name them all differently.
In the first frame of the main timeline put this code to set the text for your buttons. _root.button1.dynText.text = "this is the text for button 1" |
|
#3
|
|||
|
|||
|
Quote:
This is exactly what I've been trying to do for the latest 2 days, but havent succeded to get it working... Please check the file at http://www.miceandbrains.dk/victor/Untitled-2.fla sincerely Victor |
|
#4
|
|||
|
|||
|
Oops, forgot about that...
You'll have to use movieClips instead of buttons. If you're using flash5 you'll have to us a hitTest to check if the mouse position is over the clip when it's clicked. If you're using MX just use the onRelease event. |
|
#5
|
|||
|
|||
|
Quote:
Using MX - how to use movie clips as buttons? |
|
#6
|
|||
|
|||
|
In MX MovieClips have the same events that buttons do. There's really no need for buttons in MX.
Example: (this would go in a timeline frame, not the clips actions) Code:
myClip.onRelease = function(){
trace("you pressed " + this._name);
}
|
|
#7
|
|||
|
|||
|
Quote:
Could you please explain that code..? |
|
#8
|
|||
|
|||
|
Ok, I managed to get it to work with MC's instead of buttons, but I have encountered a new problem...
After I've set the dymaic text fields I use a gotoAndStop to go to another frame in the movie. But in this frame, the text fields have "forgotten" their values... Is there any way of getting round this, or do I simply have to reset all text fields when I get to another frame? Best regards, Victor - a little less Newb now but anyway ![]() |
|
#9
|
||||
|
||||
|
Hi Victor,
I'm sorry that no one responded to your last reply. Keeping variables intact is quite easy. It just requires that you work in layers and that the last keyframe of the variables' layer is cleared. I've included an FLA to demonstrate. Sincerely, Jamie Michels www.thedarkcontent.com |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Setting dynamic text field in buttons? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|