First off... I'm new here so sorry if I do something wrong
And I know you're going to tell me that I need to not be lazy and do it myself and generally that would be the case but for once I have tried and thus have come here after failing to come up with a solution [That wasn't a run on >_>]
Anyway. I'm taking a Flash Animation class in high school.
We've covered basic motion and shape tweens and the like.
We made a ball bounce to music, Pac Man get chased by Blinky, something for our school website [that I believe was never put up], a fade, zoom, and ripple effect.
All of which require no Action Scripting.
I've programmed a bit of Basic and a lot more in C#/C++
So I do know what I'm doing... and I can write an algorithm for it... But my teacher doesn't know Action Script either... and gave us two videos to watch that didn't help too much.
So our assignment is to create a shockwave file that has 4 or more buttons. Each button should play a sound and an animation [not make the button animate but a separate movie clip]. I sketched it out and decided to make a guitar type document. I have a guitar with Guitar Hero-esque buttons. 5 buttons on the fret board. Each plays a different note. Another note plays when you click over the... circle part [on an acoustic guitar]. I then have a "Star Power" button that plays a whammy'd note and another one that plays a random riff. Cool, so we have the sounds down. But now comes into play the animation.
My highest note has a Megaman run across the screen [I cut each frame out from a sprite sheet]. My Star Power button has some fireworks come up from the bottom of the screen. The Catchy Riff button has Pac Man from my old assignment run across the screen.
The problem is that the animations only play as long as the button is held in.
What I would like it to do is play the movie clip when the button is released [not while it's down] and to only play the animation plays
After checking several websites and not getting help from our teacher [who has a Macromedia 8 textbook and that's it...]. I made a separate layer called actions and added:
stop();
To frame 1 of the actions layer.
So the animations stop after playing through once.
But when I added [wrong] code to make it play on the release of the button it stopped working. I ended up with this:
Star Power.onRelease = functions()
{
Fireworks.play();
}
stop();
It stopped working
In my mind that checks the Star Power button and then on the release of it, it calls the Fireworks movie clip and makes it play
The algorithm I started with had a counting variable, i, and an if statement that checked the value of i. If the value was < 1 it played. If not then the movie clip wouldn't. Then it reset the value of i in the second frame of the movie clip.
I tried several times... different ways and commented most of it out.
So rather than explain each line to you I'll just copy and paste what I've tried...
//var i:int; // Counting Variable
//import mx.core.UIObject; // Import packages
//
//// Declare the class and extend from the parent class
//class mypackage.MyComponent extends UIObject {
//{
// if (i >= 1) //Checks to see if it's the first time the firework has is playing
// {
// this.stop; //Stops the animation of the firework after one play through
// }
// else
// {
// i++; //Adds one to the counter of the firework
// }
//}
//if (StarPowerButton.click == true)
// fireworksplay();
//else if (StarPowerButton.doubleClick == true)
// fireworksPlayInfinite();
//
// public function fireworksPlay()
// {
// i = 1;
// fireworks.play;
// }
//
// public function fireworksPlayInfinite()
// {
// i = -99999;
// fireworks.addEventListener().play;
// }
//
// removeEventListener(MouseEvent.CLICK, fireworks.play);
// StarPowerButton.onRelease = StarPowerButton.play;
//StarPowerButton.onRelease = StarPowerButton.play;
//StarPowerButton.onRelease = this.play;
Star Power.onRelease = functions()
{
Fireworks.play();
}
Thank you to anyone who is willing to help me... Sorry I made you read so much I just didn't want to come off as not trying... or something I guess. I've been working for two or three classes [80 minutes each] on this and I really can't come up with anything...
Again sorry you read all that... but I guess it's time I get back to work on it...
Thanks in advance again.
And I know you're going to tell me that I need to not be lazy and do it myself and generally that would be the case but for once I have tried and thus have come here after failing to come up with a solution [That wasn't a run on >_>]
Anyway. I'm taking a Flash Animation class in high school.
We've covered basic motion and shape tweens and the like.
We made a ball bounce to music, Pac Man get chased by Blinky, something for our school website [that I believe was never put up], a fade, zoom, and ripple effect.
All of which require no Action Scripting.
I've programmed a bit of Basic and a lot more in C#/C++
So I do know what I'm doing... and I can write an algorithm for it... But my teacher doesn't know Action Script either... and gave us two videos to watch that didn't help too much.
So our assignment is to create a shockwave file that has 4 or more buttons. Each button should play a sound and an animation [not make the button animate but a separate movie clip]. I sketched it out and decided to make a guitar type document. I have a guitar with Guitar Hero-esque buttons. 5 buttons on the fret board. Each plays a different note. Another note plays when you click over the... circle part [on an acoustic guitar]. I then have a "Star Power" button that plays a whammy'd note and another one that plays a random riff. Cool, so we have the sounds down. But now comes into play the animation.
My highest note has a Megaman run across the screen [I cut each frame out from a sprite sheet]. My Star Power button has some fireworks come up from the bottom of the screen. The Catchy Riff button has Pac Man from my old assignment run across the screen.
The problem is that the animations only play as long as the button is held in.
What I would like it to do is play the movie clip when the button is released [not while it's down] and to only play the animation plays
After checking several websites and not getting help from our teacher [who has a Macromedia 8 textbook and that's it...]. I made a separate layer called actions and added:
stop();
To frame 1 of the actions layer.
So the animations stop after playing through once.
But when I added [wrong] code to make it play on the release of the button it stopped working. I ended up with this:
Star Power.onRelease = functions()
{
Fireworks.play();
}
stop();
It stopped working
In my mind that checks the Star Power button and then on the release of it, it calls the Fireworks movie clip and makes it play
The algorithm I started with had a counting variable, i, and an if statement that checked the value of i. If the value was < 1 it played. If not then the movie clip wouldn't. Then it reset the value of i in the second frame of the movie clip.
I tried several times... different ways and commented most of it out.
So rather than explain each line to you I'll just copy and paste what I've tried...
//var i:int; // Counting Variable
//import mx.core.UIObject; // Import packages
//
//// Declare the class and extend from the parent class
//class mypackage.MyComponent extends UIObject {
//{
// if (i >= 1) //Checks to see if it's the first time the firework has is playing
// {
// this.stop; //Stops the animation of the firework after one play through
// }
// else
// {
// i++; //Adds one to the counter of the firework
// }
//}
//if (StarPowerButton.click == true)
// fireworksplay();
//else if (StarPowerButton.doubleClick == true)
// fireworksPlayInfinite();
//
// public function fireworksPlay()
// {
// i = 1;
// fireworks.play;
// }
//
// public function fireworksPlayInfinite()
// {
// i = -99999;
// fireworks.addEventListener().play;
// }
//
// removeEventListener(MouseEvent.CLICK, fireworks.play);
// StarPowerButton.onRelease = StarPowerButton.play;
//StarPowerButton.onRelease = StarPowerButton.play;
//StarPowerButton.onRelease = this.play;
Star Power.onRelease = functions()
{
Fireworks.play();
}
Thank you to anyone who is willing to help me... Sorry I made you read so much I just didn't want to come off as not trying... or something I guess. I've been working for two or three classes [80 minutes each] on this and I really can't come up with anything...
Again sorry you read all that... but I guess it's time I get back to work on it...
Thanks in advance again.