ActionScript 3.0 :: Manipulating The Childs Timeline (external SWF) From The Parent

May 4, 2009

i have loaded an external SWF (area-home.swf) w/in a MC (mc_loader) of the main SWF (base.swf). This is simple, not a problem, works like a charm. What I want to do from here is have the main SWF (base.swf) tell the external SWF (area-home.swf) to gotoAndStop at a certain frame (42). Below is the code that I have, and can't quite figure out why it won't work:

PHP Code:

var loader1:Loader=new Loader();
loader1.contentLoaderInfo.addEventListener(Event.COMPLETE, myFunction);
loader1.load(new URLRequest("area-home.swf"));

[Code]....

When i trace the total frames, it does bring back the actual frame count from area-home.swf, so I know that it is communicating. It simply does not stop on the 42nd frame (even have a stop(); command on that frame in area-home.swf's timeline)

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Manipulating The Childs Timeline (external SWF) From The Parent?

May 4, 2009

Essentially, i have loaded an external SWF (area-home.swf) w/in a MC (mc_loader) of the main SWF (base.swf). This is simple, not a problem, works like a charm. What I want to do from here is have the main SWF (base.swf) tell the external SWF (area-home.swf) to gotoAndStop at a certain frame (42). Below is the code that I have, and can't quite figure out why it won't work:

PHP Code:

var loader1:Loader=new Loader();
loader1.contentLoaderInfo.addEventListener(Event.COMPLETE, myFunction);
loader1.load(new URLRequest("area-home.swf"));

[code]...

When i trace the total frames, it does bring back the actual frame count from area-home.swf, so I know that it is communicating. It simply does not stop on the 42nd frame (even have a stop(); command on that frame in area-home.swf's timeline)

View 1 Replies

ActionScript 3.0 :: Flash Manipulating Timeline External Swf?

Jan 9, 2011

I've created a frame-by-frame (180 PNG's) rendered animation, put those PNG's into a .fla and created myself a nice "little" (8MB) .swf animation. The idea is that I can manipulate the timeline of this animation through the position of my mouse pointer; position of pointer on the left side of the stage means that the animation will play backward, position the pointer in the middle, the animation stops and when you position the pointer on the right side of the stage, the animation plays forward (as regular). The animation is looped, so it will go on indefinitely.

Now, this all works, except for the occasional hiccup. The animation seems to run smoothly but every now and then it glitches a frame or two. This really damages the experience and beauty of the concept I'm trying to establish. I've added a small fps/ms counter and it indeed shows a drop in frame-rate and a peak in the ms every now and then. This is not consistently happening on a single frame or anything, it seems rather random.

current method;

Code:
// used in the enter frame event
_animation.gotoAndStop(_animation.currentFrame + 1);

This seemed to be working the best so far (the least number of glitches). Perhaps it is a bit blunt?

previous methods;

- I've tried to 'tween' the animation by creating a tween (using greensock's TimeLineLite) and either 'play' the tween or 'reverse' the tween (according to the mouses position). This seemed to work properly, but I could not find a way to loop the tween both forward as well as backwards. The tween would loop indefinitely forwards, but when 'reversing' the tween, it would stop after the number of forward loops it had made. So if the animation made three whole loops forward, it would stop after three loops backward.

- I've tried to 'tween' the frames of the animation using greesock's tweenLite;

Code:
TweenLite.to(_animation, 1, {frame:_animation.currentFrame + 1, useFrames:true});
// or something in that order, can't remember.

Something like that, it worked, but it was glitchy as hell (obviously).

View 4 Replies

Actionscript 3 :: Remove Childs If Remove The Parent Itseft?

Sep 30, 2010

In flash AS3 Do I need remove childs, if I remove the parent itseft? If I remove childs first, then remove the parent object afterall OR If I just remove parent object Will flash take same memory?

View 1 Replies

ActionScript 3.0 :: How To Remove Childs From External Swfs

Jun 19, 2009

I have a huge doubt about controlling childs with external movies.. For example:

[Code]...

How manage the external movies if they have a eventListener in a button like

[Code]...

View 1 Replies

ActionScript 3.0 :: Manipulating Instances From External Class?

Feb 3, 2006

I've got an image slider that I'm trying to convert to external classes (OOP and everything). I've got four bars on stage (bar1, bar2, etc.) and I'm shifting them left and right from a "Shifter" class through library linkage. I can get the individuals to shift, but I want more than one to shift (click the right-most one and all open, click the left-most one and only it opens). Like an accordion, basically. I'm new to OOP, and I can't access the individual instances. So far, I can trace the instances using:

for (var i:int=0; i < numChildren; i++) { trace(getChildAt(i).name)}
(and get: instance1, instance2, etc.)

How do I record the instance into my external class? Something like:

(very rough example)
var bar1:Object = getChildAt(i);
var bar2:Object = getChildAt(i + 1);
etc, etc

I've tried pushing them into an array. No luck.

View 4 Replies

ActionScript 3.0 :: Manipulating Instances From External Class

May 6, 2009

I've got an image slider that I'm trying to convert to external classes (OOP and everything). I've got four bars on stage (bar1, bar2, etc.) and I'm shifting them left and right from a "Shifter" class through library linkage. I can get the individuals to shift, but I want more than one to shift (click the right-most one and all open, click the left-most one and only it opens). Like an accordion, basically. I'm new to OOP, and I can't access the individual instances. So far, I can trace the instances using:[code]

View 6 Replies

ActionScript 3.0 :: Change Parent Timeline From A Button In The 'Child' Timeline

Apr 30, 2009

I am just trying to use actionscript 3.0 (Flash CS4) to change the 'Parent' timeline from a button in the 'Child' timeline

[Code]...

View 2 Replies

IDE :: Child Movieclip Timeline Changes Don't Show In Parent Timeline?

May 21, 2009

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 Replies

ActionScript 3.0 :: Tab Indexing Loop Through Parent, External Child Swf, Back To Parent?

Nov 11, 2009

I have a parent swf which loads many child swfs (though only one is displayed at a time). My intention was to use the loaded SWFs document class to retrieve an array of objects to be assigned a tab index, combine this with the parent's own array of objects and apply sequential tab indices to them all. But what happens is actually that the parent's objects are assigned an index, but the external swf is unaffected. In fact, the external swf retains its automatic tab indexing, when I would expect that having set a value for InteractiveObject.tabIndex, automatic tab indexing would be disabled.

I've seen similar tales elsewhere. Most posts I've read are wanting to load an external swf, give it focus and loop through those objects, then close the swf and return to looping through the parent. However I would like loop through all objects as one. including manipulating the focus manager(s), and basically fiddling with every tab-related property I know.

View 2 Replies

ActionScript 3.0 :: Movie Which Contains A Mc On The Main Timeline Using Parent

Sep 17, 2009

I have a movie which contains a mc on the main timeline. that mc has a function in it that says

[Code]....

View 2 Replies

ActionScript 3.0 :: Controlling Timeline Of Parent Movieclip?

Jan 14, 2009

I've just swiched over from FL8 to FL CS4 (3 days ago). I'm learning AS3 at the moment but am on a deadline with a project (a bit over it actualy) which uses AS3

I have a movieclip (container_mc) on the main timeline which holds all the animation and a timer (timer1_mc).When container_mc reaches frame 2 it stops and a timer (timer1_mc) starts running.When the timer finishes, container_mc should continue to the next frame.The code I have to do that (from the timer1_mc) is:

