Actionscript 3.0 :: Accessing Function From Doc Class Of Maintimeline?

Mar 30, 2009

Found several suggestions, none of which have worked. I am sure I am probably overlooking something really stupid, so I need another set of eyes to look at my code. I have a main.swf that preloads and loads an intro.swf. On the intro.swf there is IntroMC that contains skip_btn. When the user clicks skip_btn, I need to call a function named traceMe() from the document class of main.swf. If you look at the comments for the intro.swf code, you can see the error I am getting.

Here is the code for main.swf
Code: Select allpackage
{

[code].....

View 6 Replies


Similar Posts:


ActionScript 3.0 :: Calling A Function On Maintimeline From Class?

Apr 17, 2009

How do i go about calling a function in frame 1 of my timeline from a class file?

my function TEST on frame one of main timeline is just using a trace.

This is my error:

1061: Call to a possibly undefined method TEST through a reference with static type flash.displayisplayObject.

View 1 Replies

ActionScript 3.0 :: Accessing Function On Sub Class Via Default Class

Oct 6, 2010

I'm trying to do this,

Code:
Main.instance.subClassFunction();

instance is a public static variable on the default class, Main. I can do Main.instance.defaultClassFunction() with no problems at all, I use it to access functions and variables from within other classes. Is it possible to use this method to call a function on the subclass, currently I have to do this,

[Code]...

View 4 Replies

ActionScript 3.0 :: Accessing Sub Function In A Class?

May 2, 2009

why can i access the first function in a class with

PHP Code:

import test.test
var test:test = new test();

but I cannot access the second or third function in the same manner? they seem to be seperte entities within the class definition.

can access

PHP Code:

public class NetStreamex {
public var connection:NetConnections = new NetConnections();
public function NetStreamex():void {
connection.createNetConnection("rtmp://localhost/test/1");

[Code].....

View 9 Replies

ActionScript 3.0 :: Accessing Parent Function From Class?

Nov 17, 2011

I have a .fla file with some code in the actions panel.A bit of code calls a function in a class from the actions panel .The function in the class is run, but I want to be able to call a function in the main actions panel code from the function in that class .The class doesn't extend anything so (parent as MovieClip).function() does not work.

View 7 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 The Function Of A Custom Class?

Dec 26, 2009

I want to be able to make my own math-functions, so that I don't have to write the same trivial functions in all my classes. I would like to import a class called something like MathExtended, and then use functions like this:

MathExtended.sign(x)

I have made an example that tries to import a custom class like that:

Code:
/*
This is the main script which my fla. runs.
*/

[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 :: 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 :: Access Function On Maintimeline?

Jan 28, 2009

I want to define a function on the maintimline and then from inside a movieclip I want to call a function.

In AS2 simply doing this could achieve the resuly _root.callFunction() but this is not possible in AS3

View 1 Replies

ActionScript 3.0 :: Access MainTimeline From Class?

Feb 15, 2008

I have a .as class which calls an event function. When the event fires, I'd like the MainTimeline to play..

View 9 Replies

ActionScript 3.0 :: Accessing Function Of Custom Class That Is Stored In An Array?

Jan 27, 2011

i am making a few object of action script..,what special about this object is that in the contructor function of  this object is that i  make it to send a sprite parameter which will act  as it's parent..,var anObject:myObject = new myObject(parentSprite);and in my main project i used those object and store it in an array after adding it to the stage.i do store it to an array cause i need to be able to refer back to it..everything was fine up until i need to call function inside that object which i already stored in an array. how should i call the function in that object from an array that stored the object?

View 4 Replies

ActionScript 3.0 :: Swf Loading As MainTimeline Class Instead Of MovieClip?

Aug 18, 2009

I'm loading a few external swf's into my file at runtime using load().Once each one is loaded I run a function on it to search through it's children.I use code similar to below to iterate through all the children and check if the name contains a particular string and then perform a function on it.

Code:
for(var k:String in theMC){
if(k.indexOf("character")==0){

[code]....

View 3 Replies

ActionScript 3.0 :: MainTimeLine.as Class & Import Fl.video.FLVPlayback?

Jan 6, 2010

i am creating a package, MainTimeLine.as, to extend my main timeline.  i use the FLVPlayback component under the package.  however, i get the compile error:

1172: Definition fl.video:FLVPlayback could not be found. so i added the "import fl.video.FLVPlayback;" line to my MainTimeLine.as file, but flash gives the above error. now i had this problem when i added this code directly under a frame of the main timeline until i added a FLVPlayback instance to my library.  now, i am trying to simply embed all of the code under the MainTimeLine.as file and have the as file encapsulate all of it.  but, i still get that error.
 
so, how do i get flash cs4 to recognize and use the import properly

View 2 Replies

ActionScript 3.0 :: As3 MainTimeLine.as Class Access From Symbol MovieClip

Jan 9, 2010

i have a MainTimeLine.as Document Class using as3 in flash cs4.it beginning looks like:[code]where the as file is declared in the Document Class of the primary fla file.  under this primary fla file, i have a MovieClip symbol which points to another fla file.  well this file declares a Class Linkage and i can access the properties and objects of the embedded symbol fine from the MainTimeLine.as script file.however, i have the above public player variable defined, as shown above, in the MainTimeLine.as code.i am having trouble accessing the player properties/methods from the embedded symbol fla file.  how do i do that?

View 5 Replies

Flash :: Access MainTimeline Symbol Using Class-level Embed?

Jan 18, 2012

Here's the scenario: We have a creative team that operates in Flash CS5.5 and produces SWF assets which have both graphics elements and actionscript code in them, and an engineering team which authors .as files and builds "code SWFs". The code SWF files must load or embed the creative assets and interact with the code therein for our apps to function.

For iOS mobile development, there is another consideration - it is not possible to load runtime code in an AIR app packages for iOS because of Apple TOS (see related question). Hence, it is not possible to use a Loader to load SWFs in an iOS environment and retain their code.

Embedding a SWF into an ActionScript file the standard way results in a Loader that loads the embedded SWF directly as bytes. This results in access to the top-level, main timeline as follows:

[Code]...

View 1 Replies

ActionScript 3.0 :: Error #1006: Load Is Not A Function. At Content_fla::MainTimeline/frame1?

Jul 27, 2011

I followed a tutorial to get this to work. I've been fixing new errors on this project for the past 5 hours.

ActionScript Code:
import flash.events.MouseEvent;
var imgurl:String = "img1.jpg";

[code]....

View 9 Replies

ActionScript 3.0 :: Undocumented "MainTimeLine" Class?

Aug 19, 2009

Has anyone ever put this code in the timeline?

Code:
trace(this);
//result: [object MainTimeline]

[code].....

View 5 Replies

ActionScript 3.0 :: Accessing A Class's Static Functions From A Variable Of Type Class?

Feb 19, 2010

I realize this is kind of an odd issue, but I am wondering if there's any way to get Flash to allow me to access a class's static functions using a class variable that points to the class. Example:I create a class called FooClass that has a static function named fooI then create a variable of type Class that points to it

Code:
var class:Class = Class(getDefinitionByName("FooClass"));
However, when I try to call foo() using the variable, it errors saying the function

[code].....

View 6 Replies

ActionScript 3.0 :: Accessing An Object Drawn On The Stage In One Class From Another Class

Jan 6, 2011

I have created a class, call it Class1, that has various objects drawn on the stage (drawn in the IDE). It also has a function, called setColour, for changing the colour of those objects. The function works fine if I call it from within Class1.

Now I have another class, call it testClass1, that imports Class1 and calls the setColour function. First of all, none of the stage objects from Class1 are visible. Secondly, when setColour tries to modify the colour of an object, I get the error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

This is the code for testClass1:

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

[Code].....

So, what is the problem? Is it possible to change objects that are drawn on the stage of an imported class?

View 3 Replies

Professional :: Accessing A Variable Defined In One Class From Another Class

Mar 14, 2011

I've only been programming in as3 for a couple months, and so far I've written several compositional classes that take MovieClips as inputs to handle behaviors and interactions in a simple game I'm creating. One problem I keep coming upon is that I'd love to access the custom variables I define within one class from another class. In the game I'm creating, Main.as is my document class, from which I invoke a class called 'Level1.as' which invokes all the other classes I've written.Below I've pasted my class 'DieLikeThePhishes'. For example, I would love to know the syntax for accessing the boolean variable 'phish1BeenHit' (line 31) from another class. I've tried the dot syntax you would use to access a MovieClip inside another MovieClip and it doesn't seem to be working for me.[code]

View 1 Replies

Professional :: Accessing A Variable Defined In One Class From Another Class?

Mar 14, 2011

I've only been programming in as3 for a couple months, and so far I've written several compositional classes that take MovieClips as inputs to handle behaviors and interactions in a simple game I'm creating. One problem I keep coming upon is that I'd love to access the custom variables I define within one class from another class. In the game I'm creating, Main.as is my document class, from which I invoke a class called 'Level1.as' which invokes all the other classes I've written.Below I've pasted my class 'DieLikeThePhishes'. For example, I would love to know the syntax for accessing the boolean variable 'phish1BeenHit' (line 31) from another class. I've tried the dot syntax you would use to access a MovieClip inside another MovieClip and it doesn't seem  to be working for me

package  jab.enemy
{
import flash.display.MovieClip;

[code].....

View 1 Replies

ActionScript 3.0 :: Accessing Properties Of A Member Of A Class From Within The Class?

Jun 9, 2011

I have a class, call it MyClass, and there are several variables that I need to be able to access each instance of from within the class.So for instance, I need the object myObject1, a member of MyClass, to store the variable myNumber.From the main timeline, if I trace myObject1.myNumber, I get whatever number I've stored.
 
However, I need to check the numbers against another parameter, so I need to be able to test if myObject.myNumber == myOtherNumber. But from within the class, if I trace this.myNumber or myNumber I get null.What is the proper syntax for accessing a variable within a class?

View 5 Replies

Professional :: Accessing Timeline From Class Loaded Into Doc Class?

Jun 12, 2011

I can't find a way to directly access a MC (or textfield, etc) on the timeline from a Class loaded into my Document Class. No problem from the Doc Class, but can't do it directly from the loaded Class. Is there a trick to essentiall extend the Doc Class AS from another external class?

View 7 Replies

ActionScript 3.0 :: Accessing The Stage From A Class Which Isn't The Document Class?

Jul 3, 2009

I'm being really dumb today and I know this should be simple.....How do i access the stage from a class which isn't the Document Class? For instance, I want to create a tween which takes in the parameters of the stage's width? So I've written.....

ActionScript Code:
var myTweenX:Tween = new Tween(this, "x", Regular.easeOut, this.x, stage.stageWidth, 60, true);

[code].....

View 4 Replies

ActionScript 3.0 :: Accessing Variable In Document Class From Within Another Class?

Mar 11, 2009

I have an array in my doc class that I'd like to access from an external class. Can you do this and if so what's the syntax?

View 6 Replies

ActionScript 3.0 :: Accessing A Class Property Through Document Class?

Sep 3, 2009

I have a document class that looks like this:

Code:
package
{
import Map;

[Code]....

Is it possible to access a property of the Map class (though map defined in the Document class) from within the hero class?

View 4 Replies

ActionScript 3.0 :: Accessing Document Class Property From Another Class

Feb 28, 2010

The Main.as file will have all of the game logic, such as the mysteryNumber.

The other actionScript files represent rooms that the user may click and depending on the 'mysteryNumber', it will execute the 1 of 6 scenarios.

So for example, if a user clicks the Library page, the LibPage.as will call the 'mysteryNumber' and execute some code to display on the library page.

It will be the same for the other 4 rooms.

The problem I have is that the LibPage.as won't call the 'theNumber' property from Main.as

Here's the Main.as

Code:
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;

[Code]....

View 3 Replies

ActionScript 3.0 :: Inheritance - Accessing The Properties Of A Class From Another Class

Oct 12, 2011

I'm pretty new to fully using class's for my programming (in-frame scripting satisfied me for a while). I am having a problem accessing the properties of a class from another class. The first class (I'll call it controller) receives a reference to an object of another class (I'll call it display). Display have several specialized subclass (I'll call one SequencedDisplay). SequencedDisplay has a timer in it that I need to access:

[Code]...

View 2 Replies







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