Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




How To Start Another Animation After One's Finished



Hi Guys, Mcnoobie here you may say but Action Script is no way my strong point. Anyway to the question. I was just wondering if there is a way to start a movie clip after one has finished playing so that they are both not running at the same time. I know you can do this with the timeline but this seems like a messy way of doing it and so was wondering if there was a simple way of getting about it. Any help is appreciated guys Lewn



KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 04-11-2006, 05:05 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

When A Swf Is Finished, Start Next Swf
Hello there.

I have 4 external swfs that i want to load into 4 different empty movieclips on mainscene.

First I want 1.swf to load and when its finished i want 2.swf to play and after it is finished 3.swf and finally 4.swf.
This is the intro...

On release i want to do the same, but i want to reuse 2.swf and 4.swf which i use as transitions. Until know i worked/used these two functions. But they does’nt seem to work.

function loadmovieClip(playClip, playMc, nextClip, nextMc) {
this[playMc].loadMovie(playClip);
//this i a preloader, of course.
preload(this["playMc"]);
this[nextMc].loadMovie(nextClip);
preload(this["nextMc"]);
}
function controlMc(playMc, nextMc) {
trace("this is "+playMc);
trace("this is "+nextMc);
checker = nextMc;
//_root.nextMc = nextMc;
this[playMc].gotoAndPlay("start");
trace(playMc+" is playing");
this.onEnterFrame = function() {
//trace("currentframe ="+this[playMc]._currentframe);
//trace("enterframe");
if (finishedClip == 60) {
trace(nextMc+" is playing");
//this[playMc]._visible = false;
//this[nextMc].loadMovie(nextClip);
//preload(nextClip);
this[nextMc].gotoAndPlay("start");
trace("hey efter 60"+nextMc);
checker = nextMc;
delete this.onEnterFrame;
}
finishedClip = 0;
//playMc = 0;
//nextMc = 0;
};
}

So on release i want this to happen

Play/load 5.swf -> 2.swf -> 7.swf -> 4.swf

But on another button this might happen..

Play/load 6.swf-> 4.swf-> 8.swf ->2.swf

I need a dynamic function, in which i can play and load a lot of swfs.

I hope that somebody out there can help me..

Stopping Animation From Playing Before Another Animation Has Finished (On Keypress)
Hi guys

I've linked to the project I'm current working on; essentially, what it does is play a ripple animation at specific points on the stage when certain keys are pressed. What I'm trying to do at the moment is stop people from hammering one key many times, and creating several instances of a ripple in one location. As well as looking strange, it also slows down Flash considerably ;-)

I'm not really sure where to start, but what I'm thinking of would work as follows: -

Person pushes 'Q', and a ripple is triggered at the coordinates relative to that key. If they press 'Q' again, it is impossible to trigger another ripple at that location until the current ripple animation has finished. The same is true with all of the other keys (Q, E, S, Z, C, Up, Down, Left Right) when pressed.

However, it should still be possible to trigger ripples at the same time with different keys. For example, someone could press three different keys at the same time, and see three different ripples which play at the same time and overlap, etc.

Hope that's clear enough - if anyone could help me out with this, it would be most appreciated.

- Thanks!

http://www.joshbarton.co.uk/flash/Ripple_Project.fla

Please Help- Start Movie When Action Finished
Hi all,

My first posting.

First there are 5 mc's on stage,4 images and 1 movie which is a line moving across the stage when mouse moves over any of the 4 movies (images).

My problem is I have anther movie which describes the image and is masked, but i want is the movie to start when the line reaches its destination.


I have this script on each image movie with different loctions for line.

onClipEvent (mouseMove) {
if (this.hitTest(_root._xmouse,_root._ymouse)) {
this._parent.line.xSlideTo(150, 0.5);
updateAfterEvent();
}
}
Any suggestions would be great.


Thansk you

Start Playing Before Finished Loading?
Hi all.. whats the best way when I have a SWF emebdded in a page that it
will begin playing before it finishes loading in the background? Thx

How Start A Sound When The Prev One Finished?
Flash5
-

hi there
could anybody help me with this sound problem?
what I want to do is assemble a sentence (every word spoken by different people) from different soundfiles.
As I will have many soundfiles, I just want to load the necessary ones (by random) and then asseble the whole thing (while playing).
-
my problem now is (the less important one) on how I could determine if a sound is loaded and (most important) on how the sound has finished, so that the next one could be startet....

thanx a lot
marcel

