PDA

View Full Version : action script problem



Psykloak1
April 28th, 2002, 12:02 PM
OK heres my problem. I have a dynamic text box and a movie clip with a button in it in the same frame. What I want to happen is when you click the button, it will add 1 to the text box. (when I say 'Add one' I mean if the text box says 5, after pushing the button, it will equal 6). I hope people understand what I mean, if not, ill try to explain it better.

upuaut8
April 28th, 2002, 12:31 PM
add 1 what?

ilyaslamasse
April 28th, 2002, 12:46 PM
Name your textbox 'pom', and then the code for the button should be :
on (press) {
_parent.pom ++ ;
}Let me try.

pom 0]

ilyaslamasse
April 28th, 2002, 12:50 PM
Yep. It works perfectly :smokin:

pom 0]

Psykloak1
April 28th, 2002, 01:09 PM
Thanks alot! You saved me a lot of trouble.

Psykloak1
April 28th, 2002, 03:46 PM
Hi, hehe, I need another little bit of help. Ok, now say that the button is in one movie clip and the text box is in another, how to i do it. (to see what I wanna do, read the top post)

ilyaslamasse
April 28th, 2002, 04:22 PM
Give the movie clip the instance name ilyaslamasse and then the code is
on (press) {
_parent.ilyaslamasse.pom ++ ;
}Let's explain this a bit, shall we ?

Now, we are inside a movie clip. So _parent will get us out of the movie clip. If the movie clip is in the _root, it will bring us in the _root, but it's not necessarily the case.

Now that we're out of the clip, we want to go to the other movie clip, whose INSTANCE NAME is 'ilyaslamasse'. Hence the _parent.ilyaslamasse.

Last but not least, pom is the content of the textbox. We increment it. Get it ?

pom 0]

Psykloak1
May 1st, 2002, 01:26 PM
Hehe, thanks for your help. now I got another problem, this little bit of action script isnt working, any ideas why?


on (press) {
_parent._parent.play;
_parent.stop;
play ();
}

This script is for a button inside movie clip inside a movie clip inside a movie clip.
When I click the button, it dose the play(); line but not the other two
Also, when I switch the ActionScript editor from expert mode to normal mode, it dosent detect any errors.

ilyaslamasse
May 1st, 2002, 03:35 PM
There aren't any errors (except maybe the fact that it's play () ).
The problem has to be the path you're using. Send me the fla, I'll check it : ilyas.usal@club-internet.fr

pom 0]

Psykloak1
May 1st, 2002, 03:58 PM
Ok, ilyaslamasse, I sent it. If any one else wants to try to get this working, just say so and I'll send you the same email.

ilyaslamasse
May 1st, 2002, 05:11 PM
That's what I thought. You have to write play () ;.

pom 0]

upuaut8
May 1st, 2002, 05:50 PM
you da man Pom.. :)

ilyaslamasse
May 1st, 2002, 06:46 PM
Come on... <img src=http://www.ezboard.com/intl/aenglish/images/emoticons/embarassed.gif ALT=":o">

pom 0]

Psykloak1
May 3rd, 2002, 02:50 PM
Again I come for help because no one is as good as you guys. Hehe. Anyway...

I figured out how to use AS to rotate and scale movie clips but now I need to know how to shift images. I call it shift b/c I dont know the real name (my friend calls it 'Slanterize').

If you still dont know what I mean, open up flash, draw something, select it, right click and hit rotate. Now theirs 8 little white circles, the ones on the corners are for normal rotating and the ones between the corners are for the shift thing.

I need to know the code, if any, to do this.

upuaut8
May 3rd, 2002, 05:40 PM
ooo good question. Well.. if Pom doesn't know the answer.. I'm looking for it.. I'd really like to know that too.

ilyaslamasse
May 3rd, 2002, 06:45 PM
What do you mean ? You want the code to be able to edit a clip so that you can change the scale and the rotation ? Arghh !!

pom 0]

Psykloak1
May 3rd, 2002, 07:42 PM
Hmm, how can i explain it,

ok, basicaly I wanna know how to do this with Action script:
www.angelfire.com/pokemon2/onlinepics (http://www.angelfire.com/pokemon2/onlinepics)

I am not Jubba
May 3rd, 2002, 08:34 PM
skewing w/ AS isnt easy...someone might know...

ilyaslamasse
May 4th, 2002, 09:58 AM
I tried to do it a while ago. And couldn't. Maybe Thor knows.

pom 0]