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


Similar Posts:


ActionScript 3.0 :: Call Function Of Document Class From MovieClip Class

Aug 8, 2008

How can I run function of the main document class from a class of a MovieClip? I usually just used MovieClip(parent).function(), but now my MovieClip has another parent. Or what do I have to pass to the MovieClip class when creating the MovieClip to acess the main document class?

View 9 Replies

ActionScript 3.0 :: Calling Function In Custom Class From Document Class?

Feb 24, 2009

I keep getting an "undefined property" error when I try to call an external function from within the Doc class. I added the error message to the Doc Class below so you can see where it occurs.

If I take the code from the Tooltip.as below and place it on the FLA's main timeline I can get things working fine, but I would like to move all script to classes. The document class structure looks like this:

Drag_and_Drop.as

Code:
package {
import Tooltip;// Import custom class
public class Drag_and_Drop extends MovieClip {

[Code]....

I realize that I could just combine all the code in the Doc class to get it working, but it would be nice to separate out this particular code which has only one use.

View 4 Replies

ActionScript 3.0 :: Calling A Function In The Document Class Form Another Class

Mar 9, 2011

I'm trying to have a class reference a variable within the document class and have scoured the web but can't seem to find a solution. It seems relatively simple, but is a major stumbling block for me.

I want the variable in the doc class to increment each time a draggable object is within bounds and snapped to a box in the subclass. By tracking successful snaps, the objects will be placed one under the other each time.

View 4 Replies

ActionScript 3.0 :: Flash Call A Function From The Document Class In Another Class?

Apr 20, 2011

I have a Document class that instantiates a class named Other. I need to call a function in the Other class from the Document class.I'm getting this error: Call to a possibly undefined method OtherFunction through a reference with static type Other.I have read online that you need to use make the functions static or use a getter function but I'm unclear how to do that. I haven't been able to make it work and I feel like i'm missing something fundemental with this problem.below are simplified versions of the classes.

Document class

Code:
package {[code]......

View 1 Replies

ActionScript 3.0 :: Creating A Sprite And Calling It With Document Class

Dec 14, 2009

I want a cass using drawing API which will create a sprite with 2 levels...(item.addChild(sprite.1)......... addChild(item))
 
I want a document class to call this sprite and place it on the stage for animation...
 
how to create a multilevel spirte and then instantiate it using doucment 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 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 :: Calling Document Class Function From Another Class?

Jun 12, 2009

I want to call a function that is inside in a document class from another class how can i do this ??

View 1 Replies

Actionscript 3 :: Manipulate With Symbol On Stage From Document Class Without Creating New Instance?

Sep 18, 2011

So I have one movie clip on stage rect_mc and document class Main.as I can import movie clip to document class with [code]...

but is there any way to manipulate rect_mc without craating new instance and attaching it to a stage with addChild()

View 2 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

ActionScript 3.0 :: Run Document Class From The Menuscreen Class When A Button Is Clicked

Jan 28, 2011

I use two classes for my current project, a document class and a menuscreen class. I have a function in my document class called startGame that i want to run from the menuscreen class when a button is clicked. I'm nearly there but i'm getting an error when i try to run it: 1136: Incorrect number of arguments. Expected 1. The error is at line 17 in the menuscreen class, the line that tries to run the function from the document class. I don't understand what kind of argument it wants. Also, i'm not sure if the startGame function should be (event:Event) Hope someone can enlighten me on what's wrong!

[Code]...

View 3 Replies

ActionScript 3.0 :: Call A Function From One Document Class From Another

Aug 30, 2010

I'm basically trying to call a function that is on document class from another document class. I have a document class called Main.as in it there is a function called tester(). I need to call this function from another document class called Step1.as.[code]Does anyone know how I can call the function? I cant seen to get it to work.

View 5 Replies

ActionScript 3.0 :: Function Calls In Document Class?

Oct 22, 2009

I have a gallery, which has a document class and all classes below.When I load gallery.swf into main timeline currently, how do I call some functions in that document class?

View 9 Replies

ActionScript 3.0 :: Accessing Function In The Document Class?

Nov 24, 2009

I have an instructions.as file which is trying to call a function in the document class through a mouse click event listener and am getting a 1009 error.

Here are my to actionscript files:

** this the the instructions.as**
package Elements{
import flash.display.MovieClip;
import flash.events.*;

[Code].....

View 3 Replies

ActionScript 3.0 :: Accessing A Function Of The Document Class?

Mar 29, 2011

My project is structured as following :

- a fla file with movieClips on the timeline , this fla is linked to the Main class

- a Main class who does some randomization of the animations

- a MenuItem class which function is to give each button menu the same functionnality

the problem is that I'm trying to access to the randomNumber function inside the Main class from the MenuItem class to prevent the rewriting of the function inside this class. I've made some research on Google and apparently I have to create a Singleton class so I can access the Main class from everywhere, I've followed those instructions but it still doesn't work, when I trace the Main class from the MenuItem class it gives me a Null result!Main Class code :

Code:
package
{
import flash.events.Event;[code].....

View 4 Replies

ActionScript 3.0 :: Function - Button Will GotoAndPlay One Frame Beyond Where The Timeline Presently Is Stopped At

Feb 23, 2011

I'm taking a class on Flash right now but its set up in this strange manner where they barely teach you actionscript at all but expect you to be able to take the examples in class and work and amend them into your projects. I am trying to write a function for a button that will gotoAndPlay one frame beyond where the timeline presently is stopped at.

[Code]...

View 3 Replies

ActionScript 3.0 :: Call Function In Document Class From And Included .as?

Feb 6, 2010

I have a document class with functions that I want to access from .as files that are "included" from the timeline of movieclips.

for example, the Document Class "docClass.as":

PHP Code:

package{
public class docClass extends MovieClip
{
public function docClass():void

[Code].....

What is the correct way to call functions in the Document Class from and included .as file?

View 3 Replies

ActionScript 3.0 :: Accessing Document Class Function Within Timeline

Oct 10, 2010

have a very simple question, (Bear with me I'm still quite new to as3 and some of my terminology may not be solid) I want to access a function that is within my document class when a movie clip on the timeline has played to a specific point (being the end). I have already been able to call another function from the document class at the top/root level (it is called to initialize all clips and buttons when you click on the "enter" button on the splash screen. Problem is that I cannot call another function (in the document class) from a movie clip within a movie clip on the timeline. Is there an easy way to do this? I have considered writing a separate class for the movie clip and then adding it onto the movie clip (using the property panel). I don't really want to do it this way because I am already using a base class on that movie clip and 3 others that use a set of generic functions.

View 1 Replies

ActionScript 3.0 :: Accessing Stage From Function In Document Class

Dec 10, 2010

How do you access the stage from a function in a document class file? I tried a fairly simple:
ActionScript Code:
var main:MovieClip = new MovieClip();
addChild(main)
var _stage:Stage = main.stage;
trace(_stage);
The result was null.

View 5 Replies

ActionScript 3.0 :: How To Access Function In Document Class From Frame

Jan 15, 2010

Tried to access a function in the document class by simply calling it. For exampe, the code in my frame is:
Code: Select allinitButtons();
And in my document class I have the function:
Code:
Select allprivate function initButtons():void{
trace('anything');
}
But it gives me an error. Even tried to change private to public the same.

View 3 Replies

ActionScript 3.0 :: Getting Loaded SWF To Use A Function From Main.fla Document Class?

Dec 16, 2009

I have a main movie with thumb movieclips that load new children and stops the main movie's animation. Within the child there is a close buttion that removes itself. I also wanted the close button to start the animation of the main movie again once it removed the child. Since I am using a document class to load everything for the main move, how can the close button from the loaded swf use a function from the main document class?

View 5 Replies

ActionScript 3.0 :: Flash - Dispatching An Event From One Document Class And Listening For It Via Another Document Class?

Dec 14, 2010

I am dispatching an event from one document class and listening for it via another document class.My code in class A.

Code:
this.dispatchEvent(new MYEvent(MyEvent.APERTURE_DONE));
trace("Dispatching APERTURE_DONE");

my code in class B.

Code:
addEventListener(MyEvent.APERTURE_DONE, onDoorsOpen,true);
trace("Lisetning for APERTURE_DONE");

[code]....

My listener is registering before the event is dispatched, based on my output window, however I never get the "Open Doors" trace statement to fire.

View 2 Replies

ActionScript 3.0 :: Call Document Class Function From A Movieclip On Timeline

Jun 25, 2009

I have a function defined in my document class that I want to call on a framescript of a movieclip placed on a timeline. Of course, left to itself it's "undefined", and I can't figure out how to reference parent/root/document class.

View 4 Replies

ActionScript 3.0 :: Reference Main Document Class From Document Class Of Loaded Swf

May 7, 2011

I have a FLA (say Main.FLA) document class with a child MovieClip on the stage: into the child MovieClip I load other swf files: each of the files contains its own Document Class (every swf is a somewhat independent application, say quizzes and so on).For some reason I must use the Main document class to store data (scores or so) from the child swfs loaded into the Main swf. HOW do I reference the Main class? I can't find a way.[code]and dispatch an Event this way from the loaded swf document class to the Main class:[code]Now, first of all I don't know if this could even work. Secondly, I tried to make it work by adding an event listener to my Main class but id did not work.

View 9 Replies

ActionScript 3.0 :: Hang Calling Function After Document Class' Event.ADDED?

Aug 24, 2010

I was trying to load an external SWF (that contains the below code in its document class) with the Loader class but i keep on receiving Error #1009: Cannot access a property or method of a null object reference. So i tried to use the event listener Event.ADDED in MyDocumentClass constructor of the external SWF to let the document class be part of the display list before i invoke createRandomGraph. But when i place createRandomGraph( ) inside onStageReady, The compilation process hangs. When i leave the createRandomGraph( ) inside the constructor, it works perfectly as stand alone but will produce Error 1009 if loaded within the loader SWF

public function MyDocumentClass( )
{
this.addEventListener(Event.ADDED, onStageReady);

[code].....

View 3 Replies

ActionScript 3.0 :: Can't Add A Button To Stage From Document Class

Jul 25, 2009

I have a Document Class called Main.as. I tested that it works using a simple trace statement and that outputs fine. I instantiated a Button control and tried to add it to the stage but I keep getting the error thrown below. The code for Main.as is simple and at the end of this thread. I tried all different ways to add the Button to the stage but couldn't figure it out.[code]...

View 3 Replies

ActionScript 3.0 :: Button Scripts Fail In Document Class?

Sep 28, 2009

I have a document class with a button script in it that is being completely ignored when I run my movie. I am also having bizarre trace results when I try to get the names of movie clips that are nested. [URL]

View 8 Replies

ActionScript 3.0 :: Moving Document Class .fla Cannot Find The Document Class - WTF?

Sep 22, 2008

So I had a working .fla, with a document class package in the same directory. Everything was fine, until moving both to a new directory, now the fla cannot find the document class. WTF?

View 2 Replies

ActionScript 3.0 :: Call Function In Creating Class?

Apr 14, 2009

I have "class A" that makes a bunch of objects from "class B"

class A

Code:
public function classA(){
for(var i:int = 1; i<=num; i++) {
var b:classB = new classB(i);

[Code]....

I need to call a function in "class A" from "class B" but I'm not sure how to do that.

class B

Code:
public function stoppedMoving() {
// check for overlap in "class A" here.
}

View 5 Replies







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