Start Level0 Movie After Level1 Finished
In my movie I firstly add an intro swf file into level1 and would like to know when this finishes so that I can then tell it to do the main stuff in level0. At the moment I'm just starting at frame 150 which is the last frame used in the level1 swf but I'm sure there is a better way of doing this?

Can someone help?
Many thanks

OnMotionFinished- Getting Code To Start Set Num Of Frames BEFORE Motion Finished
Hey,

Wondering if theres a way of using onMotionFinished or something simular to track a tween (created with the tween class) and start the next action BEFORE the motion ends.

I thought about something like this but I don't think it is!
onMotionFinished -1 or something like that.

Ideas chaps?

Go To URL When Animation Is Finished
Hey all... I've set up a little intro/splash page in flash for a website. I have it so that after you click on a category it takes you to that URL, however I want it to wait for the animation to finish before exiting...here's what i have (and i'll explain why the URL isn't being recognized):










Attach Code

_global.filePath = "pages/";

//these are the URLs; they correlate with the order of the navigation
url1 = "gear";
url2 = "specs";
url3 = "pics";
url4 = "rates";
url5 = "custom";
url6 = "contacts";
url7 = "custom";
url8 = "links";

//This loop loops as many times as there are navigation
for (i=0; i < 9; i++){

//here i set up what the links are...this says with in the navBTN the individual buttons are titled sequentially (i.e. btn1, btn2, btn3, etc.)
_root.navBTN["nBtn"+i].link = filePath + _root["url"+i] + ".php";


_root.navBTN["nBtn"+i].onRelease = function() {
new Tween(_root.main, "_x", Regular.easeIn, 0, 850, .3, true);

//if this is with in any function, it no longer recognizes "this", nor does it recognize any variable i set outside the function
getURL(this.link);
}

so, any ideas as to how to make it so it does not go to the URL until the animation above it finishes?

Is It Possible To Resize A Finished Flash Animation?
hello all.

ive made the idiot mistake of making a small animation for uni, and instead of sizing it 720x576 like im meant to with the brief, i initially set it to 640x480...

is there ANY way in the world for me to resize it back to 720x576 without ahving to edit and redo my entire animation???

i've looked this up in many places with different suggestions but non of them actually work...

thanks for the help guys.

How Do I Tell Flash My Loader Is Finished As Well As My Animation?
i am loading in an external swf and i have a loading bar. when the loader completes i am setting one variable to yes (the done variable). then when the animation reaches the last frame lable "end" its supposed to change the framer button to yes as well. ive included the code below.

as you may be able to tell from the code i am not getting to the final frame i want to go to when both complete. ive tried some addEventListeners that trigger the if statements every frame but then when it skips to frame 56 my output starts kicking out errors. how do i make it so the if statement will detect when both variables are set to yes and play frame 56?







Attach Code

stop();

//LOADER
var ldr4:Loader = new Loader();
var url4:String = "ur_player.swf";
var urlReq4:URLRequest = new URLRequest(url4);
ldr4.load(urlReq4);

ldr4.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progresshandlerrr4);
function progresshandlerrr4(myevent:ProgressEvent):void {
var myprogress2:Number=myevent.target.bytesLoaded/myevent.target.bytesTotal;
myTextField_txt3.text = Math.round(myprogress2*100)+"%";
}

ldr4.contentLoaderInfo.addEventListener(Event.COMPLETE, alldoneee4);
function alldoneee4(myevent:Event):void {
//SET FIRST VARIABLE
var done = "yes";
trace(done);
}

//VARIABLES
var done = "no";
var framer = "no";

//SET SECOND VARIABLE
if (flyby.currentLabel == "end") {
framer = "yes";
trace("framer yes");
}

//WHEN BOTH VARIABLES ARE YES GO TO FRAME 56
if (done == "yes" && framer == "yes") {
gotoAndPlay(56);
trace("done");
}

Checking If AS Driven Animation Is Finished.
my question is quite simple (i hope):

what's a good method for cheking if a animation is finished? and with animation i mean AS animations. (i'm using the mc_tween extension for flash) i tried it with variables but that didn't work.

any help is appreciated...

[AS2]disable Button Till Animation Is Finished.
I'm trying to make a script that will disable leftarrow till the animation is finished. I made a crude attempt myself but it doesn't work :/.

Any ideas?


ActionScript Code:
import mx.transitions.Tween;allowChanging = true;if (allowChanging == true) {    this.leftarrow.onRelease = function() {        var myTween:Tween = new mx.transitions.Tween(_root.images.imagemove, "_x", mx.transitions.easing.Regular.easeOut, _root.images.imagemove._x, _root.images.imagemove._x+700, 10);        allowChanging = false;        myTween.onMotionFinished = function() {            allowChanging = true;        };    };}


