First please check the attached fla file. I have a shape tween loading, and an "Increase Speed" button. I want to when i click the button, the tween become faster. So i think i should make my tween with AS or something else. how to do that? and how to make that button a speed gainer.
What's the solution?
Remove the long Shape Tween inside your movieclip, when you only have 1 Frame left, click on the bar, open Properties Panel (CTRL+F3), and change its X position (which should be at that point, -5) to 0, to make its most Left-side part be on the registration point. Get out of the movieclip, repoisition the Bar movieclip as needed, click on it once, open Properties Panel (CTRL+F3), give it an Instance Name (in the Instance Name labeled text field) of for example, bar_mc. Click on your button once, give it an instance name of, for example, my_btn. Select your Border around the bar, convert it to a Movieclip, and give it an instance name of, bar_border. Click on your Frame, open Actions Panel (F9), and type this in there:
Actionscript Code:
speed = 1; // starting speed increaseSpeed = 1; // by how much the speed should be increased per click
It basically tells Flash to keep extending the bar's width as long as its width is smaller than the width of the border, otherwise, end the increasing of the bar.
Hope this works
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
O, Thanks a lot man! I understood the process, that worked great. Can you please tell me how I can tell the Flash to reset the bar after click on the button, and start it with the new speed? That means I want my bar to start from the start position after clicking the button. Thanks.
Thanks a lot! That worked great too. I'm making a flash game. May I ask my other questions here?
I have a "on (press) {...}" function for my submit button. How I can add "keyPress "<Enter>"" to it?
Also how to add that to "my_btn.onPress = function () {"
I want my button to work with click and Enter key pressing. How to do that?
Thanks.
while the second one is on a whole different level, which requires you to add a listener:
Actionscript Code:
keyListener = newObject(); keyListener.onKeyDown = function(){ if(Key.isDown(Key.ENTER)){ // same code goes here as in "my_btn.onPress = function () {" } } Key.addListener(keyListener);
Hope this helps despite its complexity
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
Thanks again! I made my buttons altogether, so I don't need the second one, and I'm free to understand that complexity! The first one helps me enough.
There is another question: How to make something like a variable to store a process in it for use after on(press){}. For example:
I want all of my buttons to do this works after clicking on them:
So should I write this scripts after all my on(press){...} functions or I can store them in a variable for example and use it after on(press){..}?
Thanks!
Last edited by farzadbayan; 03-21-2012 at 08:46 AM.
Yea, That's what I wont! Thanks.
My game programming is almost done, just there is one important part that I need your help to do:
First please download my attachments. I made two files. One is the fla source, that explained the problem, and another is an animation of what I want. Please ask me, if you couldn't understand my problem from those files.
I will become happy if you show me the solution.
Thanks so much.
Yup, it's very nice and clean. But there is one problem: This burn the bar just once. I want to repeat this process for each click.
That means for the second click, if:
(fast_border._width - fast_bar._width) < main_bar, then the main bar will start from the burned area. (Now it's fine)
But, if the (fast_border._width - fast_bar._width) > main_bar, then the main bar will burn more.
Thanks for your kindly helps!
Last edited by farzadbayan; 03-23-2012 at 04:20 AM.
Hey friends, I really need your helps. I know there are people in this forum, that can help me. Hoo Hoo, I haven't much time to make this game. So please.
You are really awesome! It is exactly what I wont! That helped me to continue my game =)
I don't know, can the reduction occur with animation? Take a look at my attachment please. Can you do it? (at this time, the player can't understand what happened, with a simple animation, everything will be intelligible)