ActionScript 3.0 :: GotoAndPlay From A Class?

Apr 17, 2010

I�m trying to write a class file that listens for a mouse click on a tab menu then opens the corresponding page by jumping to a certain frame using gotoAndPlay().

When I run it Flash gives me the following 2 warnings:

1180: Call to a possibly undefined method gotoAndPlay.

Warning: 1060: Migration issue: The method gotoAndPlay is no longer supported. For more information, see MovieClip.gotoAndPlay()..

[Code]....

Im pretty sure it�s something to do with my class extending SimpleButton but then trying to use gotoAndPlay which is a MovieClip action. Do I have to make a separate MovieClip class and somehow link it to this? Or can I add some more code to this to get it to work?

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Doing GotoAndPlay From A Sub Class Not Doing Anyting

Mar 17, 2009

So in my document class, I'm doing import Enemy;. This Enemy class extends MovieClip and takes MCs from the library in flash by doing new Enemy1();. This MC in Flash has a timeline with stop();on the first frame. In my Enemy class, I want to tell it to gotoAndPlay(2), so I'm doing that with this. gotoAndPlay(2);, but it won't play. It just stays on the first frame. What am I missing to make this work?

View 6 Replies

ActionScript 3.0 :: GotoAndPlay From Class File?

Jul 29, 2011

yFlexFlashApps tyvm I am having an issue I have a class file which extends MovieClip. It is a timer to call movie clips in the main timeline at a set interval. Only problem is when its supposed to gotoAndPlay it gives me
ActionScript

Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at alerts/secondsListener()

[code].......

View 5 Replies

ActionScript 3.0 :: GotoAndPlay From Button Class?

Mar 14, 2012

I need some assistance with making this button class file go to a frame label in the FLA. This is new for me so bare with me, but my goal is to have complete external control over creating buttons and adding new ones as they will change frequently. [code]...

View 6 Replies

Professional :: GotoAndPlay Nested Movie Clip In Class?

Dec 26, 2010

I have a class controlling all my targets, I want to play a death scene for each target when they get shot. My targets involve several nested movie clips, I want to put the death scene on the second level of my targets nested clipsWhat code do I use to tell flash to go to the second level in my targets and play there?Here is my class code in it's entirety. I have highlighted the part thats currently playing my targets.