thanks!

Flex Determining When Animation Has Finished Playing
I tried googling but nothing came up (atleast not that i found it) so i tried doing it myself.
In my app im embedding a swf file and then use this code to display it:

Code:
_animation_swf = new LaserAnimation() as MovieClipLoaderAsset;

_animation_loader = new SWFLoader();
_animation_loader.load(_animation_swf);

this.addChild(_animation_loader);
I googled and found out MovieClipLoaderAsset has methods to determine current frame playing and total frames. Perfect for me. I wrote this little class:

Code:
package components.init_screen.components
{
import events.AnimationPlayEvent;

import flash.events.Event;
import flash.events.TimerEvent;
import flash.utils.Timer;

import mx.core.MovieClipLoaderAsset;

public class Animation extends MovieClipLoaderAsset
{

private var _timer:Timer;

public function Animation()
{
super();

_timer = new Timer(100);
_timer.addEventListener(TimerEvent.TIMER, detectPlayback);

this.addEventListener(Event.COMPLETE, startDetection);

}

/**
* starts when asset finishes loading
* */
private function startDetection(event:Event):void{
_timer.start();
}

/**
* is being repeated periodically and detects if animation has finished playing
* */
private function detectPlayback():void{
if(currentFrame >= totalFrames){
_timer.stop();
dispatchEvent(new AnimationPlayEvent(AnimationPlayEvent.PLAY_COMPLETE));
}
}


}
}
and changed the display code to this:

Code:
_animation_swf = new LaserAnimation() as Animation;

_animation_swf.addEventListener(AnimationPlayEvent.PLAY_COMPLETE, addLanguageMenu);

_animation_loader = new SWFLoader();
_animation_loader.load(_animation_swf);

this.addChild(_animation_loader);
The problem is it reports a runtime error: Cannot access a property or method of a null object reference. on line where i add an event listener. If I try commenting that line it seems the app just freezes... no http service response, no animation showing...
Does anyone know what i did wrong?

How Do I Check If An Animation Of A Movieclip Is Finished (no Tween Handler)
Hi

I'm having some difficulties on checking when an animation in a movieclip is finished. It's not a tween, otherwise I could make a tween handler with the "onMotionFinished"-property. My situation is different.

My movieclip has 60 frames with each frame containing a 3D image. These 60 frames make the impression that a die is rotated in 3D.

How do I check in the actions of my scene (root) when the animation is finished?

I already tried making an interval that constantly polls if a variable "finished" is set to true (which the movieclip sets to true on its last frame).
This solution isn't really accurate enough due to the interval number.
Setting the interval to 1 millisecond won't do any good either.

Is there a listener object or something else that makes this possible?
On my last frame of the movieclip is a stop() statement which might be polled by a listener?

Thanks for your advice
Arcko D

Finish Animation And Start A New One
Hi,
I am looking for answer to my question but because I don’t really know what to call it, I can’t really find it. Does anybody know how to do this, or what to look for?

I am building portfolio of pictures and want to have each picture appear in some animated way and stop. User will click on button and picture will appear and stop. Then the user can click on any other button and the current picture will leave with some animation and new picture will appear with the “opening” animation.

The problem is that I don’t know how to make the first picture finish the animation. Obviously the easiest way would be to click on button, which would trigger “go to” and start new picture animation but I want to finish at first the first animation and somehow make sure that the first one will be finished.

Any idea?

Thanks

Emil

Button 2 Start Animation
I am using Flash 2004, and I have a image of a old fashion television. I want the television knobs to start making the antenna to move. I have everything I want the antenna to do in a movie symbol. I also have the television knob as a button. I was able to get the television knob to go to a different movie clip but is this possible? Thank you.

Having An MC Start An Animation On A Different Layer?
I have a MC that you drag and when you release the mouse it plays an animation and halfway through the animation I have some script on the frame that supposed to play an animation on a different layer but it doesnt work and I dont know why. Any Ideas?

Using Mousemove To Start Animation
Hello flash masters,

I'm just a newbie here, so please be gentle.

I have a menu that slides out when the user moves the mouse to the left of the stage. Since the menu itself has to be active (to initiate the slide) and the menu items within the menu have to be active, I have the problem of a movieClip ontop of a movie clip while trying to use an (on) event for both.

So I now have a mousemove function to start the slide animation of the menu, thus leaving me free to put (on) events on the menu items. Here it is:

onMouseMove = function () {
x_pos = this._xmouse;
y_pos = this._ymouse;
if (x_pos >= 0 && x_pos <= 200 && y_pos >= 0 && y_pos <= 768) {
mcNavBar.slideTo(90, null, 1, Strong.easeIn);
mcNavBar.mcNavBarArrowStrip.alphaTo(0, 1, Strong.easeIn);
mcNavBar.NavHLine1.slideTo(-70, null, 1, Strong.easeIn);
mcNavBar.NavHLine2.slideTo(-70, null, 1, Strong.easeIn);
mcNavBar.NavHLine3.slideTo(-70, null, 1, Strong.easeIn);
mcNavBar.NavHLine4.slideTo(-70, null, 1, Strong.easeIn);
NavG1.slideTo(23, null, 1, Strong.easeIn);
NavG2.slideTo(23, null, 1, Strong.easeIn);
NavG3.slideTo(23, null, 1, Strong.easeIn);
NavG4.slideTo(23, null, 1, Strong.easeIn);
}
else{
mcNavBar.slideTo(-70, null, 1, Strong.easeIn);
mcNavBar.mcNavBarArrowStrip.alphaTo(100, 1, Strong.easeIn);
mcNavBar.NavHLine1.slideTo(120, null, 1, Strong.easeIn);
mcNavBar.NavHLine2.slideTo(120, null, 1, Strong.easeIn);
mcNavBar.NavHLine3.slideTo(120, null, 1, Strong.easeIn);
mcNavBar.NavHLine4.slideTo(120, null, 1, Strong.easeIn);
NavG1.slideTo(-137, null, 1, Strong.easeIn);
NavG2.slideTo(-137, null, 1, Strong.easeIn);
NavG3.slideTo(-137, null, 1, Strong.easeIn);
NavG4.slideTo(-137, null, 1, Strong.easeIn);
}
};

The problem lies in the mouseMove function. It all animates fine, but if I continue to move the mouse after activating the menu, it causes the animation to lag. It only works smoothly if I move the mouse into the active area and then don't move it any further until the animation is complete.

So my real question is: How can I make the mouse call the mousemove function only once so that the animation will not be interupted everytime the position of the mouse is being calculated.

I hope this makes sense

Opening Animation Won't Start
I've been working on this for ever and haven't found a fix. Believe me I've Googled til I gagged.
It's really simple. I have a preloader that, when complete, goes to the main action script. The stage loads, all my buttons are there but the movie clip of the Home text doesn't animate onto the stage. The user must press the Home button to get the text on the page.
I really appreciate any help!







Attach Code

function animateOn(page:String) {
eval(page).gotoAndPlay("on");
}
function animateOff(page:String) {
eval(page).gotoAndPlay("off");
}
_root.onLoad = function() {
animateOn("contentHome_mc");
currentPage = "contentHome_mc";
};

mc_homeBtn.onRollOver = function() {
mc_homeBtn.gotoAndPlay("_over");
};
mc_homeBtn.onRollOut = function() {
mc_homeBtn.gotoAndPlay("_out");
};
mc_homeBtn.onRelease = function() {
if (currentPage != "contentHome_mc") {
animateOff(currentPage);
animateOn("contentHome_mc");
currentPage = "contentHome_mc";
}
};
mc_servicesBtn.onRollOver = function() {
mc_servicesBtn.gotoAndPlay("_over");
};
mc_servicesBtn.onRollOut = function() {
mc_servicesBtn.gotoAndPlay("_out");
};
mc_servicesBtn.onRelease = function() {
if (currentPage != "contentServices_mc") {
animateOff(currentPage);
animateOn("contentServices_mc");
currentPage = "contentServices_mc";
}
};
mc_linksBtn.onRollOver = function() {
mc_linksBtn.gotoAndPlay("_over");
};
mc_linksBtn.onRollOut = function() {
mc_linksBtn.gotoAndPlay("_out");
};
mc_linksBtn.onRelease = function() {
if (currentPage != "contentLinks_mc") {
animateOff(currentPage);
animateOn("contentLinks_mc");
currentPage = "contentLinks_mc";
}
};
mc_aboutBtn.onRollOver = function() {
mc_aboutBtn.gotoAndPlay("_over");
};
mc_aboutBtn.onRollOut = function() {
mc_aboutBtn.gotoAndPlay("_out");
};
mc_aboutBtn.onRelease = function() {
if (currentPage != "contentAbout_mc") {
animateOff(currentPage);
animateOn("contentAbout_mc");
currentPage = "contentAbout_mc";
}
};
mc_HUCBtn.onRollOver = function() {
mc_HUCBtn.gotoAndPlay("_over");
};
mc_HUCBtn.onRollOut = function() {
mc_HUCBtn.gotoAndPlay("_out");
};

