ActionScript 3.0 :: Stop And Play Methods - Instance Name
Apr 30, 2009
I have recently adopted an FLV from someone else. It is structured "unconventionally" at best. For this reason (and because I am not well-versed in AS3), I haven't been able to get a pause/play button to function properly. About the file, The project is a 6-7 minute demo for a new product complete with voiceover. You have to drill in 3 movie clips deep before you can get to much of the animation. There are gotoAndPlay functions at the end of each 3rd-level movie clip that refer to a frame on the 2nd level.
On the 2nd-level frame, there is a stop function which allows the next movie clip to play. Each movie clip contains a sound layer for voice over. About the play/pause button. The instance name is pauseBtn. The button code below is on the 1st frame of the main timeline. There is a keyframe on the second frame for another bit of code. The button itself is a 2-frame MC that spans the entire main timeline. The event.target.gotoAndStop() lines are working properly to change the look of the button.
My button scriptstop();
import flash.media.SoundMixer;
var pp:Boolean = true;
function ppState(event:MouseEvent) {
if(pp) {
stop();
[Code] .....
What happens when I test the movieThe animation plays without problem as long as the button is not clicked. I haven't been able to see a pattern in the chaos that occurs when the button is clicked.
Sometimes nothing happens.
Sometimes it stops the sound only.
Sometimes it resets to the beginning of the movie.
Sometimes it starts play random parts on top of what was already playing.
This error appears in the output pane.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at NameOfTheFile_fla::MainTimeline/chk()
give me the actionscript for a bar that has a play and stop button to play and stop frames in a flash movie. i would be gratefull if you could as i am really stuck
i have a main movie. i use a loader to load a "example.swf" file. then i place that file inside a holder movieclip. in example.swf, i have an instance of a class i just wrote. this class has some particular methods. from my main movie, i want to call the methods of the instance of my class i have in example.swf. how can i do that??? i know it's a kind of casting, but none seems to work.
I'm working on a video player and I initially developed the player with everything in the .FLA file with no classes. Then I started modularizing my player into classes and realised that my classes are static methods rather than instance methods which doesn't seem to be needed in my player. My question is - is this a bad design to have all of your classes methods to be static rather than instance methods ? As I dont see the need (yet) so that's why i geared more towards static methods, is this a bad design?
Im new to AS3.[code]I have above code in a movieclip which i have Exported as a Class.But when i run it says "Constructor functions must be instance methods".
changed one of my methods to static and it worked for what I was trying to do but I would like to know what is the difference between static and instance method.
What is the difference between static and instance methods?
I'm new to AS3 and HaXe, but was hoping to find a way to use methods from a final class (Graphics) without always prefixing an instance variable.Instead of something like this:
var gr:Graphics = flash.Lib.current.graphics; gr.clear(); gr.beginFill(0xffffff, 1); gr.drawRect(0,0,400,400);
I was hoping to get something that works like processing.org, but I guess a lot of the convenience there comes from the preprocessing. I looked at the HaXe reference on advanced types (http://haxe.org/ref/type_advanced), but I haven't been able to make anything work so far. This probably isn't possible since Graphics is final, but I thought it wouldn't hurt to ask. It seems it would be easy if I could extend Graphics
I am follwoing a tutorial on linda.com about creating a website in Flash everything was going well until i started trying to copy the action script in the online examples now I keep getting this error message and can't figure out how to get rid of it:
This has been a long-standing curiosity of mine, and I haven't gotten around to profiling to find out, and haven't seen it asked yet (for AS3):Let's say that I have a class:
class MyClass { public function myMethod():String { return "some return value";
I placed a movie clip instance inside a button, and I want this movie clip to play when the button is released. I'm using this code on the frame containing the button:
function playMovie(event:MouseEvent) { this.theButton.theMC.gotoAndPlay(3);
I just got Flash CS3. I'm trying to get my main timeline to stop in the begining, on button press to play and at the end stop again. In AS2, you would just put stop(); on the first keyframe and stop(); on the last key frame and program your buttons accordingly.
The stop(); does not work!!!! It's driving me crazy. What am I missing? I've gone through the tutorials in Flash and they don't work either.Also, if you have MovieClip that contains an animation and you don't want the movie clip to be on a continuous loop how do you stop it from playing. In AS2, I would put a stop(); on the last keyframe of the movieclip's animation. This also does not work in AS3.
Is it possible to play and stop a number of frames later, without using stop() in the frames? Like when I click a button frame 20 will start playing and it stops 30 frames later, all defined by the actions of the button..
Is it possible to play and stop a number of frames later, without using stop() in the frames? Like when I click a button frame 20 will start playing and it stops 30 frames later, all defined by the actions of the button.
I have created two buttons for separate audio files. Essentially if you click on the button it will play and stop. This works great! I have also injected a SoundMixer.stopAll(); to ensure if you click between both buttons that it will stop the current audio file to play the next one. My problem is when I select the 2nd button for the first time everything seems to be working...it's when I attempt to click on the first button again, that it will require 2 clicks and then it stops and plays accordingly...anyone know how I could eliminate this annoying two click process?
I want a movie clip (let's call it homecontent_MC) with 100 frames play to frame 80 and stop.Then when someone clicks a button on the navigation bar (home, about, services, contact, etc...) homecontent_MC would then begin playing from it's position (frame 80) til it reaches 100, at which point it wouldn't be on screen, and the movie clip that corresponds to the navigation button press (say services_MC...) would start from frame 1 and continue til it stops at it's frame 80...
I have modified the original to include more head shots accompanied by audio clips. I have worked out the playing of the clips on release. I realize now that people may not want to listen to entire clip. Each mug shot serves as the button to hear the person talk. I do not know how to modify the button code for it to be a toggle. I guess it would need to be some kind of "play if, stop if" The only part of concern is loading playing the the audio, no changes need to be made to the rollover functionality.
mugWidth = 60; //change these if you change the size of your mugshots mugHeight = 60; //change to your mugshot height //instantiate sound and textformat classes
I bought an mp3 player that was supposed to prevent multiple instances of the player from playing at the same time. In other words, if I was playing an mp3 on one instance of the player and then pressed play on another instance, it would pause the original mp3. However, it is not functioning like this and the author of the flash player is not responding to my emails. I've included the code below:
magicmp3.fla:
Code: if (songName == undefined) { songName = "songs/VanessasDub.mp3"; }
I have a class that has a couple of events after each other:
It loads an image, loads another image, fades in a player, and plays a video.
Now when the user goes to somewhere else, this instance keeps on doing all it's stuff.
Actually I never had to figure this out, and for now I can just work around it, but I just want to know how to stop it from doing stuff when I don't need it anymore.
The only options in my AWS Mananagement Council are to reboot and termiante. If I understand this correctly, if I terminate, I lose all my setup instructions and would have to pay the $5 one-time fee once I restart. Is this correct?How can I setup my instance so I can stop it? I've looked at the support page and it says that I need to have my instance backed up with EBS rather than S3. These instructions are not too clear, because I thought a 8gb EBS is included when you initialize FMS. Here is the support page:[URL]..
I need to put multiple mp3 players on my webpage so I downloaded the player at [URL]. I am using both the mini and the multi version...so when the mini starts playing, I want multi to shutup.
I thought the best way would be to modify the flash file to use localConnection and fire the stop function but I can't access the stop function at all...my code is like this
IN THE MINI templateA class:
public function playRelease() { trace("playing clicked....test"); var talkingLC:LocalConnection = new LocalConnection();
configuring this instance movie to play when i click a button, here is my movie structure:
- root movie - container and some external .swf movie
The process is there will be button load at the end of root movie, and calling some external swf movie with number. all the swf will play in a container each swf movie(about 5 animation)
At the end of root movie there is also some loop animation that play at the end of root movie, while we can click the button also. What i want to do is how can i play the loop movie, start from the middle when i click one of the button.
So what happen will be: - click button = external movie load and the instance name play from frame 100 and loop again.
I created a button on the stage and made it a movie clip and called it's instance name "play_btn" then i made a document class "main.as" and a second class "play button.as". How is to access the instance name in the play button.as file like this...
public class login_page extends MovieClip { public function login_page() { play_btn.addEventListener(MouseEvent.MOUSE_DOWN, onPlayDown); } public function onPlayDown(evt:MouseEvent):void { trace("Test"); }}
And then I want to call the function in the main.as.. but the general problem is that I want to access the instance name "play_btn" in the "playbutton.as" file. I tried to link it to the class but i get this error: 1120: Access of undefined property play_btn.
I have some sounds in my library that I want to play in a soundchannel, but how? This is what I have so far:
var music:Sound = new Sound();var channel:SoundChannel = new SoundChannel();var sTransform:SoundTransform = new SoundTransform();var sound:SoundFile1 = new SoundFile1(); // Note: SoundFile1 is a class; in it is my soundfile in the library// music.load(sound); ??channel = music.play();