if (d> 260) {
parent.container_mc.nextFrame();
trace("blabla");[code]....

This doesn't work, it gives me the error 1119: Access of possibly undefined property container_mc through a reference with static type flash.display:DisplayObjectContainer.

View 8 Replies

ActionScript 3.0 :: Get A Loaded SWF To Control Parent Timeline?

Aug 25, 2009

I have a swf that loads an external swf. I want the external swf, (the one that was just loaded), to interact with the timeline of the swf that just loaded it. I've been trying MovieClip(root). or MovieClip(parent). but they give me errors. How should I use as3 in the external swf so that it interacts correctly with the parent?

View 3 Replies

ActionScript 3.0 :: Can't Get Button To Play The Parent Timeline

Aug 30, 2010

I can't get my button to play the parent timeline.. I can get it to alpha out the MC but not play the timeline.. grrr..

ActionScript Code:
import com.greensock.*;
import com.greensock.plugins.*;
TweenPlugin.activate([FramePlugin]);

[code]....

View 0 Replies

ActionScript 2.0 :: Timeline Control Of Child .swf From Parent

Jan 26, 2012

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 Replies

ActionScript 3.0 :: Timeline Actions Ignored When Loaded Into Parent Swf

Jan 25, 2009

If I have a movieclip in my library with some animation on the timeline and actions as well (stops, calls to other methods, etc.) and at runtime I add this clip to the display list, everything works as expected. The actions in the timeline of said clip are fired.If however, I load this file into another swf all the actions in the movieclip are ignored.Attached is a demonstration of this behavior. simply runnning Child.swf on it's own will show nothing as there is a stop on the first frame of the attached clip. However run the Shell.swf (which loads Child.swf) and you'll see the animation of the movie clip. There are no calls anywhere telling anything to start playing. What's worse, the method call further down the timeline and the stop and the end of the timeline are also ignored. Compiling these files and looking at the Output window, you'll see the trace from the method "__testCall" is never fired.Is this a bug with the Flash Player?I've had to use addFrameScript as an alternative to actually having the actions on the timeline. lame.

View 3 Replies

ActionScript 2.0 :: Get A Targeted Mc To Communicate With The Parent Timeline?

Nov 6, 2004

How do I get a targeted mc to communicate with the parent timeline? I'm not using levels but targeted mc.

I need the playback head to go from the targeted movie clip (this is called nested, correct?) to the parent timeline and stop at a particular movie instance or frame label. I have been unsucessfully using this:

gotoAndPlay(_parent.instancename);

View 5 Replies

ActionScript 3.0 :: Datagrid XML Data Not Loading Into Parent Timeline?

Jul 2, 2009

I have a problem with XML data loading into a datagrid when the containing swf is loaded into another swf.
 
I am able to get this to work in other scenarios, however in this scenario it seems to be related to the menu system I am using. The menu is populated from another external XML and when a button is clicked it calls a function to load the swf containing the datagrid into the parent swf. The URL for the swf to be loaded is accessed from the menu.xml. The result is an empty data grid.
 
I have tried adding a the datagrid component to the parent swf, however this dows not solve this issue.

View 1 Replies

Professional :: Loaded SWF Runs Code On Parent Timeline?

Nov 30, 2010

I have a parent movie that contains several buttons that load several child SWF files.The parent timeline has only 1 frame, and in that frame all the ActionScript (version 3) for the parent movie is imported with a single statement:
 
include "script.as"; 

The problem is that when a child movie loads, IF the child contains ANY ActionScript calls, it also somehow runs the code in "script.as", which accesses many elements of the parent movie which are not present in the child. This produces "NULL object reference" errors which crash the script:
 
TypeError: Error #1009: Cannot access a property or method of a null object reference.If I remove all ActionScript calls from the child's timeline, then the child doesn't run the parent's code - But if place so much as a stop(); call in the child timeline, then the child runs the parent's code after being loaded in.
 
I originally wrote this script for another project, which works fine, and then copied and pasted it to this one, so I don't understand why it's not working the same way. Earlier on I suspected the trouble might be from re-saving my current project as ActionScript 3, when before this upgrade was saved as ActionScript 2. So I went back and re-created each file in fresh AS3 FLAs, but it didn't solve the problem.The child SWFs are loaded with this code from "script.as".

var ldr:Loader = new Loader();    addChild(ldr);    var url:String = "child.swf";    var urlReq:URLRequest = new URLRequest(url);    ldr.load(urlReq); 

Also in "script.as" is a simple trace call at the top of the file:
 
trace('script.as is running'); 

When de-bugging the file, the message 'script.as is running' appears in the output panel when each child SWF is loaded, which tells me that the child files are running the parent's code. Is there any way to prevent this from happening?

View 6 Replies

Flash :: Way To See Final Frame Of MovieClip From Its Parent Timeline?

Jun 9, 2011

I work on a truckload of flash banners and have progressed more into dispatching events from the final frame of a MovieClip that would contain an object (or collection of closely related objects) animating and then listening for them from the parent timeline so that I know when to continue the main animation etc.In the animation I'm working on currently, there's a car built from blocks over time (the blocks fall from the top of the banner to make up the car); this is all contained within one MovieClip (to make the resizing easier - all I'll have to do is move the entire MovieClip around).The problem is that when I place this MovieClip onto the timeline, it's represented by its first frame (which is nothing because no blocks have fallen yet). This makes it hard to work with because I can't really tell exactly where the car is going to be when the animation is done and so on.Is there a way to have the final frame of this MovieClip visible from the outer timeline?

View 3 Replies

Unable To Make The Imported Buttons Control The Timeline Of The Parent?

Jan 18, 2009

I have an swf file, MyRoundButtons, which is a set of radio buttons I built (not components). It works fine, but if I import it into a parent it won't work anymore. I have to write a script to load it into a movieclip, (which I hate, because I'll have a several different swfs to assemble on my final stage. I really want to see them all on the stage together, not just at runtime.)

Even when I load it into a clip and the buttons work, however, it doesn't seem to have a separate timeline when double-clicked ,and:I can't make the imported buttons control the timeline of the parent.I defined a test function:

Code: Select allfunction goToNirvana() {gotoAndPlay("nirvana")};

Frame "nirvana," in th parent, has a Trace instruction in it.
goToNirvana works on its own in the parent. [code].....

Whether I define that function in the child, the parent, or both, the instruction won't work. Now, I'd prefer not to do the loadMovie thing at all if I can avoid it, I'd rather have fully rendered button clips onstage at authoring for me to arrange and move about, with fully independent timelines right there. But you see what I'm trying to do. I just can't get it done.

View 1 Replies

ActionScript 3.0 :: Control Of Externally Loaded Child Movieclip Timeline From Parent?

Mar 3, 2009

I have a basic xml driven portfolio. The xml file holds the path to the portfolio pieces (external .swfs). I have a main navigation that moves from project to project and a subnavigation to view individual pages of that project.The subnav is where I have the problem, I simply want to call gotoAndPlay("framelabel") of the designated mc. It seems that you can no longer call to the timeline of child movieclips as you could with AS 2. I've found some examples Except the examples discuss access of nested movieclips on the stage with assigned instance names. But the problem I'm facing is that I have each item pulled in via the loader Class then the objects are pushed into an array and my subnav needs to access them dynamically via array notation.something like this:

PHP Code:
public function loadMe(){
//var l:Loader = new Loader();

[code].....

View 12 Replies

Codes To Stop Sound In Movie Clip When Changing Keyframe On Main (parent) Timeline?

Feb 29, 2012

Is there some codes, to stop sound in movie clip, when changing keyframe on main (parent) timeline ?

View 1 Replies

ActionScript 3.0 :: Positioning Parent MC In Order To Center Child MC On Parent's Parent MC

Feb 5, 2010

[code]All clips are squared.Ok, on the PlayerPlane, there are little soldiers, which have hotkeys. The effect I'm trying to create is I want to position the GameStage so that the currently selected soldier appears in the center of the GameClicker clip.The GameStage is movable by the player (to scan other areas of the map)by holding the CTRL key, so it's easy to kinda lose track of where your players are.I have tried using localTo Global and globalToLocal techniques, but I think I'm lost on the actual math of getting the GameStage to move the correct distance so that the selected soldier is centered to the GameClicker.[code]

View 2 Replies

IDE :: Control External SWF From Parent SWF

Dec 22, 2009

I am studying yet. so I am using Macromedia Flash 8. I've created a swf file as (main project.swf) and Loaded a external swf using loader component. the file is main_slide. Now I want send a command or data to project file, from loaded main_slide.

View 1 Replies

Professional :: Put External SWF File To The Parent One

May 11, 2011

I put external SWF file to the parent one. but everythin's working wrong now. How to let it work right. My code:

[Code]...

View 2 Replies

ActionScript 3.0 :: External Swf Loaded Into A Parent Swf

Jul 27, 2010

I have a external swf loaded into a parent swf. It loads fine and plays. I have an EventListener in the external swf, I would like to have trigger a function in the parent swf. Is there a way to do this in AS 3.0?

View 2 Replies

ActionScript 2.0 :: Parent SWF Control From External SWF?

Jan 15, 2008

I have one PARENT swf and one EXTERNAL swf. on PARENT i have one movie clip called PARENT_MC. on EXTERNAL swf i have one button with the following action:

myButton.onRelease = function() {
_level0.PARENT_MC._visible=0;
};

all i need to do is control a movie clip on parent swf from an external swf file.

View 1 Replies

ActionScript 3.0 :: External Swf Ended Up Having Wrong Parent?

Jun 25, 2010

i need to know why my loaded swf ended up having wrong parent, i mean i load multiples external swf and then add it into a main swf which have one mainContainer( an instance of sprite class) to hold background image and it also hold several SWFcontainer which will hold the loaded swf.what went wrong is that the the loaded swf parent is the mainContainer (or if do not use the mainContainer it wil become the child of the stage).

here is the code i used:
import flash.display.*;var myXML:XML;var SWFList:XMLList;var xmlLoader:URLLoader = new URLLoader();var totalSWF:int;var mainContainer:Sprite;var myCounter:Number = 0;var

[code].......

View 29 Replies

Professional :: Different External .swf Files That Are Loading Onto A Parent?

Feb 16, 2012

I have two different external .swf files that are loading onto a parent, I have the same code on each, one works fine but the other one is giivng me this error,
 
TypeError: Error #1009: Cannot access a property or method of a null object reference.at aavar/frame1() at flash.display::MovieClip/gotoAndStop() at aavar/mouseA()my FLA still runs, but I would like to work out what is going wrong.  I do not have any references to this function in my document class but it doesnt like it! What is going on here?

[Code]...

View 1 Replies







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