View Full Version : tutorial --set property-script
Bigshero
07-10-2002, 02:22 AM
firstly i have searched for this info thru the search box but to no avail
-----------------------------------------------------
this is where i am at--thats the easy part--
on (release) {
setProperty ("_level0.mouse", _x, xpos);
}
-------------------------------------------------------------------
i have set up the stage as per set property tutorial and have my input boxes done correctly
i have tried to make the mouse change to the various --x position--y position--- xscale and so on ---
can any one please tell me what code i need when i put a number in the input boxes to make the mouse move or fade or rotate or xscale and so forth
i have tried for a day and a half but no luck --any help greatly appreciated
Terry: confused:
Jesse
07-10-2002, 04:40 AM
Your input text box will have a variable name. If the variable is 'size' for instance, you can have a button with:
on (release) {
_root.myMC._x = Number(size);
// note this is the same as:
// setProperty ("myMC", _x, Number (size));
}
Data enterred into text fields is a String by defualt and you need it as a number so you have to convert it using the Number() function.
CyanBlue
07-10-2002, 05:51 AM
Hey, Bigshero... I have a dumb question for you... :)
When you say 'setProperty ("_level0.mouse", _x, xpos);', you are trying to manipulate the movieclip called mouse which resides in _level0, not trying to manipulate the actual mouse cursor, right??? It sure sounds dumb, but I have to ask... :)
farafiro
07-10-2002, 08:32 AM
CyanBlue heheheheeeeeeee
sure it isn't man, it's mouse MC .... do u know rats lol
Ricod
07-10-2002, 11:23 AM
ehrrr ... farafiro ? A mouse isn't a rat ... they're both rodents ... but they're not the same or one a subdivison of the other ...
farafiro
07-10-2002, 11:38 AM
but here in Africa both are the same
Ricod
07-10-2002, 12:09 PM
Well, here (Europe, but I'm pretty sure in the US, Asia and Australia too) people make a distinction between mice and rats ... like dogs and wolves ... both are canine, but they're different nonetheless ... ehrm ... why r we talking about rodents again ?
farafiro
07-10-2002, 12:13 PM
heheheheeeee
:evelSmile: gotcha man, this was just a test :D
lol
:p
Also I know the difference very well BOOooOOoOO
Ricod
07-10-2002, 12:29 PM
U'RE TESTING ME ?! U must be sado-masochistic !
U Rat !
Hows that ? ;)
farafiro
07-10-2002, 12:36 PM
as u r the one who say that
No problem, How is that??
Ricod
07-10-2002, 01:05 PM
Well ... it IS better, isn't it ? Amazing board, ne ? We learn about Flash, scripting and differances wether it be cultural, theoretical or emotional ! These are interesting times indeed ...
CyanBlue
07-10-2002, 03:53 PM
Mouse, cute...
Rat, yucky...
Mouse, pet...
Rat, pet food...
:p
Ricod
07-10-2002, 04:04 PM
*hugs his friends rat "Peuk"*
He doesn't mean that ! ... do u ... ? :(
What do mice have rats don't ? Or is it sumthing rats do tha mice don't ? Like the plague etc. Aren't mice pet food too ? (If yer pet's a snake or a cat for instance ...)
And whats your view on squirrels ?
Yucky, flea invested, cashew gobbling, Pikachu-like creatures !
Bigshero
07-11-2002, 12:49 AM
Thankyou to all for your replies for tutorial set property---i still need some extra help on this
i got the mouse to move --however it moves once only -- --and all the other input boxes work-- also on one number that is put in the input box --if i put in a new numberto move the mouse to a different postition there is no response-- they do not have the range of movement that the tutorial has ---this is what i now have in actionscript--what would the code be to give the range -say if i put in 22 it goes to to that postition then i put in 345 it goes to that position --in the tutorial when you put in different numbers you get different positions--i only get one position movement
on (release) {
setProperty ("_root.mouse", _x, "500");
}
on (release) {
setProperty ("_root.mouse", _y, "100");
}
on (release) {
setProperty ("_root.mouse", _xscale, "300");
}
on (release) {
setProperty ("_root.mouse", _yscale, "50");
}
on (release) {
setProperty ("_root.mouse", _alpha, "25");
}
Terry
farafiro
07-11-2002, 05:58 AM
Hey Terry, y don't u look in the movies section. There are a lot like what u want to do
Ricod
07-11-2002, 08:42 AM
Is there a reason why u put everything in its own on release statement ?
on (release) {
_root.mouse._x = 500;
_root.mouse._y = 100;
_root.mouse._xscale = 300;
_root.mouse._yscale = 50;
_root.mouse._alpha = 25;
}
But I don't see anything that would delimit the movement to 1 ...
Bigshero
07-12-2002, 01:30 AM
thanks Ricod for your help-- i am really puzzled about this tutorial--i dont really understand the actionscript language as yet but i really like trying to nut it out -- there is much to absorb and keep it in the memory --- so at the moment i am at the bottom of the mountain
would you please look at my winzip and see if you can tell me what i am missing out on here as to why i cant get all the boxes to do what the tutorial does ----they are all restricted to one mivement only
Terry
Jesse
07-12-2002, 02:10 AM
1. You don't need any actions on the mouse itself. Remove those.
2. The rest of your actions don't work because they are using preset values:
on (release) {
setProperty ("_root.mouse", _x,"500");
}
This will set the _x to 500. Once only. If you want it to set the _x to the value enterred in the text box next to the button, you have to check the variable name of the field (which is 'x'), then put that variable in the command:
on (release) {
setProperty ("_root.mouse", _x,x);
}
Same goes for all the other buttons.
Bigshero
07-12-2002, 02:56 AM
Many thanks Jesse--you have made my day---i have been trying to work this out for some days and tried many different things ---the lesson learnt is the variable in the text box goes into the script ---many thanks again Jesse and also to every one who responded
this is a brilliant and well organised site and i am so glad that i stumbled upon it --without it --many would be stuck and give actionscripting away as to hard
Terry
Jesse
07-12-2002, 03:07 AM
:)
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.