View Full Version : text variables help
robskinn
11-06-2002, 02:16 PM
Hi,
I have a simple input name box in my scene and I need the .swf to display the name entered in a input text box. It this works ok when the input box and dynamic display box are in the same scene but how do I get it to work accross movies? e.g the input box is in the main scene and the display box is in a movie called movie1.
It must be fairly simple?
Can anyone help me?
Thanks,
Rob
Read this (http://www.actionscript.org/tutorials/beginner/paths/index.shtml), it should make it all clear.
SFA
robskinn
11-06-2002, 03:12 PM
Hi,
I have been through your tutorial and it makes sense but I still can't get it working. I am not sure where you place the _root.movie.hello code to read thge input text?
Thanks
Rob
What exactly do you want, you want it to show in the dynamic text box while you are typing at the same time or after doing something, explain it exactly.
SFA
robskinn
11-07-2002, 08:18 AM
Hello,
I want to do is allow the user to type in their name from an intro page. Their name to be stored in the memory so that when they use the print function i've put in the movie it prints a page using (#p) and displays their name on it. - the frame it prints and displays the name on is a movie file (with instance name).
Hope this is clearer,
Thanks,
Rob
I'm not really familiar with printing but basically, if you set a variable on the root of one scene, it will be avalable on the root of any scene. If you want to assign teh variable to a particular textbox just set it in the timeline of where the textbox is or have an onClipEvent(load) handler on the clip containing the textbox.
SFA
robskinn
11-07-2002, 02:31 PM
Hi,
I tried the onLoad option but still no luck. Would it be possible to have a look at the test file I have attached (.fla v5 - format. 4k).
I have designed the movie so that it should be easy to understand, the display text box within the movie is the one I am having problems with,
Thanks,
Rob
The file you sent is not an .fla.
SFA
robskinn
11-08-2002, 07:55 AM
The file is a .fla file which has been zipped but it originated from a mac though - that should not be a problem though as I use an apple mac here and I have flash on a pc at home.
It should open if you open the file from within flash (not double clicking from desktop) - If not re-name the .php tag to .fla
I deal with a lot of cross conversion stuff - Hope this helps,
Cheers,
Rob
If not I can post it from home.
You have a couple of thing set up badly.
The path to the movie is unreachable.The dynamic textbox is inside a nameless MC which in turn is inside an MC with the instance name of "movie". Either break the nameless movie apart (Cntrl + b) or give it an instance name and change the path to get there.
The only line of code you had, beside stop and goto was a line that read -
_root.movie.hello
unless I am missing something.
Now, you can either place the following code on the second frame of the main lne-
movie.hello = movie;//or change the path if you name the movie you have inside
or else you can place the following code on the MC that directly holds the textfield-
onClipEvent(load){
hello = _root.hello;
SFA
robskinn
11-08-2002, 08:37 AM
Thanks,
The onload event worked,
Cheers,
Rob:)
robskinn
11-08-2002, 01:00 PM
As mentioned the onload code targeting the movie clip worked.
I have found out that The enter name box will need to be in a movie of it's own. So with the onload code I know how to load a variable into a movie to display the name, could you tell me how I would pass a variable from a movie e.g _root.entername (entername = movie name) to the main _root from which the onload code would read the variable as before.
Cheers,
Rob
Ricod
11-08-2002, 03:47 PM
_root.myVariable = _root.myMovieClip.myVariable;
just like that. no need to make a new thread.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.