ActionScript 3.0 :: Refer To Object On Another Timeline?

Oct 1, 2009

I have a container movie which loads another movie into a Loader object which then gets added to the main timeline. The loaded movie has a main class which controls all the other classes in that movie. The container movie has one other element - a scrollbar which scrolls the loaded movie (which is longer than the container) up and down.

When content changes in the loaded movie I need to pass a message to the scrollbar. If I trace parent.parent.parent from the init() function of the loaded movie it traces [object MainTimeline]. My scrollbar, sBar is a direct child of the main timeline, but tracing parent.parent.parent.sBar doesn't work So how can I pass a reference to the scrollbar to the loaded movie? Here's the code in the container movie:

PHP Code:

var ldr:Loader = new Loader();
var sBar:Scrollbar;
ldr.contentLoaderInfo.addEventListener(Event.INIT, initHandler);

[code]....

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Refer To XML Object In Main Timeline From Within A Movieclip?

Feb 1, 2010

I would like to know how to access a XMLList object in main timeline from movieclips.Can XML be accessed through 2nd level(nested movieclips)? In frame 1 of main timeline, the XML file has been loaded.

var xmlData:XML = new XML();
var data:XMLList;
xmlData.ignoreWhite = true;

[code].....

View 0 Replies

Actionscript 3.0 :: Refer To Mc On Main Timeline?

Jan 27, 2009

I can't seem to find this simple code anywhere. But, how do I access a movie clip on the main timeline from inside another movie clip. I want to:

Code: Select allwallpaper.gotoAndStop("blur");
i've tried
Code: Select allparent.wallpaper.gotoAndStop("blur");r
Code: Select allstage.wallpaper.gotoAndStop("blur");
Code: Select allparent.stage.wallpaper.gotoAndStop("blur");

View 12 Replies

ActionScript 3.0 :: Refer To The Main Timeline From Inside MC

Feb 28, 2009

I have a frame label on the main timeline called "History" I have a movieclip on the stage. Inside that movie clip I have a button.

I want to refer back to History from the button within the clip. Tried everything.

View 2 Replies

ActionScript 3.0 :: Button Refer To Main Timeline?

Dec 17, 2008

I have a movie Clip on my main timeline and with in that movie clip is a button. That button has a CLICK event that I want o go back and refer to a "frame" on the main time line. How would I go about doing that?

Here is what I thought I should do

import flash.events.MouseEvent;

WebSitesBtn.addEventListener(MouseEvent.CLICK,WebDesignBtnClick);
function WebDesignBtnClick(event:MouseEvent):void{
_parent:gotoAndStop("Web Design");
}

"Web Design" is the Frame Label which I want to refer too

what I am missing or how I can properly refer to the main time line?

View 1 Replies

ActionScript 2.0 :: Refer To The Main Timeline Within A Movieclip?

Dec 4, 2006

Is there a way to refer to an object on the main timeline from inside another movie clipThe "_root." function does not work and I am still unfamiliar with the "_parent." functions purpose.

View 2 Replies

Actionscript 2.0 :: Movie-clip Button - Refer To Main Timeline?

May 14, 2009

I've made a very normal animated pop-up menu for my flash website, i now want the items that show up to refer to the main timeline, i'm kinda puzzeled on this one, because i dont want to store all my content inside the movieclip (that was my first solution)

View 5 Replies

Actionscript 3 :: Change The Id Of An Object But Still Refer To It With Its Old Id?

Oct 16, 2010

For instance in Flex 4

?xml version="1.0"?>
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark">

[Code]....

the traces when the button is clicked twice are 'the id is myButton' followed by 'the id is yourButton'

Not just an idle query. I was hoping to change the id of custom components when populating a main app with them

View 2 Replies

Flash :: Refer To Object From Other Keyframe

Jan 19, 2012

I want to get information of an object from a previous keyframe. _root. works only for objects on the same keyframe as the code right?

View 1 Replies

ActionScript 3.0 :: Refer To Display Object From External Swf?

Aug 26, 2010

my document class creates custom class variables to load both a slide show and menu .swf instance to the stage.a few questions:my document class extends Sprite, so any addChild() will put that object on the display list?if so, how do I allow script inside the menu instance to refer to other display objects?The following code is within my document class, inside my doc class function:

Code:
/*load menu*/
var menuLoader:preLoad = new preLoad("menu_as3.swf",800,0,1,1,0,1);

[code].....

View 3 Replies

ActionScript 3.0 :: Error: Error #1009: Cannot Access A Property Or Method Of A Null Object Refer

May 4, 2010

I added a flv into my Scene 1 then i added a new Scene.I just wanted to after finishing the .flv flash go to next scene.but when i added a new scene,and I test my movie,the .flv didnt show and i recieved these errors

[Code]...

View 5 Replies

Actionscript 3 :: Difference Between Object Main Timeline, Object Stage And Root ?

Sep 3, 2011

I want to know the difference between [object main timeline], [object Stage] and root in as3? I have read from the topic How stage, root, and MainTimeline Fit Together. But I didn't get clearly.

View 3 Replies

Manipulate A Specific Object's Timeline?