Start Animation With A Keystroke
I have a line on a client who wants someone to create an animation that "starts with a keystroke". Info is a bit fuzzy right now, but I'm pretty sure that what he means to say is that he wants there to be an initial frame or scene and then for it to proceed, he just hits "ENTER" or whatever. I've never done anything like that before. Is it possible? And if so, can someone just give me a point in the right direction? This guy wants me on-site tomorrow, so any quick help would be much appreciated and bring glorious karma and stuff. Thanks in advance!

Automaticaly Start Animation
i would like that my animation wich i burned on cd starts automaticaly to play when i insert the cd in my pc/apple.

does anybody help me whit this?

thx

Start An Animation After Some Seconds
Hi I got a question about timing

the site i'm working on : http://www.pixelatorz.be/temp/testeke7.html

so when you click on a button i will load external swf files. Is it possible somehowe to start loading the swf's some seconds after you clicked the button, so that the swf starts playing when you actualy get to see the loaded swf.

for the sliding i have 0.5 , 1 , 1.5 seconds and so on

this is the code i use for the slidding at case stills you see me loading the swf into the movieclip , but it automaticaly starts the animation.
Code:

function SwitchPage(pageName) {
   var pageName:String;
   //de pagina naam
   var pageX = currentMc._x;
   trace("je zit in de functie switchpage");
   switch (pageName) {
   case "About" :
      trace("about started");
      currentMc.tween('_y', -650, 0.5, 'easeOutExpo', 0);
      
      trace(pageX);
      break;
   case "stills" :
      trace("stills gekozen als pagina");
      currentMc.tween('_y', -1300, 1, 'easeInOutExpo', 0);
      
      var mc:MovieClip = currentMc.currentMc3.createEmptyMovieClip("mcInhoud", this.getNextHighestDepth());
      mc.onEnterFrame = function():Void  {
      mc.loadMovie("stills.swf");
      mc._y =0;
      //trace(mc._y);
      //trace("awel de");
};
      
      trace(pageX);
      break;
   case "foto" :
      trace("foto");
      currentMc.tween('_y', -1950, 1.5, 'easeOutExpo', 0);
      
      trace(pageX);
      break;
   case "multimedia" :
      trace("MM");
      currentMc.tween('_y', -2600, 2, 'easeOutExpo', 0);
      
      trace(pageX);
      break;
   case "contact" :
      trace("contact");
      currentMc.tween('_y', -3250, 2.5, 'easeOutExpo', 0);
      
      trace(pageX);
      break;
   default :
      // statements
      break;
   }
}

Button To Start The Animation Problems..
I need help. I have an animation all worked out, and I would like to create a page at the beginning that waits for you to push a button, to start the whole thing. Can someone please give me the code that they would recommend? Thanks

Animation To Start When Drag Ends
ok, complicated one this.

say i have an object that follows the mouse with :

dot.onEnterFrame=function(){
this.startDrag(true);
}

how would i get it to animate when the user stops moving the mouse for a set number of seconds?

say its a dot... instance name dot... when the mouse stops i want the dot to start floating away, but when the user moves again, the dot snaps back to follow the mouse again...

?

Change Start Position Of An Animation
I have an animation (a single box) with 3 positions (start, middle and end position) I need to change start x and y coords but the last position must be always the same. I use object._x=150 and it stop the animation. With object.move(150,150) it doesn't work. Anyone can help me?

White Flash At Start Of Animation?
I Have created 2 different flash slideshow animations and each have a white box that is visible before just before the animation begins. This would be fine if the background were white, but of course its black and very noticeable. Anyone have a clue how to fix it so that doesn't happen?

Move Imagine To Start An Animation
Hello to all!


I have a Flash file with a picture in it.
Does anyone know how be able to move that picture around in the window, in the swf file, and when I place it in a specific place an animation to start?

I'm a begginer in ActionScript. Can someone atleast tell me if is possible to do this with ActionScript or with JavaScript or with what? Thanks!

Animation Doesn't Start On Safari / Mac
Hi, I've done a simple intro animation with flash mx 2004, and published it for flash 6 player. It seems to work fine on ie and mozilla based browsers. When you open it in Safari, it plays normally, but once it is in the navigator's cache, it won't start anymore. This really eludes me.

the animation is here: http://www.itinerairebaroque.com/intro.html

Try to play it twice on Safari...

