ActionScript 2.0 :: How To Tell The Mc To Play If Press
Dec 1, 2006i have this code on a mc on stage:
ActionScript Code:
onClipEvent (enterFrame) {
if (_root.activate == 1) {
[code]....
i have this code on a mc on stage:
ActionScript Code:
onClipEvent (enterFrame) {
if (_root.activate == 1) {
[code]....
OK, say I have a button that does something, like go to the next frame, is there anyway to have it play a simple sound located in the library without looping?
View 8 RepliesI'm trying to play a sound on a space bar press. I am using Flash MX
View 3 RepliesI have a sound bite (~500ms) and want when a key is pressed and held the sound is played.However, what I appear to be getting is the sound triggered to play every time the key down event is triggered (not suprising & makes sense since key is held down). This creates what sounds like several copies of the sound being played at same time only shifted slightly. Very ugly sound btw.My thought is to have a way that even if key is continued to be held down the sound bite is looped but not overlapped.Tried several things such as using Event.Sound_Complete listener, tracking the position, transformation things, timers, etc without success.
View 2 RepliesI've made this game in Flash Builder 4, I thought it's all working but when I press the play button nothing is shown and it's not working at all.
package{ import flash.display.MovieClip; import flash.events.*; import flash.ui.Keyboard; public class Pong extends MovieClip { public var ai:MovieClip = new MovieClip; public var playerone:MovieClip = new MovieClip; public var [code]..................
I'm having the worst time figuring this out... Here is the movie I made: [URL] and I want it to stop, then when i press that circle, continue with the animation. right now i have a stop(); on frame 19 the button is named myBtn I have tried all kinds of myBtn.onRelease = Play() but when I do that, i get errors and it no longer stops...
View 7 RepliesI'm working in Flash CS4 and I would try to do it in AS3 but my teacher isn't very familiar with it, so I've decided to do it AS2. But so far he hasn't been able to, that is why I AM DESPERATELY coming to you.
I want to be able to PRESS A and play the movie clip that goes with it.
I want to do this with the whole alphabet.
Press A play movie clip APage
Press B play movie clip BPage - and so on....
I'm looking for some help regarding stopping sounds in Actionscript 3. Basically I'm making an interactive story game, basically a quiz game. On the main menu I have a narrator talking. What I basically want to do is have the track stop playing when you press the play button. I have the soundtrack playing already and the play button too. I just can't figure out how to get the sound to stop when I press the play button and it goes to the next scene.
[Code]...
I'm trying to do is use a keyboard event to play a whole movieclip once then stop once the animation sequence is over. However, when I press the corresponding key, all it does is play the animation for as long as the key is held down. What I want it to do is play the whole animation when you press the key just once.This is my code:
ActionScript Code:
import flash.events.KeyboardEvent;
var space:Boolean = false;
stage.addEventListener(Event.ENTER_FRAME,doNothing);[code]..............
I have it like this;
on (release) {
alexSound = new Sound(this);
alexSound.attachSound("coolsound");[code].....
But i dont want it to play two songs at the same time if i press the button twice.
I have set the Progressive-Download video instead of Streaming-Video (because my webserver provider "aruba.it" doesn't offer streaming videos), in Flash CS4 Professional, and exported to Dreamweaver CS4. I have also inserted the HTML code in Dreamweaver CS4 to enable FullScreen Playback of Flash .flv Videos.Now I have a problem:
- When the webpage loads into Internet Explorer 7, it take much time to load all the videos at same time!
Thus I want this:
- I want that the videos start to load just when I press the Play button, individually, not at same time.- I don't not want that start the load immediately when the webpage opens in IE7. - I want that the videos start to load content in the same manner of YouTube videos, just when I press play.
How can I do? What is the HTML code that I should insert into DreamweaverCS4? I have seen this help page: [URL]
At Chapter "Public Methods" I have seen this "load" function:"Begins loading the FLV file and provides a shortcut for setting the autoPlay property to false and setting the source, totalTime, and isLive properties, if given..."
i need to make a certain movie clip play when i press a button.
View 4 Repliesi'm looking for a code for a keycombmanager in AS3, if anyone have played the advergame from cokezero, you have to press a certain keycombination the movieclip kind of jumps to and play another frame, that's the kind of kombination i'm looking for. [URL]
View 1 RepliesIs it possible to create a button that when you press it and hold it, it will play a sound, and when you release it then stops the sound?
View 2 Repliesi'm habing abit of problem with this code, its supposed to play pause and stop, the problem being that when i press stop then play it only plays from the last pause and not the beggining how to get it to play from the start after the stop button is pressed
[Code]...
Look at this tutorial [URL] I want the sound to start directly when you press the play button, without having to adjust the volume.
View 14 RepliesHow can i make it so a when you press a button it starts a countdown but every other press dosent reset it?
View 14 RepliesI have a problem when I making a game Flash with action script 3,. I want tomake my character move when the key helding and I want my character attackwith one tab press either
View 3 RepliesI have text field which is 0 by default (score_txt)Two buttons +1 and -1 (plus_btn and minus_btn) When I press +1 text increases by one, and when i press -1 it decreses
View 4 RepliesI 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.
I have a sound clip that I'm loading externally into my flash file. The code I'm using looks like this and is placed in the as layer on the first frame,
var mySound:Sound = new Sound();
var myChannel:SoundChannel = new SoundChannel();
var myTransform = new SoundTransform();
var lastPosition:Number = 0;
mySound.load(new URLRequest("introaudio.mp3"));
myChannel = mySound.play();
[Code]....
I would like to create my page links so when I roll over the text(link) enlarges and then once pressed a swf animation plays.When it stops it automatically directs to the desired page.
View 5 Repliesi'm designing a website in flash8... now i have created some buttons, and i want that when i click on the button stars will fly from them and there will be a sound... i have already created the animation of the stars seperatly and it's in the library, i have also the sound file.... i just can't remember how to put everything together.... when i'll press on the button the stars will be flying from the button and the sound will play?
View 3 Repliesi have an object that i want to drag and drop with the same event.Something like on press start drag and on press again stop drag. I'm sure it's pretty simple with and if and else statment but i can't find how to do that...The best i have done so far was this:
[Code]...
How can I use two key at a time :
I wrote this code for single key ....
Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, moving);
function moving(event:KeyboardEvent):void
{
if (event.keyCode == Keyboard.RIGHT)
[Code].....
I am making something that requires me to have a key pressed. I tried using the Code: if (Key.isDown(Key.thekey) But the key I want does not show up. I want to use the a,s,d,f,g,h,j,k,w,e,t,y,u, keys but they don't show up so I don't know how to make that happen. on a letter keypress. I also would like to know how to make it do something on the key release. I am using flash CS3 and ActionScript 2.0
View 3 RepliesI'm able to detect (at the most) two simultaneous key presses via a switch statement and series of booleans. For my game's sake, I need to be able to detect up to 4 keys.
Here's my test script:
var key_37:Boolean = false;
var key_38:Boolean = false;
var key_39:Boolean = false;
[Code]....
i have a MC with 2 MCs inside. [MC1 & MC2 for arguments sake] When MC1 is clicked i want MC 2 to go to the next frame. //code on mc1 onClipEvent(enterFrame){ on(press) { _root.MC2.nextFrame(); }} just 1 of the trial and errors ive tryed how do i do this ive tryed many different combinations and on different movie clips but nothings happening for me :S
View 7 RepliesI know how to make a button and all.. but what do I do to make it go to the next scene?
scene 1: Startsidan
scene 2: Sidan
I made a frontpage and when I click on the picture I want it to go to scene 2, where it enters the inside.
the button is called PortalenKnappen, I want to be able to just press on it and it will go to the "sidan(scene 2)" that's empty at the moment.
what would I have to write? I've tried "portalenKnappen.onPress nextScene("sidan", 1"); but it doesn't work.
I'm wondering if there's a way to temporarily disable keyboard shortcuts in Flash? The problem is that some key presses don't register when I'm testing a movie in flash because flash itself registers the key. For example pressing "B" while I'm testing a movie activates the Brush tool but doesn't trigger an event in the actual movie. When I publish the movie and try it in a browser it works fine.
[Code]...