May 7, 2009

I'm using AS 3.0, and I'm trying to change the frames inside a specific object's timeline.The change will be triggered by keyboard events, but I don't know whether to add the eventlistener to the stage or to this. Also, it doesn't seem to be responding to anytime I use a gotoAndStart() or gotoAndStop() it just ignores it completely. Is it calling the stage's timeline when I call this? It also doesn't help when i add this.gotoAndStart() or this.gotoAndStop(), so how do you change the frames outside of the main timeline?

View 3 Replies

ActionScript 3.0 :: When Is A Timeline Object Available In Frame

Dec 12, 2010

I have got a Swf file that contains only two frames, one has a timeline object called movie, the other doesn't. I place a trace(movie); statement in both the EnterFrame event listener and frame scripts on each frame and i found that the object movie is not available in EnterFrame event but can be accessed in the framescripts.[code]So I am just wondering when the timeline object is available during processing a frame and i can access the object? And from the output, it seems after the the SWF file being setup, there is no EnterFrame event dispatched for the very first frame, is that true?

View 4 Replies

ActionScript 3.0 :: Moving Object Using Timeline?

Feb 17, 2011

Hello, I want to have a scene with 10 or so frames animated using the timeline, followed by some user interaction where the objects get moved around with actionscript, followed by 10 or so more frames animated using the timeline. What I find is that as soon as I move any objects using actionscript, the timeline animation won't touch those objects anymore; they are frozen in place.

At the start, I do nextFrame() whenever the user clicks the mouse, to go through the first 10 frames. Then when the user reaches the 11th frame, I want to scroll around on that frame and allow the user to click on an object to make it disappear. (The only way I know how to do scrolling is to move all the objects on the stage by the same amount.) Then when the user is done, I want to call nextFrame() again and have the animation continue. But the animation stops working at that point. All the objects which I have modified with actionscript (all I did was change the .y coordinate) become "tainted" and won't move when I call nextFrame(). Doesn't matter if I change the coordinate values back to what they were when I'm done.

Is there a way around this, to allow the timeline animation to keep going, or should I just avoid mixing timeline animation with actionscript altogether?

View 4 Replies

ActionScript 3.0 :: Referencing An Object That Exists Later In The Timeline?

Jul 7, 2010

I'm trying to:Jump from frame 1 to a frame later in the main timeline Reference an object that exists on the stage in that frame, but not in frame 1

Like so:

ActionScript Code:
function endGame():void {
gotoAndPlay("gameOver");
scoreField.visible = false;
}

A movieclip with the instance name 'scorefield' exists in the "gameOver" frame, yet for some reason, I just get a "Cannot access a property or method of a null object reference." This code is all within a function. By the time the reference to scoreField is executed, the timeline is at the right frame.

View 7 Replies

ActionScript 3.0 :: Controlling Alpha For An Object On The Timeline?

Sep 14, 2011

I recently bought an mp3-player coded in Flash and it works great, except for the fact that I do not want it to appear constantly on the timeline.

The mp3-player is generated throught code, so I was wondering if there is a way to control the alpha of a variable named mp3playerContainer and set it to 0? I have navigation points on frame 25 and 55 where I want this mp3player to not be visible. Could it be an idea to use "currentFrame", so that if currentFrame equals 25 or 55, then alpha of the variable mp3playercontainer will be set to 0?

View 2 Replies

ActionScript 3.0 :: Linking Class With Stage Object And Timeline?

Feb 13, 2009

I've just started using classes while developing my basic platform game in Flash AS3.

On the stage I have a character, instance name 'ball_mc'. I have AS in the time line which controls the characters movements.

I have an external AS file named 'Ground.as' which is basically an ENTERFRAME hittest which stops the character from moving when the character 'hits' the ground.

I have placed a rectangle MC on the stage to represent the ground and linked it to the external AS file 'Ground.as'

The Code for Ground.as is as follows:

package
{
import flash.display.MovieClip;
import flash.events.Event;

[Code]....

View 6 Replies

ActionScript 3.0 :: Have An Object Start Off With An Alpha Of 0 But Then Opacity In To 100% Later On The Timeline?

Feb 17, 2009

I want to have an object start off with an alpha of 0 but then opacity in to 100% later on the timeline BUT I have to use Actionscript.

View 6 Replies

ActionScript 3.0 :: Make A Link Under And Object On The Same Timeline In-active

Jul 20, 2011

if there is a way to make a linked object deactivate if another object appears above it in my swf file. Basically when mousing over the a image that covers the link object, the hot spot still works which give the impression that the image that is showing above it has a link. Btw I already know how to place the overlaying image on another timeline of which the linked object is not on, but that is not what I am looking for in this case, I actually need the linked object to remain on the same timeline as the overlay images.

View 6 Replies

Flash :: Reference Var From Frame On Timeline In An Object Class?

Jan 17, 2011

I'm using Flash Professional cs5/AS3 I'll try and describe this the best I can. I'm new to ActionScript. So, in my timeline I have a var on a frame that represents "lives" and i have some code in the timeline that takes down the number of lives depending on certain events, which all works great.

so, now i wanted to make a constructor class that I could reuse for a bunch of movie clip objects and I only want these objects to be able to move if the lives variable is greater than certain number. So now, building my constructor class for these objects i just wanted put an if statement that is looking to see if the lives are greater than a certain number, which if it is then should make these objects do what i want...But, when i run the project I get "1120: Access of undefined property lives."

lives is the var I made obviously like I said, and it works fine being referenced everyone else except when I make a new .as file for these objects then try and reference it. I get the same error when I try and establish "lives" in the main project class too. I'm not sure where I should put this var or how I can make it so i can reference it from an object class. I'm not really sure how to word or describe my issue which has made it hard to search for a tutorial.

View 3 Replies

Flash :: CurrentFrame Of Root Timeline From Inside Object?

Jun 15, 2011

Is it possible to pull the currentFrame of the root timeline from inside an object class? Normally a currentFrame call only checks the frame of the movieclip it's attached to within an object class, so how would you go about checking the frame of the entire project from within the object class file?

edit: Nevermind, I found what I was looking for. All you have to do is use MovieClip(root).currentFrame and it works just fine. Consider the question answered.

View 1 Replies

ActionScript 3.0 :: Access A Class Object From Main Timeline

Dec 29, 2010

I have a class, and I'm trying access an object outside of that class. For example, in my class I have function: onNodeLoad(node:Object)with that function I can access the properties of node just fine, but outside the class I cannot.In the function that is inside the class, I can trace (node. title)I want to be able to do that trace on the main timeline.[code]So right now, in my main timeline, trace(con.node) comes up null.I've tried to declaring _node public, private, public static.

View 1 Replies

ActionScript 3.0 :: Public Vars From Object Class In Timeline?

Mar 16, 2012

I've made a Horizontal Bar Class which controls an element in library.So I have:Library: HorizontalBar MC - Using class HorizontalBarThis class has some public vars.Library: ContainerGame MC - Using class ContainerGameWhen I add this element to stage (HorizontalBar) inside ContainerGame MC I want to be able to trace public vars from its class inside ContainerGame.

View 2 Replies

ActionScript 3 :: Accessing Instance Of Display Object On Mid-Timeline Frame

Nov 17, 2010

I have the Dynamic Text field that has an instance name on a mid-timeline frame in Flash CS4. I have a class that inherits from Sprite, and which is always added to the stage on instantiation. How can I get a reference to my Dynamic Text instance from this class?

Example:
My Main class (linked in Flash's publish settings) goes like this:
protected function beginGame(e:MouseEvent){
gotoAndStop(8);
var game:GameContainer = new GameContainer(41,8);
addChild(game);
game.x=36;
game.y=128;
}

Game Container extends MovieClip, and draws some pretty gfx. On Frame 8, in the Flash IDE, there is a Dynamic Text element instance named "scoreText". I want to access this from the GameContainer class. Possible?

View 2 Replies

ActionScript :: Difference Between Object Main Timeline / Stage And Root?

Sep 3, 2011

I want to know the difference between [object main timeline], stage and root in as3.

View 1 Replies

ActionScript 3.0 :: Error #2078: The Name Property Of A Timeline-placed Object Cannot Be Modified

Aug 12, 2008

I have a movieclip created:

ActionScript Code:
var mc:MovieClip = new MovieClip();
later on I load a SWF into this movieclip
ActionScript Code:
mc = MovieClip(e.currentTarget.content);
I then want to name the mc:

[Code]...

Error: Error #2078: The name property of a Timeline-placed object cannot be modified.at flash.display:isplayObject/set name()at thumbDesign2_fla::MainTimeline/setup()at MethodInfo-872()

View 9 Replies

ActionScript 3.0 :: Class Created Object To Array In Main Timeline?

Jan 16, 2011

class created object to array in main timeline?

View 1 Replies

ActionScript 2.0 :: Refer To A Url?

Jun 10, 2010

How do you refer can i refer to a Internet url in actionscript 2

View 4 Replies

ActionScript 3.0 :: Control The Property Of An Object In Main Stage From A Loaded Swf Timeline

Oct 11, 2010

i have a UILoader that loads an image from an xml list when you click its thumbnail ( in its thumbnails mc on mainstage aswell) thing is, i have another UILoader on the layer above that loads in a swf ( a slideshow that fades in and out the pictures when they change to the next, with all the coding on frame 1, frame 2 only has a stop and some code for when the mouse is idle for 5 secs it goes back to frame 1) so when you go to "portraits" it takes you to frame "x" where the slideshow ( loaded external swf ) starts playing automaticly right, if i click any thumbnail the slideshow goes to frame 2 ( wich is perfect and the mouse idle thing i wanted works great ) the ONLY THING IS

after the slideshow runs by default for the first time ( i enter the category portraits ) and i click any thumbnail ( moving slideshow swf to frame 2 enabling mouse idle event ) and the mouse is idle ( so it does the event and starts playing the slideshow again ( goes back to frame 1 ) ) I CANT MAKE THE UILOADER OF THE THUMBS IMAGE TO DISSAPPEAR!

View 5 Replies







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