The html code used to embed the animation is the standard one:


Code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="780" height="550" id="intro" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="intro.swf" />
<param name="play" value="true" />
<param name="loop" value="false" />
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<embed src="intro.swf" play="true" loop="false" menu="false" quality="high" bgcolor="#000000" width="780" height="550" name="intro" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

Could it be because of my animation loader? it is achieved by this simple code on the first frame:


Code:
stop();
this.onEnterFrame = function(){
if(_root.getBytesLoaded()==_root.getBytesTotal()){
if(loading._alpha==0){
play();
}
}
}
Any idea? thanks!

Button Click; Start Animation
I have a button, in which it animates in the 'Over' state.

I want to click the button and an animation (array of objects (later buttons) casscade down the right hand side, nothing to do with the initial button) starts.

Do I,

a) Place the separate animation in the 'hit' state of the button (That doesnt work as the animation cant be moved very far away)

b) Write some Actionscript to 'Go to' somewhere. (Can you tell it to go to a layer or just a frame?)

Im sure this is basic stuff but Im a bit of a novice, I bet there is an easy solution...always is.

Thank you

How To Use The Click Of A Mouse To Start Animation?
Hi guys,
I'm new at using Macromedia Flash 8 and want to know how can i set an animation to only start when i click the mouse?
Thanks in advance,
Ganman

To Not Reload From Start Flash Animation On Web Page
Hi,

I've done a nice flash animation which is in fact an ad banner.
This banner should be displayed on my customer website in each pages.

However, in order to be sure that customers of my client will see the
whole flash animation, i would like to be sure that it's not reloaded
from the first frame.

is there something like a frames counter which can be memorized by PHP
pages server ?

i mean on page welcome.php, my banner will be displayed.
let's say that after few seconds (35 frames for example), the customer
click on a link "prices.php".
on this prices.php page my ad banner is once again displayed, but i
would like to make sure it starts from frame 36 for example, and not
from frame 1.

how can i do that ?

thanks a lot,

RAF

How To Start A Flash Animation From An HTML Link?
Hi

I have imported a Flash animation into an ordinary HTML page - let's call it myflashproject.swf. So far so good.

I have disabled autoplay, because what I want to do is have an html link that says something like "Click here to play the animation". When that link is clicked, the myflashproject.swf file will start playing.

As a bonus, I would like the animation to stop when that link is clicked again. If that is not possible, then perhaps a diffent link to stop the animation.

Any help would be really appreciated. Pleae be aware that I am a scripting idiot and tend to use WYSIWYG tools most of the time.

Many thanks.

How To Start Animation When User Clicks Shape? (Newbee)
Hello!

How can I start a spezific animation when the user clicks a shape? I'm think of making something like

http://euromusics.argetech.com/jer/sexymenu.html

Any help that points me in the right direction is welcome.

Martho

How To Start To Play Sound On The Browser As Soon My Animation Starts?
I am using FlashMx newely.
I have attached a flash movie to my HTML file along with sound.It takes time to load the movie into the browser.
The problem is that the sound is finished before the movie appears on the browser.But I want to start to play the sound as soon as my animation starts on the browser.
If ActionScript is required to solve this problem please send the neccessary codes.
Please help me to come out from this problem.

