-
I am new to Flash 5. I am a Flash 4 novice, so please bare with me. I don't quite understand how to use the actionscript in Flash 5.
I can't seem to figure out how to get the mouse location and store it in a variable to be displayed in a text box. What I am trying to do is display a numeric representation of the location of the mouse while it moves.
Thank you,
~~~Evilmoose~~~
-
Senior Member
have the dynamic box named something like varx and vary
then at the movie clip, anytime you wanna update the value, you can go:
onClipEvent (enterFrame) {
varx = _root._xmouse;
vary = _root._ymouse;
}
that will trace the position of the mouse relative to the _root. to change the scope, change the path like
varx = _root.myMC._xmouse;
Regards,
Leo Lima
-
Thanks for the help Leo. I got what you are saying, but i don't even know how to begin making Flash 5 do what you told me. The whole programing of actionscript in Flash 5 evades me.
-
Senior Member
Hum... let's begin from the beginning :P.
Where are the textfields?
If they're at _root (_level0 or / to flash4's), you'll need to make a controller MC. If they're inside anyMC, you only need to setup the MC actions of that movie to update the value on enterFrame.
Gonna try to explain:
For both examples, varx is the variable name for the x mouse and vary for the y mouse.
For the boxes at the _root.
- Create an empty MC;
- Place the MC at the stage and select it;
- Open the Actions panel/window;
- Type this (when in Expert mode) or paste this to that window:
onClipEvent (enterFrame) {
_root.varx = _root._xmouse;
_root.vary = _root._ymouse;
}
- You're ready to go.
For the boxes at anyMC.
- Select the clip that contains the boxes;
- Open the Actions panel/window;
- Type this (when in Expert mode) or paste this to that window:
onClipEvent (enterFrame) {
varx = _root._xmouse;
vary = _root._ymouse;
}
- You're ready to go.
That should work. Tell me if you still need an example.
Regards,
Leo Lima
-
I can't get the action script window to take text. I can't make the actionscript window do anything I want it to do. I don't know how to use the actionscript window. I hope that clears up how little the knowlege I have.
-
Senior Member
Gosh, this is critical. You deselect everything and then select the symbol (MC in this case). Then you right click it and select Actions.
Then paste the code.
If you can't do this, I recommend the flash tutorial that comes with Flash. That's how I learn at flash 4...
Regards,
Leo Lima
-
Thanks for the help, Leo. I need to bone up on THE ACTIONSCRIPTING OF FLASH 5. I cannot do any of what you are tell me. If they only didn't change the actionscripting that was flash 4.
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
|