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


Similar Posts:


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

Access An Array That's On The Maintimeline?

Jun 2, 2009

I need to access an array that's on the maintimeline from with in a movie clip im having issues with it.
 
The variable has all its info on the maintimeline but doesnt show up when i reference it in the movie clip So i tried referencing to the array var thumbURL:String =parent.thumbs ; and var thumbURL:String =root.thumbs ; but got an empty variable.

View 7 Replies

IDE :: Access The Maintimeline From Within A Movieclip?

Aug 20, 2009

is there a way to access the maintimeline from within a movieclip?

root. doesnt seem to work

View 7 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 :: MainTimeLine Vs Access A Dynamic Text On Stage

Jul 31, 2009

Short version : Im confused on the difference between the two when accessing something on the stage from a package. Longer version: I passed in a ref to the stage to the constructor on a class, and was unable to use it to access a dynamic text on stage. I pass in this instead and am able to access it.

[Code]....

View 3 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 :: 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

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 :: 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

Flash :: TypeError: Error #1009: Cannot Access A Property Or Method Of A Null Object Reference. At Videogame_fla::MainTimeline/loop()?

Feb 2, 2012

I keep getting the #1009 error coming up, i checked that everything was on my stage and was named correctly.This is the error message that comes up:TypeError: Error #1009: Cannot access a property or method of a null object reference.at Videogame_fla::MainTimeline/loop()Here is my code:

var carrot:Number = Math.floor(Math.random() * 460) +0;
var carrot1:Number = Math.floor(Math.random() * 460) +0;
var carrot2:Number = Math.floor(Math.random() * 460)+0;

[code].....

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

Flash :: Access Object Property Or Function On Extended Class That Isn't In The Super Class?

Jan 29, 2012

If I have three classes:

public class Example {
public function Example () {
}[code]............

You can see that the two last classes extend the first one, and both have the 'variable' property. In case that I have an instance of Example and I am sure it is also an ExtendedExample OR AnotherExtendedExample instance, is there some way to access the 'variable' property? Something like

function functionThatReceivesAnExtendedExample (ex:Example):void {
if(some condition that I may need) {
ex.func()

View 3 Replies

Actionscript 3 :: Access Variables In Main Application Class From Instantiated Class?

Apr 8, 2010

I have a initApp.as which instantiates a class which needs to access the "currentState" property and the States array as well. However we cannot get this to work as we cannot see how we can access this information.

Within initApp.as currentState is accessed via "this.currentState". This does not work in the class which is instatiated within initApp.as. The following error is thrown:

"Access of undefined property currentState."

View 1 Replies

Actionscript 3 :: Access A Public Property From AvEniroments Class Through The Player Class?

Nov 24, 2011

I have the following inheritance structure:

var environment:AvEnvironment = new AvEnvironment(...);
addChild(environment);
environment.addChild(new Terrain());
environment.addChild(new Player());

I am trying to access a public property from AvEniroments class through the Player class, however I'm getting an undefined property error (#119). I've tried the following:

this.x = AvEnvironment.xs // public property in this class
this.x = parent.xs

I've also tried something like this:

var ev:AvEnvironment = AvEnvironment(parent);
this.x = ev.xs

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

View 1 Replies

Actionscript 3 :: Access A Displayobject On Stage In A Class That Is Not A Document Class?

Mar 7, 2012

How to access a display object on the stage in a class which is not a document class?

I am looking for a solution that doesn't involve passing the stage as a parameter to the class.

One solution i always come across is using "TopLevel.as". Is it a good method because as far as I have heard using global variables is not recommended because it might cause some problems while working on big projects.

View 1 Replies

ActionScript 3.0 :: Access The Stage Property From A Different Class That's Not The Principal Class?

Jul 2, 2009

I was wondering how do you access the stage property from a different class that's not the principal class tied to the fla? Essentially, I have main.as which calls another class menu.as, and I can't seem to be able to use the stage.stageWidth property from menu.as. What's the proper way to be able to use the stage property from any class? Do I have to import it separately each time?

View 2 Replies

ActionScript 3.0 :: Flash Access TextField From Class Imported By Doc Class?

Aug 17, 2010

I'm just now learning the new object oriented way of scripting. It's been a wild ride, but I've finally learned how to keep script off my frames (very hard coming from as2).Here's my problem:

I have a TextField on the stage in my main .fla file named loadPercent.

I'm loading a jpg with preLoad.as and displaying the bytes loaded in loadPercent.

I can access my loadPercent TextField from my MainClass

but I can't access it from preLoad.as

the document class is MainClass.as

Code:
package
{
import flash.display.MovieClip;[code]....

I get three '#1120 access of undefined propery' errors for each time i try to access loadPercent.

a few basic questions: 1. all my files are in a folder in my documents, not in the flash directory, is this bad? I've seen people using com.whatever etc.

2. my main .fla file does not share the same name as my MainClass.as (it's not named MainClass.fla) Is that a problem?

I'm assuming these are inconsequential because my code seems to work up to a certain point.

View 7 Replies

ActionScript 3.0 :: Access A Movieclip On Document Class From Another Class?

Mar 3, 2011

Going further on my app, I felt in another problem. Despite having lots of posts on the web regarding this, none of the solutions worked for me In my document class (Main.as) ve two containers. One empty and another with a star that is being imported from the library. Here´s the main class:

package
{
import flash.display.*;

[code]......

View 4 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 :: Possible To Extend Class W/o Access To Class Code?

Feb 3, 2010

Say you were importing flash.events.KeyboardEvent and you wanted it to extend the MovieClip class, is this possible? Where you dont have access to the class to just type "extends XXX"

View 14 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 3.0 :: Get Back From A MC Into Maintimeline?

Jan 13, 2011

im trying to get back from a MC into my maintimeline:

i have a mc in wich i have buttons i have access them with the following:

function fn_logotipo_over(MouseEvent) {
movimentx=new Tween(MC_menu.btn_logotipo,"x",Regular.easeOut,-77,90,1,true);
}
MC_menu.btn_logotipo.addEventListener(MouseEvent.M OUSE_OVER, fn_logotipo_over);

Ok now that im inside that i want to navigate back so i can have access to other buttons that or outside of this MC and on the main timeline.

View 1 Replies

IDE :: No Mouse Events In MainTimeline?

Mar 1, 2009

I am new to AS3 and I am going insane trying to figure this out. I have a blank (new) AS3 document, 00pixels x 200 pixels, with one (the first) frame.

[Code]...

View 9 Replies

ActionScript 3.0 :: Referencing The MainTimeLine From A File?

Apr 25, 2011

I have almost everything working as confirmed through tracestatements, but when I insert my gotoAndStop("frame labels") in theAS file, there is no effect on the app.I know the button is working because inside the AS file I amtracing the button name to the output panel and it is correct. Ialso have assigned a Switch Statement to the clicked event in theAS file and that is correct also. It traces the correct outputs.But inside the Switch statement, where the gotoAndStop islocated it is not moving to the frame label. It doesn't move atall.I have tried the following:

this.gotoAndStop("label");
stage.gotoAndStop("label");
root.gotoAndStop("label");
this.stage.gotoAndStop("label");

View 4 Replies

Actionscript 3.0 :: MainTimeline Communication With External SWF

Nov 27, 2011

I have an external swf called "lakefillpreloader.swf." It works, except when I put it in another swf, called lakefillwireframe. I get Error#1010 for the lines about ButtonMode and the EventListeners that gotoAndStop at different frames. What do I add to my code?

Lakefillpreloader:

Code: Select allclose_btn.visible=false;
buildings_text.visible=true;
//defines measurements, in pixels
const PANWIDTH:Number=10061

[Code].....

View 1 Replies

Actionscript 3.0 :: Retun A Value From Movie Clip To Maintimeline

Sep 25, 2009

I've been trying to get a numeric value from an MC to the main timeline but cant seem to figure it out, i have tried "trace" and it works so i guess there should be a way to get a numeric value back to the timeline from an MC.

View 1 Replies

ActionScript 2.0 :: LoadMovie, Control From Maintimeline To External Swf?

Sep 11, 2006

I have an external swf that I've placed in an empty movie clip using loadmovie into the main movie.

The swf shows and plays fine, however I have an interactive movie clip which does nothing when loaded into the main movie. (note: the loaded .swf is fine when tested outside of the main movie). How do I target the external .swfs interactive features after it has been loaded into the main timeline?

here's an example:

code in the external .swf-- on a movieclip, instance name: growObject
onClipEvent (enterFrame) {
if (_root.grow == 1 && this._xscale<300) {

[Code].....

I just need to figure out how to activate these instances while watching the external swf from my main movie timeline.

View 2 Replies

ActionScript 3.0 :: Load Manually Created Mc On Maintimeline?

Jan 25, 2011

I have manually created a empty mc on the maintimeline named 'loadme'. I have my buttons in a movieclip that is on stage and within that mc i have the follwing code to one of the buttons:

[Code]....

I get an error 1119 when I run the swf. Also, is it possible to declare the variable for 'loader' on the maintimeline and then use it in my buttons mc?

View 4 Replies







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