SetInterval Or GetTimer (how Can I Set The Start Time To My Small Animation?
I have this code that fades out at 3 seconds.. how can I control when it starts to fade in? Right now it just fades in instantly. For example I want it to wait 3 seconds before it fades in.. and then as it currently is.. fades out after 3 seconds.

I put a setInterval in the code but it still starts automatically and not by the timer. can anyone tell me what Im doing wrong with this?


PHP Code:



function fadeIntroIn():Void {    nTimes++;    if(nTimes <= 2)    {clearInterval(nInterval);    }        var yTween:Tween = new Tween(mcIntroducingCopy,"_y",Regular.easeIn,454,474,20);    var alphaTween:Tween = new Tween(mcIntroducingCopy,"_alpha",Regular.easeIn,0,100,20);    yTween.onMotionFinished = function() {        setTimeout(fadeIntroOut,30000);    }}var nTimes:Number = 0;var nInterval:Number = setInterval(fadeIntroIn, 50000);function fadeIntroOut():Void {    var yTween:Tween = new Tween(mcIntroducingCopy,"_y",Regular.easeIn,474,454,20);    var alphaTween:Tween = new Tween(mcIntroducingCopy,"_alpha",Regular.easeIn,100,0,20);    alphaTween.onMotionFinished = function() {        mcIntroducingCopy._visible = false;    }}fadeIntroIn();

Text Animation Works On A Mac, Requires Refresh To Start On A PC
Okay, I've worked up a dynamic animation which will eventually be loading stuff dynamically from a server:

Unfortunately, the text only animates automatically on a Mac (in either Safari or Opera), after a reload (on a Mac or PC in Firefox) or intermittently after a compleat reload (on a PC running IE <v8) --- it works in IE v8 on a PC.

I'd thought the animation code was pretty straightforward and can't see it being the problem since it works everywhere eventually.

Is there some secret to ensuring that all of the animation begins?

William

Looking For A Code To Make The Flash Animation Start At A Random Key Frame
I have a image slideshow set up on a time line. Each image is on a different layer and I am looking for a code to make the flash animation start at a random key frame every time the page is loaded. Here is a link to the site I am working on:

https://jag-designs.sslpowered.com/u...ood/index.html


Thanks for your help!

Press "A" On Keyboard To Start Animation .. Help Needed
hi all, what i am trying to do is assign actions to different letters on the keyboard...
e.g when the letter A is pressed the apple will animate. when B is pressed something else will animate etc...

I am using cs3 with as3

I know how to do this with a mouseclick:
-----------------------------------------------------------------------

apple.stop();
function playAnimation(event:MouseEvent):void{
apple.play();
}
apple.addEventListener(MouseEvent.CLICK,playAnimat ion);


-----------------------------------------------------------------------

but how do i apply it to the keyboard?
keypress or keyrelease? or something else?
ive tried searching in the help of flash, (someone told me to search for "key" but i m still lost.


ive tried this as well:
-----------------------------------------------------------------------
apple.stop();

function playAnimation(event:MouseEvent):void{

apple.addEventListener(KeyboardEvent.KEY_DOWN,keyD ownHandler);
apple.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);


apple.play();
}
apple.addEventListener(KeyboardEvent.KEY_DOWN,keyD ownHandler);

-----------------------------------------------------------------------


ive tried searching the forums for a similar topic, but i find that they dont quite apply to mine... or may just be making the wrong changes to other peoples codes?

any idea?

thanku in advance

Press "A" On Keyboard To Start Animation.. Help...
hi all, what i am trying to do is assign actions to different letters on the keyboard... e.g when the letter A is pressed the apple will animate. when B is pressed something else will animate etc...

I am using flash cs3 with as3

I know how to do this with a mouseclick:

-----------------------------------------------------------------------

apple.stop(); //stops animation playing before mouse click
function playAnimation(event:MouseEvent):void{
apple.play();
}
apple.addEventListener(MouseEvent.CLICK,playAnimat ion);
//play apple on click

-----------------------------------------------------------------------

how do i apply it to the keyboard?
keypress or keyrelease?

thanks in advance!

Rewind, Pause, And Start Start Buttons For Base Movie And External Mov

I'm lost...

I have a base movie that contains three buttons (Rewind, Pause, and Start)

The code for the rewind button that sends the base movie to frame 2 which is set to play and then reloads the external movie (images/4_24.swf). works perfectly and is shown below.

on (release) {
gotoAndPlay(2);
}
on (release){
    function test(){
    _root.createEmptyMovieClip("container",25);
    loadMovie("images/4_24.swf", "container");
    container._x=15;
    container._y = 95;
}
test();}


My question is does any one know how to now pause both the base and external movie with the pause button and then start both movies again with the start button????  Some how I need to control both movies with these three buttons.

Code for play button is ---  
on (release) {
play();
}

Code for pause button is ---  
on (release) {
stop();
}


Thank you MJR


Start And Stop Streaming Sounds (start Stopping Currently Playing)
Hi there

I am novice user of flash and have no real AS experience.

What I want to do is..

I have 18 songs from an album and have taken 30 sec from each and down sampled them ready for flash.

I want to be able preview them all from one flash file.
I will be streaming the songs in, so the initial download time is minimal.

With 18 start stop buttons for each one, but because customers are lazy, they are likely just going to click the next play button for the next preview, so I need the play buttons to stop 'this' preview before playing the next with stop control also being a stop control for those who have had enough or are well behaved browsers : )

I hope this makes sense and look forward to hearing from someone.

Cheers

Ian Hill

Start And Stop Streaming Sounds (start Stopping Currently Playing)
Hi there

I am novice user of flash and have no real AS experience.

What I want to do is..

I have 18 songs from an album and have taken 30 sec from each and down sampled them ready for flash.

I want to be able preview them all from one flash file.
I will be streaming the songs in, so the initial download time is minimal.