package {import flash.display.MovieClip;import flash.events.Event;import flash.events.MouseEvent;import flash.media.Sound;
public class SquaresClass extends MovieClip {function SquaresClass()

[code].....

View 3 Replies

ActionScript 2.0 :: GotoAndPlay Scene After Tween Class Finish?

Jun 2, 2008

I have spent many hours trying to nut this one out.. I have an animated button which I am animating using a tween class. It works fine, my problem is this, I need to jump to another Scene after the animation has finished.

View 7 Replies

ActionScript 2.0 :: Tween Class - GotoAndPlay Function Not Working

Mar 12, 2010

I'm a bit rusty in flash.
import mx.transitions.Tween;
import mx.transitions.easing.*;
var mytween:Tween = new Tween(ball_mc,"_x",Strong.easeInOut,-320.10,47.90,5,true);
mytween.onMotionFinished = function() {
var mytween2:Tween = new Tween(ball_mc,"_x",Strong.easeInOut,47.90,-320.10,5,true);
} mytween2.onMotionFinished = function() {
gotoAndPlay(2);
}
It does the first and second tween but doesn't do the gotoAndPlay function?

View 6 Replies

ActionScript 3.0 :: Creating A GotoAndPlay Function On A Button In A Document Class?

Oct 27, 2011

I got a simple block of code that stops the main timeline on a certain frame, but so far I've been unable to form a code that would gotoAndPlay when mouse click happens on a button I made, and mind you I'm doing this in a document class. I've heard different instructions how to make the button, some say make it a movieclip, some say nest it in a movieclip

View 6 Replies

Actionscript 3.0 :: Call A Movieclip Using The String Class Together With It's Instance Name To Use GotoAndPlay() Method

Sep 20, 2009

I just want to ask if is it possible to call a movieclip using the String Class together with it's instance name to use gotoAndPlay() method. I know how to use the instance name and the method but then what if I want to use a string together with the instance name and the gotoAndPlay.

View 1 Replies

ActionScript 2.0 :: Goto And Play Scene - _root.gotoandplay And Even Scene1.gotoandplay Won't Work?

Nov 9, 2007

For some reason i'm having problems swapping scenes in my flash movie. At first i put the action in a "actions" named layer and a link to a button. So basicly when scene1 loads the frame 1 action is "stop ();". The viewer clicks on button1 which has a code of;

[Code]...

View 1 Replies

Gotoandplay Getting Complicated?

Mar 9, 2010

basically i'm trying to get something like this;

Code:
on (release) {
gotoAndPlay(1-30);

[code]....

View 1 Replies

Flash 8 - GotoAndPlay One After Another

Mar 11, 2010

I am currently creating a project in flash. Basically I have nearly a hundred frames. I want my next button to play scene 90 to 100 and then play 60-80 after the previous one has finished. I have already put action script in the top layer to make sure it will stop at 100 and stop at 80 but i cant get them to play after each other. I haven't a clue of what function to use only go to and play but then they would play at the same time right?

View 2 Replies

IDE :: GotoAndPlay Mc In A Loop?

Jun 21, 2009

How can I get a movie clip to play when pressing the right arrow key? The movie clip is called helicopter and it has stop(); on its first frame (with an animation following).

Here is the loop that tells the arrow keys what to do when pressed:

public function loop(e:Event) : void
{
vy += gravity;
y += vy;

[Code]....

View 5 Replies

IDE :: GotoAndPlay A Frame In An MC, Within A Swf Within A Swf?

Oct 22, 2009

hen you click on a button within my swf it loads an external swf into an MC that sits on top of the 1st swf, which continues to play underneath.Within swf2 I have lots of pages that you can navigate to, which works fine on its own, but not when I try to play it through swf1.When I click on any of the navigation buttons they don't work.I've tried making an MC within swf2, putting all the pages in there and on the navigation buttons doing:

on(release){
_root.swf2MC.gotoAndPlay("frame");
}

[code]....

View 2 Replies

ActionScript 2.0 :: GotoAndPlay Sometimes And Not Sometimes?

Feb 28, 2005

I am trying to perform a simple jump on a button with this basic code,

on(release) {
gotoAndPlay("ToMain");
}

This works most of the time. Other times it simply skips the jump and continues on. This jump is aimed to skip over an intro (so heavy image transitions with music and commentaries added). I am guessing the intense cpu processing is the cause of the skip. Is there a sure way of performing this jump?

View 3 Replies

ActionScript 2.0 :: CS3 GotoAndPlay Not Working

Apr 22, 2009

On the same frame, I have two buttons - one with alpha transparency above an image, and one regular one. Both have the " on (release) { gotoAndPlay (2) ; }" code. The transparent one doesn't work, but the other one does.

View 2 Replies

ActionScript 3.0 :: How To GotoAndPlay Another Movieclip

Sep 27, 2009

im using as3 to make buttons, and basically when you click on something, all other tabs close, i can not get this to work....

invisible.addEventListener(MouseEvent.CLICK, fn_tab3_1); // invisible is the invisible button, mouse move in this area triggering this event//
function fn_tab3_1(event:MouseEvent){

[code]....

View 2 Replies

ActionScript 2.0 :: GotoAndPlay Action In MC Being Ignored?

Feb 4, 2010

I've got a movie clip and at the final frame of the clip, I have an action to make it go back but to a frame label and I've tried a number of different versions of the GotoAndPlay action and none work. They're all being ignored and I don't get it. Here's what I've tried:

this.gotoAndPlay("32");
this.gotoAndPlay("start");
gotoAndPlay(32);
gotoAndPlay("start");

View 1 Replies

ActionScript 3.0 :: Using GotoAndPlay Then NavigateToURL?

Feb 14, 2009

I'm having problems with my animation getting cut of by my navigateToURL code. What is supposed to happen is,If you click on "buttonBtn" it triggers a animation. At the end of the animation it is supposed to stop and bring up a url. I've used gotoAndPlay ("frm") and navigateToUrl. Each time I test it in the browser the animation will begin, but the url comes up before the animation is finished. How do I allow the animation to play all the way through and then retrieve the url?

stop();
//SimpleButton ButtonBtn;
function handleClick( pEvent:MouseEvent):void
{

[code]....

View 9 Replies

ActionScript 3.0 :: GoToAndPlay After Loading A SWF?

Apr 21, 2009

I have a preloader that loads an external .swf. Problem is, it doesn't show the .swf until it is 100% loaded. But, the external .swf starts to play before it reaches 100%. I placed a stop function in the external .swf so now, after it loads 100% it is still on the first frame. How do I get it to automatically goToAndPlay the second frame?
 
Also, when the external .swf reaches the end, it needs to loop back. I am guessing that I will have the same problem after it reaches the end, loops back to first frame and stops again.

View 6 Replies

GotoAndPlay(frame#); Not Working?

Sep 28, 2009

I've got a simple button that when clicked needs to go to a particular frame and stop when it hits the stop(); however when I test it I get a type error #1009 Cannot access a property or method of a null object reference. at PostCard_fla::MainTimeline/frame25()

I need to be able to tell it what frames to go to manually so the user can jump around the time line using short animated transitions between pages (set up like a web page) in AC2.0 this was easy, but its different in AC3 and I'm not quite sure what I'm doing wrong.

This is my code:

stop();
btn_flip.addEventListener(MouseEvent.CLICK, buttonClick);
function buttonClick(event:MouseEvent):void{
gotoAndPlay(28);
};

View 1 Replies

ActionScript 1/2 :: Where To Put GotoAndPlay Within Function

Jul 5, 2010

On my first frame, I have: 6 buttons (p1 through p6). A holder mc_holder, which holds mc_pages, {a movie clip that shows 6 pages (each their own movie clip, page1 though page6) tweened across the screen, made to look as if the pages are being "flipped" through).

The following code:
Code:stop();
var _holder = mc_holder.mc_pages;
var picked;p1.goal = 1;
p1.onRelease = goPage;
p2.goal = 10;
[Code] .....

The problem is, as soon as the movie loads, ALL these animations begin to play. I am looking for a solution so that the animations will not play until the page is viewed. I am thinking I can put a stop on the first frame of each page, and a frame label ("go") on the second frame. Can I add this (my knowledge is limited but say... gotoAndPlay (go")) to the code shown above? I have tried messing around with it but have not yet had any results.

View 3 Replies

ActionScript 1/2 :: GotoAndplay On HitTest?

Sep 8, 2010

I'm trying to make it so that when a movieclip (box) touches another movieclip (exit), it goes to frame 2.I've made it so that (box) moves with the arrow keys and doesn't go pat the barriers (boulders) using this:

x.onEnterFrame = function()
if (Key.isDown(Key.RIGHT)) {box._x += 5;}
if (Key.isDown(Key.LEFT)) {box._x -= 5;}

[code]....

View 2 Replies

GotoAndPlay Not Working In Function?

Sep 9, 2010

I'm having trouble getting a game to go to the end scene after a collison with a barrier.

Code:
function dead() {
clearInterval(ants); //stop spawning

[code].....

View 8 Replies

String Variable With GotoAndPlay?

Apr 8, 2009

I am trying to go about a "smarter" way of setting up multi paged full flash sites. This has got to be something very simple that i can't seem to put my finger on.

I'm trying to create a variable called 'currentScen' that i can declare off the start and change depending on what page the viewer goes to in the site.

I could put a bunch of 'if' statements saying that 'if the current page is this page then do this, if it's this page do this' etc. for each individual page but i thought there must be an easier way.

I am trying to get the following to work:

Code:

// declaring what the starting page is
var currentScen:String = "welcomeMovie";
//function fading in called page with animation used on the 'over' frame label
function animateOn(page:String) {

[Code].....

View 1 Replies

Flash :: GotoAndPlay Not Working?

Mar 2, 2011

I have a movieclip with labels "normal" and "mouseover" . I am using the following code :

var thisButton:MovieClip = this.getChildByName(e.currentTarget.name) as MovieClip;
thisButton.gotoAndPlay("mouseOver");

On debugging "thisButton" does goto mouseover and the frame changes. But visually there is no change and the animation is not played.

View 1 Replies

Actionscript 3 :: GotoAndPlay Not Working?

Nov 25, 2011

I'm trying to gotoAndPlay using AS3 in a certain frame inside a symbol, my target frame is inside another symbol which is "Carrera" (class name). Both symbols where placed on the scene by dragging from the library.

I've tried with:

MovieClip(carrera).gotoAndPlay(1);

Error Output:

TypeError: Error #1034: Type Coercion failed: cannot convert carrera$ to flash.display.MovieClip.
at fondoUcreativa/frame500()

Also tried with:

carrera.gotoAndPlay(1);

Compiler Error:Symbol 'fondo Ucreativa', Layer 'Layer 2', Frame 500, Line 4 1061: Call to a possibly undefined method gotoAndPlay through a reference with static type Class.

View 2 Replies

ActionScript 2.0 :: How To Disable The GotoAndPlay

Feb 3, 2009

Is there any way to disable the gotoAndPlay? I currently have a drop target and when I drop a movie clip on the target it runs the gotoAndPlay, but when I drop the movie clip on the target again it runs the gotoAndPlay. I don't want this to happen.How would I get the gotoAndPlay to run once, so that when i drop on the target again nothing happens.

View 3 Replies

ActionScript 3.0 :: GotoAndPlay Then NavigateToUrl

Feb 15, 2009

Maybe someone in this forum can give me some help. Here is what I'm trying to do... I have page that when you click any of the buttons, it triggers the same animation. Now, depending on which button you click, it will take you to a different url. My problem is, with the code I have, the animation gets cut off before it's finished and goes straight to the url. I know I need some type of listener or something to watch for the end of the animation before going to the url. I can't seem to figure out what that code is or where it needs to go. Also, my animation is not in a movie clip. It's all in Scene 1. I've got the following script in the first frame of the actions layer. I'm only about three weeks into self-teaching AS3, so tell me like a third grader what is up.[code]

View 1 Replies

ActionScript 2.0 :: URL Variables And GotoAndPlay

Jul 17, 2009

This is what I want to do:

- Pass a variable to a SWF. It can be 1, 2 or undefined.

- Read the variable and jump to a frame in the movie depending on the value.

[code]I know flash reads the "URLvariable": I checked it by displaying in a text field... but the gotoAndPlay sentences doesn't work! Instead of it, Flash continues playing the timeline.

View 3 Replies







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