ActionScript 2.0 :: Add A Simple Wait?
Dec 2, 2011
I have some code that loops an animation, basically I just want to add a few seconds wait before it starts again. The code is below, including the wait() function I am trying to use.[code]....
View 5 Replies
Similar Posts:
Aug 1, 2011
Flash is not in my toolset, but I am an old Director jock and have spent some hours dipping my head into the Flash manual. I suppose that makes me a promising beginner-level poster. I'm working in CS5.
I need to make a simple Flash-based sound player for a website for a newly-released novel (http://www.bearriverbooks.com/index.html). I want the user to click on what appears to be an icon (or image), which kicks open a simple controller and starts playing a sound file (a radio interview, which I will probably export using Flash's voice compression). Nothing fancy. Just want the visitor to hear the sound and be able to apply simple controls (stop/start/rewind/volume).
I can learn ActionScript, I suppose, since I used to dream in Lingo, but my life would be a lot simpler if I could just publish a controller without having to roll my own. I'd like to think there's a magic button somewhere that can do this, but I haven't found it yet.
View 4 Replies
Nov 8, 2011
Is there any way to implement waiting for, say, 3 seconds in ActionScript, but to stay within same function? I have looked setInterval, setTimeOut and similar functions, but what I really need is this:
[Code]...
In case you wonder why I need this - it is a legal requirement, and no, I can't change it.
View 4 Replies
Nov 6, 2003
Is there a way to tell a movie clip to way a number of frames from a specific action being executed (say a button being pushed) before it starts playing?
View 2 Replies
Mar 29, 2009
I'm New to flash and I can't seem to figure this out, I just want to make something visible for 5 seconds then make it invisible again.
[Code]...
View 1 Replies
Feb 16, 2010
I have a textarea named "debug" on frame 2 that does not exist on frame 1Using this code:
Code:
function outputHello(){
debug.text="Hello";
[code].....
View 1 Replies
Oct 29, 2004
i want to have some action script code like:
//some code here
//wait so many seconds(or milliseconds)
//then do so more code here
[code].....
View 1 Replies
Jul 8, 2009
I'm writing a movie scene in AS3, and I hit a snag. I have a movie where the dialogue is advanced by the user pressing a button (the space bar). I have a speak function which prints out the dialogue to a dynamic text box. However, if I type in this:
speak(1, "Hello world!");
speak(2, "Hello back to you as well.");
Then, my first speak function is immediately overwritten by my second one...because they run at the same time. I'm not using the timeline so, I can't put a stop() function in or anything. I'm doing it all in ActionScript.
Is there a way to pause the movie and wait for the user to press the spacebar before loading up the second function. I was thinking of nesting functions to do it, but that seems overly complicated since I'll have nearly 20 lines of dialogue nested within one another in between moving my sprites around.
View 3 Replies
Oct 21, 2009
Im trying to make some sort of hearing check to see if your ears are still functioning the way they should be. In my program the user is shown 9 images (for example an image of a cat) The images correspond to the 1 - 9 keys. (Im not sure if this is relevant but i'm programming for a Flash Lite application to be run on a mobile device)So let's say the image of the cat is number 1. The sound of the cat is being played and the user has to press the 1 key on his keyboard. However for this to be possible the script must pause and give the user the oppertunity to press the correct key.How can i make sure the script does not continue until a key is pressed after playing a sound.Below is my code so far:
Code:
stop();
var pressedKey = new Number();
[code].....
View 1 Replies
Apr 15, 2010
Is it possible in AS3, to have 0 alpha for some seconds, then have the buttons fade in... and I say buttons, as I have two of them. But wanted to finish it all of with a nice fade-in effect on my buttons. I've found some nice fade out effects with tweening in AS3, but I need fade in - and would like for me to decide when they should do this. So far I'm pretty satisfied with my first flash file, but I do like perfection!
View 2 Replies
Jan 10, 2010
I am trying to load several swf files into various containers. In one scene I have used the following:
createEmptyMovieClip("container1", 1);loadMovie("MC.swf", "container1");
And I want to wait for it to load complete before moving to the next scene and doing the following one...
createEmptyMovieClip("container2", 2);loadMovie("MC2.swf", "container2");
View 3 Replies
May 31, 2010
is it possible to have a wait function inbetween the 2 actions here?
import fl.transitions.*;
import fl.transitions.easing.*;
TransitionManager.start(img1_mc, {type:Fade, direction:Transition.OUT, duration:9, easing:Strong.easeOut});
TransitionManager.start(img2_mc, {type:Fade, direction:Transition.OUT, duration:9, easing:Strong.easeOut});
View 5 Replies
May 1, 2011
Is there a way in as3 to pause the execution and wait for user input (click on yes or no for example)?[code]
View 6 Replies
Mar 13, 2011
I have a child component that dispatches an event in Parent. The event in parent makes a call to our database. Right now, the event gets fired off & the child continues without the results. How do I make it so that the child waits for the results from the database b/f the child continues?
in child:
<fx:Script>
<![CDATA[
dispatchEvent(new Event("getDBcontents")); //
dispatch the event in the parent do some more stuff here but we need pause until we get the result from the parent
[Code]...
View 1 Replies
Jul 21, 2011
I have two Flash banner ads, built in CS5.5, using AS2, that will be placed on a page together and appear to interact with each other when played at the same time. Similar to this: [URL]..
The problem is that they might not load at the same time. How can I get each banner to check that the other has finished loading before playing?
I had read that LocalConnection was the way to do this, but I haven't been able to find anything that explains it well.
View 1 Replies
Aug 27, 2011
I have two sharedProperties in an app, one of them is in addition a batonProperty. It is easy if I only want one of them to be synched, I just add an eventlistener to the sync event. If I have two though, I can still attach event listeners to both to check when each syncs, but how would I wait for both of them to be synched?
View 1 Replies
Sep 20, 2011
When I click my button I wish one of mc's disapear completely(first alpha changes from 1 to 0) then removeChild.
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;[code].....
I dicided to use events but it doesnt work,
View 1 Replies
Feb 3, 2009
essentially, I'm loading some clips dynamically via xml offstage...they then pan to the center of the screen. Pretty easy, except the files (about 100k+) aren't loading fast enough, and they're showing up halfway through the tweenYes, I know, I need to wait until the clip has loaded...but how? I've tried onLoad(success), getBytesLoaded() ==getBytesTotal() etc...but I can't so much as get the file size of the file at the end of the xml branch. Before I go any farther, here's the code:
button.onPress = function() {
var itsloading = _root.gallcon.gal.attachMovie("loader_circ", "loading", 60);
itsloading._x = 380;
[code]........
View 1 Replies
May 6, 2010
what I am trying to do is wait for the net connection to return a value before i take that value and put it in a variable.
Code:
ActionScript Code:
import flash.net.*;
var gw:NetConnection = new NetConnection();
[Code]....
The problem is that gw.call(~) calls a php file, and it takes a few seconds for it to return a value.
Error: 1067: Implicit coercion of a value of type void to an unrelated type uint.
View 5 Replies
Oct 7, 2010
i believe it is quite simple but i'm not able to do this. situation is something like this:
function name123():void //i m already in a function.
{
....
var a:Loader = new Loader(); //define a loader
[Code]....
i know if i give set width and height in eventComplete function, i could do but the situation is different and i've to set the sizes in name123 function only.
View 8 Replies
Dec 28, 2010
I have a SQLite file to which I'm connecting. I don't have a safety function to quit the SQL connection if it's taking too long. [code]...
View 3 Replies
May 25, 2011
I quite often find myself needing to wait until a bunch of things have happened, for instance, wait until I get an Event.ADDED_TO_STAGE, an Event.COMPLETE from a URLLoader loading up XML and an Event.COMPLETE from a Loader fetching some assets.
I have no idea and don't really care in what order these things will happen, I just want to know when the last one has happened. I have used various tactics to deal with this - none of them have yet felt "right" or "good".
Is there a standard pattern or solution for organising multiple listeners like this?
View 4 Replies
Jul 7, 2011
I have a site with a music player that streams the music. On the site I also have a button that opens a video page. When I press the button, I want to pause the player. That works, except when the player is loading or buffering, I cant pause it. So I want to put something like this on the button...
on (release) {
if audioPlayerStatus = "loading" or "buffering" {
WAIT a bit and check again
} else if audioPlayerStatus = "playing" {
audioPlayer.pause();
}
The status function is bulit into the player. "wait a bit" code.
View 1 Replies
Apr 16, 2009
so i have some code that draws out a simple soundSpectrum -- Now my main timeline is only 5 frames long -- so 99% of my code is in that 5th frame.
[Code]...
View 4 Replies
Dec 10, 2003
how will be actionScript for waiting the play head in a frame for 5 second ?
View 5 Replies
Jul 14, 2005
I have a problem with the way Flash handles a script I am making. What I currently have is 10 movieclips which I want to play after each other. Right now, I am using a for loop to start each clip. Naturally this will make it so that each clip starts almost immediately after the one before it. make a script that will make Flash wait with playing a clip until the one before it is done?
View 2 Replies
Jan 10, 2006
I have a timeline with 20 simple animations and different lenght audio clips that explain each. Is there a way to hold on a frame until an audio clip is done? Currently I have a script that loops a frame for "x" seconds then goes to the next frame. I input "x" each time by looking at the audio clips time length, but I was hoping to create a script that did this automatically.
View 5 Replies
Jul 11, 2007
I'm trying to load an external XML file into my program using onLoad callback function. The problem is that the script will continue to run without waiting for the file to load. Is there a way to do that?
View 2 Replies
May 21, 2009
I have two classes: Level, which dictates a tile-based level, and MapLoader, which loads a text file on my local machine.I am calling a load function through Level asking MapLoader to load, but when I try to parse the data, MapLoader isn't done with the load.I've tried putting the load in a while loop, but it just freezes. Here's the MapLoader and the function in Level.[code]
View 5 Replies
Jun 4, 2009
In this app/website I'm building, I will be making many requests for data (via an external PHP file that queries a MySQL database). I'd like to build this request mechanism into its own class so I can reuse it.What's the best way to handle this? I'm thinking the following would work, but I'm a bit lost on the last step:1) From the main class, call a method in the query class (with whatever arguments apply, to specify what data I need etc).
2) Set up a listener in the main class and make the program enter a sort of "wait" state (possibly visually, if these requests wind up taking more than a half-second or so)3) From query class (upon receiving the data), dispatch event to let main class know it's received the data.4) Send data to main class. <---- How should this be achieved?For #4, should I create a custom event that dispatches with the data inside the event object for the main class to receive when it's notified? Will this be a problem if I have lots of different types of requests (will I need a new custom event for each type?)? Or is there some other sort of "return" I can/should use (similar to calling a function that returns a value)
View 1 Replies