Professional :: Possible To Access Child Timeline?
Oct 14, 2010On the main timeline I've got a movieclip, inside this movieclip I have some elements. Can I manipulate those elements from the main timeline through AS3? How?
View 3 RepliesOn the main timeline I've got a movieclip, inside this movieclip I have some elements. Can I manipulate those elements from the main timeline through AS3? How?
View 3 RepliesI have a cloud named cloud2_mc and in its timeline i have a cloud layer, and an actions layer. I took the cloud and made it into a a Movie clip clip with an instance name of embeddedcloud_mc in this Movie clips timeline i have a 50 frame animation of the cloud breaking appart and disapating with a tween and i have a stop(); function on frame 1 of this layer.
What I want to happen is, when the cloud2_mc movie clip is clicked to play the animation of the cloud breaking appart. the cloud2_mc has a trajectory moving slowly accross the sceen continuously when the cloud2_mc reaches the side of the sceen it loops again. When the animation is clicked i would like it to continue across its path but, when the cloud2_mc reaches to left hand side of the screen i want the embeddedcloud_mc to reset its timeline and go back to its original state where the cloud has not broken appart.
My question is, how do I access an embedded movie clips timeline to tell it to play an animation on its timeline as well as, how do i make the same object restet its timeline to frame 1?
I am loading one swf file in my application and after loading the child swf ,just i want to play one particular key frame in the child swf and the label names is called "start".
[Code]...
I can't access the variables that I declare in the main timeline from a child.
I attach the child to the stage during runtime.
I have a menu movieclip that has several buttons, each with listeners writtin in the movieclip's actions layer in Frame1. The script goes something like this:
[Code]...
Imagine the following setup. The main swf loads a child swf.In AS2 i would simply use _parent or _root to call the desired function. How can that be done in AS3?Can this still be done? Can I call a function on the main swf from the loaded one? How about the other way around, this time, from main to loaded swf?
View 1 RepliesHow can I access a timeline variable from a static class / singleton?
View 14 Repliesi have problem with swfLoader in flex, when i close following code in click method i can easly add many swf to main application
<mx:VBox id="content" width="100%" height="100%" ></mx:VBox>
public function doIT():void
{[code]....
when i close adding those swfs in loop i have the same error, it looks like child apps couldn't access certain objects that were instantiated by another child app, so what can i do?
I've seen some discussion on how to load a child swf using swfLoader and accessing it's variables but I am wondering if it is possible to do this without adding any code to the child swf.Either accessing public vars or listening for funciton calls would work fine
View 2 RepliesI am just trying to use actionscript 3.0 (Flash CS4) to change the 'Parent' timeline from a button in the 'Child' timeline
[Code]...
Why does a child movieclip only show the first frame within the IDE, regardless of where you are in the parent timeline?If you throw a movieclip with 25 frames onto the main timeline, which also has 25 frame, you don't see the nested movieclip's frame-progress while you scroll through the main timeline.Is there a setting somewhere in preferences or somewhere that will enable you to see a nested movieclip's frame position from the main timeline? Like you do with After Effects composites?
View 3 RepliesI have a mainSwf in which I load an external swf, which loads an external swf.( a child of a child). I am trying to set the framerate via AS3 for the childs child by using stage.frameRate= 15;
It doesnt work when the children are loaded into the mainSwf. how to access the stage of a child's child? I have tried root, Movieclip, this but can not get it to work
public function GlobalSolutions()
{
Navigation(' Home ', 'index', 235, 0x97F9EC);
Navigation(' Office Supplies ', 'Office_Supplies', 295, 0x97F9EC);
[code]....
I want to remove the appropriate child (e.currentTarget) and create a new child in its place with the next line, but it doesn't work. What do?
I am in the learning process. Working with FlashCS5 and AS3. if the issue appears to be too simple for you. Placed a movieclip(mcassessJohn) on the main timeline and moved to the frame labelled "johnFeedback" in the movieclip timeline using the following actionscript code.
[Code]...
I made a MovieClip called Stone and I made a StoneBackground child in it. What I want to do is make a grid of the Stone image but everytime with another background I tried this:
stone:Stone = new Stone();
for(var i:int=0; i<2; i++) {
stone.child.gotoAndStop(i);
addChild(stone);
}
But this doesn't work. How can I stop the timeline of the background at different frames for each "stone" ?
How do I remove child from a different Timeline. One of my movieclip contains three children.I want to remove all the three children.How could I do that. I tried setting instance name and removing the instances using getChildByName. But it doesn't seem to work.
Code:
var mainMc:MovieClip = new MovieClip();
addChild(mainMc);
var box:box_mc;
[code]....
remove child from the timeline. I have attached this sample file. I get "1120: Access of undefined property board." error when I publish it.Here is what I'm doing:
Open button: This will create a child with movieclip
show_btn.addEventListener(MouseEvent.CLICK, showBoard);
function showBoard(event:MouseEvent):void{
var board:Board = new Board();[code]..........
Here is the Error I get when I publish it: 1120: Access of undefined property board.
I'm an animator trying to use actionscript along with timeline animation.The setup is flock>fly>wings flock movieclip 30f long, the script looping, starting multiple fly movieclips at different points.
fly movieclip 30f long, controls wings0 movieclip timeline (3 frames, each with a movieclip). Frame1: wings0.gotoAndStop(2) Frame24: wings0.gotoAndStop(1) Frame48: wings0.gotoAndStop(3)
From flock timeline I'm trying to override actions in fly3. to call a different wings0 animation.
flock Frame1: var loop:Number = 0; fly1.gotoAndPlay(15); fly2.gotoAndPlay(8); fly3.gotoAndPlay(20); if(fly3.currentFrame==24){ fly3.wings0.gotoAndStop(3); }
flock Frame 30:
loop = loop + 1;if (loop > 0) {this.gotoAndPlay(2);} else {this.stop();}
But the animation of fly3 doesn't change.
I have a main .swf from which I am loading a child .swf into using this code.[code] Once the .swf is loaded in though, I want to be able to use basic timeline control functions like stop(); and gotoAndPlay(); on the child .swf from the parent.
View 1 RepliesIs it possible to write a script, on the stage, that initiates a function, on the stage,when this movie clip reaches frame 8? Or do I need to write the code within the movieclip?
View 3 RepliesHow do I remove child from a different Timeline. One of my movieclip contains three children. I want to remove all the three children. How could I do that. I tried setting instance name and removing the instances using getChildByName. But it doesn't seem to work.
Code:
var mainMc:MovieClip = new MovieClip();
addChild(mainMc);
var box:box_mc;
[Code].....
i've made a simple example here to show you my problem. I have basically created a stage object ("box"), with the nested children, box->b->c. I have exported box for as, with class "box" and base class movieclip. Now i create 4 instances of my box class and add an eventlistener to the nested child c. When i later on try to remove the eventlisterner for myinstance.b.c i get: TypeError: Error #1010: term is undefined and has no properties.at DocumentClass/removeSomething(). Here is my code:
package
{
import ....
[code]....
The error is as follows:1119: Access of possibly undefined property shiftX through a reference with static type flash.displayisplayObject.shiftX is declared in the first line of the movie clipFirst i check to see if the child doesnt exist and if it does I access it like so:getChildByName("ball"+ccc2).shiftX)
View 4 RepliesSo I am loading in external swfs and once loaded in I want to stop the main timeline. so I do the following.
var swf : MovieClip = e.target.content ;
swf.stop();
which doesn't work, because I have trace statements in the external swf which fire off after that command is called. Which, here is another weird thing, When I trace through the loaded swf, it says it has two children, a shape, and a Loader. The shape is weird because what I have is another movieclip on stage so I should get instaceXX, and I dont know where that Loader class is coming from.
which also brings me to another question which is everytime I add the swf to the stage it duplicates the instance, and I run out of memory really fast after I keep removing and re-adding it. all I call is.
targetMC.addChild(swf);
then after the swf dispatches an event saying its done.
targetMC.removeChild(swf);
I've simplified the problem but basically i have two files: parent.fla and child.fla.. parent.fla has its own class definition of type ParentClass and is basically defined as below..
public class ParentClass extends MovieClip
{
public function AddListener()[code]....
These classes all have the relevant imports etc so there's no compilation errors.But when i try to publish the child.fla i get the error
saying..1120: Access of undefined property btnOnStage
my work around at the moment is just putting in var btnOnStage:SimpleButton; into the ParentObject class which lets it publish it fine, but it obviously causes conflicts when i publish the parent.fla as btnOnStage already exists.I know this is because basically the object is on the timeline in the parent.fla and is being accessed from the class and has never been defined. But how do i get around this? Is there a way to tell flash that there will be a variable like that there and dont worry bout it?
having some issues migrating to AS3...How can I add a child object to a empty movieClip already placed in the timeline. Something like this.n timeline first frame there is an empty MC instance named "clipInTimeline" and in framescript I call:
import assets.contentControl;
var getContents:contentControl = new contentControl();
In AS file:
[code].....
This code is currently contained within my "mc_1" movieclip. I want to be able to have this code on my main timeline, however no matter what I try I constantly get errors, multiple different versions. I've tried adding mc_1 infront of everything, but that just gives an output error about a Sprite.Also, I'm currently using visible to control whether the back image to the textbox should show - What I'd really like to do is control it using a child, but they're movieclips not buttons, so when I try to addChild within the function it errors saying I'm trying to control a movieclip within a simplebutton function.
import flash.events.MouseEvent;
stop();
mc_textbox.visible = false;
[code].....
I'm using setInterval() to run a function that shoot a bullet every 1.5 seconds.
every 1.5 second the function is run, the function include playing the shooting animation in timeline using gotoAndPlay(). and create a new instance of bullet animate towards a certain direction
But i want to know is it possible to finish playing the shooting animation first then only move on to creating the bullet instance part?
because currently the shooting animation and bullets created, is almost instantaneouly.. what condition should i add in order to do that??
[Code]....
Someone the other day provided me with this code to a remove a child from the main timeline from within a movieclip.
parent.removeChild(MovieClip(parent).mc1);
This works fine, but how can I write an if statement to test if its in the display list before removing it?
As I'm getting an error if I try to remove it once its already been removed.
I am trying to add a child in a movie clip and perform basic operations on the child but I cannot get access to the child.
It loads the child to the movieclip "FLine1MC" but it says FLine1MC.ClipArt1 does not exist when I try to change the x location.
function AddArt1(evt:MouseEvent): void {
var ClipArt1Request:URLRequest = new URLRequest("images/mypic.gif");
var ClipArt1:Loader = new Loader();
ClipArt1.load(ClipArt1Request);
FLine1MC.addChild(ClipArt1);
FLine1MC.ClipArt1.x = 550;
}
Anybody know what's my error?
By that token, is there a way we can check the exact path of an object?