With 18 start stop buttons for each one, but because customers are lazy, they are likely just going to click the next play button for the next preview, so I need the play buttons to stop 'this' preview before playing the next with stop control also being a stop control for those who have had enough or are well behaved browsers : )

I hope this makes sense and look forward to hearing from someone.

Cheers

Ian Hill

How To Delay The Start Of External Swf(start From Say 10th Frame)
I am using the following code to load an external swf.Now I need to start the playing of the swf movie not from frame 1 but from say 10th frame.
Please help

Code:
var myMcl:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();

myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes, totalBytes) {
//swfToLoad._visible = false;
loadedPercent = Math.floor((loadedBytes/totalBytes)*100);
_root.bar_mc._xscale = loadedPercent;
//trace(bar_mc._xscale);
c.text = loadedPercent+"%";
//trace(loadAnim.percLoaded.text);
spacer.loadMovie("images/loadingss.jpg");




};

myListener.onLoadComplete = function(targetMC:MovieClip) {

swfToLoad._visible = true;
loadAnim._visible = false;
//swfToLoad._width=367;
//swfToLoad._height=255;
}

myMcl.addListener(myListener);
myMcl.loadClip("Jason_500.swf",swfToLoad);

How Can I Start An External Program And/or Start A File
I've tryed:

on (release) {
fscommand("Exec", "program.exe");
stop();
}


Also I've tryed:

on (release) {
fscommand("Exec", "start.bat");
stop();
}

And in the .bat file I've put this:

@echo off
start file.doc
exit

But this does not seem to work, what Am I doing wrong???

Thanx alot!

FLV Start Time? Can I Start It Playing 2 Secs In?
Is there a way with actionscript to tell an FLV to start playing 2 seconds into the video. What I have is an FLV that has 2 seconds of black at the beginning, but I don't want that to play.

Or if anyone knows a way to re-encode an flv so that I can get rid of the 1st 2 seconds. I've tried re-encoding it with Riva Encoder but it just gets all screwed up. And the Flash encoder won't even let me add it to the que. Any help would be appreciated.

Thanks,
Lady

Sound Start Doesn't Start
I've been experiencing this problem. Sound.start() doesn't always start. A lot of times, it does, sometimes, it doesn't start for me. Sometimes it happens even after sound load has just finished. Has anyone experienced the same? any suggestions?





























Edited: 08/24/2007 at 01:26:57 AM by nehcdet

How To Tell When Something Has Finished?
Hi

Got a problem that is driving me mad and is probably due to my limited knowledge of AS - I need a sort of listening device methinks......

I have an array of words, I pick the next word in the array when a button is pressed and split it into letters that then tell a fruit machine type display to scroll to each letter from a fixed alphabet scroll, what I want to do is to display the possible definitions by calling the do_answers(word); function for this word AFTER the last letter has slotted into place and the word is complete. As it is an alphabet scroll (from z-a) then inevitably this letter is the closest to 'a' no matter what position in the word it is.

Each letter scroller is a movieclip named l1,l2 etc up to l17, 17 being the length of the longest word in the array.

My current main timeline code reads (only 2 words for simplicity here and lots of other little bits cut out) with reset() being called on 'next' button pressing:


Code:
codewords=new Array("FIRST WORD","SECOND WORD");
_global.count=0;
function reset(){
for(i=0;i<17;i++){
_root["l"+i].gotoAndStop(1);
}
if(_root.codewords.length>_global.count){
do_word(_root.codewords[_global.count]);
} else {
do_word("GAME OVER");
}
}
function do_word(word){
wordSplit=word.split("");
for(ch in wordSplit){
//now set the letter this letterbox will stop at
_root["l"+ch].letter=wordSplit[ch];
//now start this letterbox scrolling from frame 2
_root["l"+ch].gotoAndPlay(2);
}
_global.count++;
do_answers(word);
}
function do_answers(ansframe){
_root.answers.gotoAndPlay(ansframe);
}
As you can see the do_answers() call is made after the last letter is set off to do it's scrolling BUT the actual scrolling takes longer than the time the function moves onto the call and the answer options are displayed.

How can I do this anyone?

Thanks

Ali

Tell If MC Has Finished
How can you tell if an MC has finished playing before you load another?

When An FLV Has Finished...
Long story short, I HAVE to use the FLVPlayback for my videos to play.. please don't ask why LOL long story..

but when I'm trying to do is find something that will let me know when the FLV has reached its end... is there a way? can't seem to find it.

Copyright © 2005-08 www.BigResource.com, All rights reserved