ActionScript 3.0 :: Playing A Movie Clip From A Function In Main Class?

Jan 1, 2012

I have a timer which times how long the game takes and I made a highscore function: if highscore < timer - newhighscore(); This all works fine. My problem is that I want to have the words "Your highscore" flash up on the screen if a highscore has been acheived or to just stay still if a highscore has not been achieved.

ActionScript Code:
private function getScore() {
trace(timer);

[code]...

I have text on my game over screen saying "Your highscore:" I exported them to a movieclip where they turn red and get bigger, the smaller. Frame 1 is plain stop(); Frame 2 to the last frame and the animation Last frame gotoAndPlay(2); These words will normally be plain but I want to be able to, from the newhighscore() function, play the animation for the MovieClip.

View 0 Replies


Similar Posts:


ActionScript 3.0 :: Flash - Play Movie Clip With The Button Click Without Playing All The Movie Clips On The Main Timeline

Apr 26, 2009

I'm trying to make a flash website that has clickable buttons that will play different movie clips. But I dont know how to make it to just play the movie clip with the button you click without playing all the movie clips on the main timeline.

View 1 Replies

ActionScript 1/2 :: Play Main Timeline After A Movie Clip Is Finished Playing?

Jul 10, 2009

The movie clip is an actionscript movie which calls images from an external XML file and shows them as a slideshow. What i need to do is after the last image plays, stop the movie and move the main timeline to the next scene of the main movie. Everything logical in my brain is not working, and it may be that I have been staring at this project for too long but for the life of me i can't make this work.

View 11 Replies

ActionScript 3.0 :: Calling A Class Function From The Timeline Of A Nested Movie Clip?

Aug 26, 2010

I'm trying to call a function called checkForHit() located inside of my Hero class at a particular frame of an attack animation of my Hero object. Meaning, when his weapon is at the point in the animation where it could collide with any enemies, I want to call the function that performs the check.My Hero Movie Clip is set up where it contains a Movie Clip on different frames that coorespond to the different animations (attacks, movements, etc). So the Hero MC contains a bunch of other MCs. That way I can just use hero.gotoAndStop("attack1");

The problem that I'm having is that the code that I wrote to call the checkForHit() function is written on one of the frame of the nested MC's timeline, and it's not being recognized. In fact, even if I put a trace("HELLO") on any of the frames on the nested MC, it's not being output. I even tried to put something that I know should cause an error on one of the frames, and it ran without throwing an error. It's almost like the code on the timeline isn't being compiled, or it's being skipped over somehow.

View 1 Replies

ActionScript 3.0 :: Movie Clip On Main Timeline Receiving Input From Nested Movie Clip

Feb 23, 2011

I've got a main timeline .swf file called "blank.swf" which contains nothing but two blank movie clips one called called "pproduct", the other called "ppalette". In the script frame of this main timeline I use the simple "Loader = new Loader();" method to load a URL of an .swf file into the "ppalette" movie clip. The "ppalette" movie clip contains several color chip buttons, each of which use the same Loader method above to load an external .swf into a clip. Here's what I want to do: let those color chip buttons, when the "blank.swf" file loads, be used to load an .swf movie into the "pproduct" clip on the main timeline. I'm wanting to be able to swap depths with various movie clips which will take out the movie which has the palette, but I want whatever that palette has loaded in the original "pproduct" clip to stay there.

[Code]...

View 3 Replies

ActionScript 3.0 :: Delete A Variable Containing A Movie Clip Class And Recreate It With A Different Movie Clip Class?

Jul 1, 2009

In my project are pages of text with each word having a button that when pressed will display a movieclip presentation about that word (its pronounciation and spelling etc..). In the project I am working on now I have over 450 unique presentations of words to deal with. I don't want to have all of these hundreds of movie clips on the stage and tell them one at a time to stop and rewind and then have one play each time a word button is pressed. That seems to be very inefficient to me.

add movieclips to the stage using addChild(movieclipname) and remove them using removeChild(movieclipname) but there is a problem. I have hundreds of unique movieclips and I don't want to have to manage hundreds of variables containing the indivudual movieclip instancess. It is a real pain having to figure out what instance is still on the stage before i delete it.In Adobe Director all I have to do is this:

View 5 Replies

Get A Movie Clip To Automatically Load Up Another External Clip After Playing An Embedded Flv?

May 24, 2010

I'm trying to get a movie clip to automatically load up another external clip, after playing an embedded flv.

This is what I've tried so far:

var holdFrame = setInterval( holdFrame, 5000);
gotoAndPlay(
_root.mc_holder.loadMovie("swf/library.swf"));
clearInterval (holdFrame);

Although it throws no errors, the setInterval is ignored and it just loads direct into the next mc clip.

View 9 Replies

ActionScript 3.0 :: Calling A Function Located On The Main Class From A Sub Class?

Nov 21, 2009

I'm not sure that I'm on the right track here. I've got what is essentially a 'gateway' movieclip and depending on the CLICK a corresponding movieclip (form) is loaded -- these all being in their own AS file. There are multiple corresponding pages that will all load/close in their own fashion but the 'gateway' will reload in it's own function-- consequently, I have this function on the main_AS.  Can I trigger this function from the sub class or do I need to move the 'reload' function to a 'reload' class.

View 2 Replies

Flash - Listener In Main Document Class For Custom Dispatch Event From Another Class Does Not Respond Or Call Function?

Apr 1, 2011

I have a document class called Main.as In the class constructor I have the following listener:

enter code here
var listeningFORModeChangeToStudent:Sprite = new Sprite;
listeningFORModeChangeToStudent.addEventListener(TellAllModeChangeToStudent.STUDENT,exp);
addChild(listeningFORModeChangeToStudent);

[code]....

In a third class I make a call to the despatcher in the previous class:

enter code here
var ThisTellAllModeChangeToStudent:TellAllModeChangeToStudent = new TellAllModeChangeToStudent;
ThisTellAllModeChangeToStudent.tellAllModeChangeToStudent();

I have trace statements in eveything and from this I know the despatcher in TellAllModeChangeToStudent is being called.The problem is that the listener in the main.as is not calling the function exp.I cant see why and I dont know how to check if the listener is actually seeing the dispatch event?

View 1 Replies

ActionScript 3.0 :: Access Function At Main Class From A Sub Class?

Mar 3, 2011

My first experience is build an aquarium with a lot of fish swimming, and they can be clicked. When one of them is clicked we should receive a trace message saying ("I�m a Fish!"). To do this, I thought that the best way will be:

1- create a document class, named Main.as

2- create a base class, named Clicked.as

2- create a movie clip with a fish.

3- export the movieclip to actionscript. In the mc properties set Class as "fish" and Base Class as "Clicked".

View 6 Replies

ActionScript 3.0 :: Access A Function In The Main Class From Another Class?

Mar 1, 2010

i have a game that i want to put load screen on, which i created a separate class for. first the main class is initialized and in the constructor function, it does an addChild(loadScreen) which places an instance of the loadScreen MC on the stage. within the loadScreen is a "Play Button" that when a user presses this button i want it to continue startGame in the Main class. the way i tried it was Main.startGame from the loadScreen class, but that obviously does not work. is it possible to call a function from a different class.i have three files:

Main.fla
Main.as
loadScreen.as

the Main.as file:

Code:
package
{
import flash.text.*;
import flash.display.*;

[code]....

View 3 Replies

ActionScript 2.0 :: Targetting A Movie Clip - Loaded Into A Container Clip From Main Timeline

Nov 24, 2005

I am targeting a a movie clip. The problem is that all the syntax I have found for targetting clips looks like this: _root.sample_mc.sample2.mc. etc. The problem is, my target clip is in an swf that I've loaded into a container clip from my main timeline. So, essentially, I have a home.swf that loads menu.swf into a container called 'location'. In menu.swf, I have an MC called center, which contains the MC I am targetting called 'target'.

View 2 Replies

Playing Movie Clips Inside Main Timeline?

Oct 16, 2010

I've created six movie clips of cursive text effect using masking for the animation. Each clip is approximately 160 frames long. I need to play these sequentially, one after the other, when the page loads. structure multiple clips to play after each other?

View 3 Replies

ActionScript 2.0 :: Playing Movie On Main Stage After Certain Frame In MC

May 6, 2008

I have a moviclip on the main stage with a stop action on the frame above. I want the movie to play ahead from that frame on the main stage after a certain frame is reached in the movieclip.

I tried using this simple function on the main stage;
if (_root.myMovieclip.signal._x = 100){
gotoAndPlay(win);
}

So when signal._x moves to 100 in the movieclip, the frame jumps to "win". However this doesn't work. I tried using a timer on the frame as well but it does not provide an accurate enough response.

View 7 Replies

ActionScript 3.0 :: Playing Random Movie Clips On Main Timeline?

Feb 18, 2009

boards and even newer to ActionScripting and FlashWhat I would like to do is play random movie clips on my main timeline. I've tried using the below code, but it does not work:

Code:
var movieList:Array = new Array(mc1, mc2);
var i:int = Math.round(Math.random() * movieList.length);

[code]....

View 1 Replies

Professional :: Playing Multiple Movie Clips One After Other On Main Timeline?

Apr 23, 2010

Excuse the probably simple question but I'm just starting off with Flash.I have imported a few video trailers directly into flash and saved them as movie clips. I want to be able to insert these movie clips onto the main timeline and play them one after the other, repeating once they have all played. On the main timeline I have set a layer for each clip and a keyframe where the clip is inserted for each layer. When I go to play the flash file, it is showing the first frame from each movie file and then moving to the first frame of the next movie file. What do I need to do to make flash play the entire movie file in that specific frame before moving to the next frame where the next movie file is and playing all that movie?

View 7 Replies

ActionScript 3.0 :: Playing Random Movie Clips On Main Timeline

Feb 18, 2009

What I would like to do is play random movie clips on my main timeline. I've tried using the below code, but it does not work:

[Code]...

I've got them on a layer named "BG" and each movie clip is in a key frame. The ActionScript is on a seperate layer named "AS".

View 1 Replies

Actionscript 3.0 :: Cannot Get The Main Movie (mainVidMC.mainVid) To Start Playing Again

Feb 16, 2009

I cannot get the main movie (mainVidMC.mainVid) to start playing again once the KirshLearnMore1_F8_Lg_001.flv has finished playing. It throws an error:

[Code]...

View 2 Replies

ActionScript 3.0 :: Affect Both A Movie Clip And Its Child Movie Clip In The Same Function?

Dec 19, 2009

I really have two questions: How do I affect both a movie clip and its child movie clip in the same function? and how do I pull info from one component into a function for another? My basic setup is a movie clip of font choices, one on each frame: "bodyText_mc." Each of these frames has a child clip "bodyText_mc.bodyText" with alignment choices for the font. For instance, the user picks "Script" in the first ComboBox and then picks "Align Right" in the second. (All of this text is static because I need more design control that I can get with dynamic text.)

First of all, I have a combobox "cbBodyFont" that I use to go from frame to frame on movieclip "bodyText_mc." This works nicely:

[Code]...

View 8 Replies

ActionScript 2.0 :: Apply A Function To A Movie Clip Inside A Movie Clip?

Aug 22, 2009

The question is, How do you apply a function to a movie clip inside a movie clip inside a movie clip. So there are three mc and I need to apply the function to the inner most one.

Here is what I have. The 'a' is in 'spin_4' wich needs to be in 'portal'.

ActionScript Code:
for(var i = 1; i<=12; i++){
this.spin_4['a_'+i].onEnterFrame = function(){
if(this.hitTest(_level0.man)){

[Code]....

View 9 Replies

ActionScript 3.0 :: Make Main Movie Resume Playing After An External SWF Closes?

Dec 18, 2009

What I am trying to accomplish here is to have my main movie resume playing when an external movie is closed. I.E. How can I make my main know that the external movie is closed and to "re activate certain functions" and to resume playing?

Oh, not too sure if this is needed, but I am loading the external movie with an external preloader that loads the movie. The main movie loads, and external preloader, which actually loads the external movie. Again not sure if this effects anything.

View 9 Replies

ActionScript 2.0 :: Fade In White Movie Clip Over Main Movie When A Button Is Pressed?

Aug 30, 2006

I am looking for a way to fade in a white movie clip over my main movie when a button is pressed.

(i.e. When you press a button, a white rectangle will fade in over all other layers and then fade out after a couple of seconds. This is to make it look like the different pages are fading in and out without having to build the transition over and over again.)

View 8 Replies

Actionscript :: Play Movie Clip, Have It Wait Until End Of Main Movie Then Restart

Nov 17, 2011

I have a flash banner that includes a movie clip of the logo being animated. I want the logo animation to only run at the beginning of the main "movie". Currently I have to find the length of the entire movie (for ex. 500 frames) then put a key frame in at the 500th frame of the logo movie clip. I know there has to be a correct way to do this...Do I add a frame name at the end of the main timeline and somehow in AS in the logo movie clip say "when you reach X goToAndPlay(1);"?

View 1 Replies

ActionScript 2.0 :: Continuous Play Of Several Movie Clips From One Main Movie Clip?

Jun 20, 2006

i'm trying to play several movie clips, one after the other from one main movie clip.i've got 8 movie clips, "m1.swf", "m2.swf", etc. "m8.swf", and one main movie clip, "play.swf".i've tried using loadMovie, but it only plays the last movie clip. this is what i've got. in the main movie clip, i've put a play button, and the actionscript i have in the button is:

on(release)
{
this.loadMovie("m1.swf",play);
//this.unloadMovie("m1.swf");[code]....

is this wrong? how can i get this to work correctly.

View 4 Replies

ActionScript 2.0 :: Activating The External .swf Into A Blank Movie Clip In The Main Movie?

Oct 10, 2002

I'm still a rookie in flash and I'm having a little bit of trouble with some actionscript. I've gotten as far as placing the buttons and assign the correct actionscript for them to work. Everything is working fine with the buttons activating the external .swf into a blank movie clip in the main movie. Ony thing is, I would like the external movie assigned to the first button to open once the movie is loaded.

I thought by using the same actionscript i used on the button {and removing the on(release) tag} and placing on the first frame of the main movie would help, but it doesn't.

View 2 Replies

ActionScript 3.0 :: Play Movie Clips Embedded Inside A Movie Clip On The Main Timeline?

Dec 6, 2009

I have my flash document set up in the following way: On the main timeline I have my buttons that I want to play movie clips embedded inside a movie clip on the main timeline.However, when I click each different button, the current movie clip stops playing and then the movie clip corresponding to the button plays.

I want them all to be able to play at once. So for example you push button 1 and the alien plays, but half way through you could click button 2 and the alien clip would keep playing, but also the helicopter clip would begin to play as well.Here is the code I have so far:

building_btn1.addEventListener(MouseEvent.CLICK, alien);
building_btn2.addEventListener(MouseEvent.CLICK, helicopter);
function helicopter(e:MouseEvent):void {[code]......

View 1 Replies

ActionScript 2.0 :: Removing Movie Clip From The Main Movie?

Feb 24, 2003

How do I remove a movie clip from the main movie?I've tried setting the alpha,but technically it is still there.Removing and deleting movie clip only works if the movie clip is duplicated and I don't want the movie clip duplicated.

View 1 Replies

ActionScript 2.0 :: Controlling Main Movie From Movie Clip

Jun 16, 2005

I have instances in my movie layed out as such

_root contains
[sliderX] which contains
[holder]

Where X is a number from 1-500 inside [holder] is a button that when pressed should load an image into new browser (does this fine) then move the main movie to it's next scene. this is when it fails. I have tried

[Code]...

View 1 Replies

[AS3] Playing A Movie Clip?

Jun 5, 2009

I have the code below and I can't seem to get the Movie Clip mcBox to play.

The movie click is on the same layer as the Map Buttons that have a linkage to class MapButton.

It's this line that is the problem but I can't figure out what it is.

[Code]...

View 3 Replies

Call Function In Main Doc Class From External SWF?

Jul 9, 2009

I have a main.swf that loads in an external swf called home.swf. I want to be able to call a function in main.swf's doc class from the loaded swf:

Code:

function loadArtist():void { // my function }

in the main timeline of home.swf I'm calling it this way:

Code:

function timeToGo(m:MouseEvent):void {
trace("button pressed");
MovieClip(this.parent.parent).loadArtist(); }

the home.swf compiles fine but when loaded in the main.swf & the button is pressed i get this error:

TypeError: Error #1006: loadArtist is not a function.
at home_fla::MainTimeline/timeToGo()

It seems that it thinks loadArtist is a property. Ack. I've got 3 objects loaded dynamically using addChildAt(mc, 0) ...

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved