Loading SWF giving Instance name as TimeLine

I'm Loading swf into a movieclip name main_mc. After
successfully loading it into main_mc. I had written a function to
get all children present in that movieclip(main_mc). It is getting
Children present in that, but every time it give [Object
MainTimeLine] as instance3 or sometime instance10. How can i
control instance name of maintimeline as it is randomly getting its
name.... I'm attaching code use in getting child and loading it...
Plz check if their any problem in code.
quote:
Clip=new Loader();
var urlRequest:URLRequest=new URLRequest("test.swf");
Clip.contentLoaderInfo.addEventListener(Event.COMPLETE,LoadingDone);
Clip.load(urlRequest);
private function LoadingDone(event:Event):void {
var _mc:MovieClip=event.target.content as MovieClip;
main_mc.addChildAt(_mc,0);
//if i trace the name of _mc movieclip... it will instance4
or instance10 randomly
trace(_mc.name);
showChildren(stage,0);
function showChildren(dispObj, indentLevel:Number):void {
for (var i:uint = 0; i < dispObj.numChildren; i++) {
var obj:DisplayObject = dispObj.getChildAt(i);
if (obj is DisplayObjectContainer) {
trace(padIndent(indentLevel), obj.name, obj);
showChildren(obj, indentLevel + 1);
} else {
trace(padIndent(indentLevel) + obj);
function padIndent(indents:int):String {
var indent:String = "";
for (var i:uint = 0; i < indents; i++) {
indent += " ";
return indent;
when loading is done suppose test.swf has one_mc movieclip
Children traced are like that...
quote:
main_mc [object MovieClip]
instance3 [object MainTimeline]
one_mc [object MovieClip]
[object Shape]
Can we solve this problem...

you can't control the instance name of a main timeline. but
if you name everything else, the main timeline will be the only
object whose instance name starts with "instance".

Similar Messages

  • Load SWF with instances into MC

    Hello,
    I have a SWF called "player.swf", and it contains instances
    like: "head", "body" etc...
    I want to load that SWF into another SWF
    ("display_player.swf"), and to load ANOTHER SWF to replace the
    "head" instance, like:
    "_root.p" is a transparent red colored movie clip inside
    "display_player.swf"
    I tried doing this:
    _root.p.loadMovie("player.swf");
    trace(_root.p.head);
    "_root.p" said to be "_level0.p" and is displayed correctly,
    but "_root.p.head" said to be undefined (NaN)...
    Does anyone has an idea on how to load a SWF inside a movie
    clip, and use it's instances?

    The point here is to demostrate, or at least determine, what
    the problem is. I have stated that it is probably likely that you
    are making the call to _root.p.head previous to it being
    instatiated on the timeline. you must wait for the swf to load
    before the clip within the loaded swf can be made available to
    target. A better method would be to use the MovieClipLoader class,
    and then use the onLoadInit handler, this handler is displatched
    when the swf becomes available to the timeline, then within the
    handler you could call your trace, or load into the 'head' instance
    at the correct time.
    I have made an example to demostrate this, using
    representations of you clips and swfs:
    HERE
    PS. launch the items from within the folder.

  • Trouble Playing A loaded 'SWF' file in the pain timeline

    Hey there. I have created a presentation that loads
    interactive SWF movies into a 'target' movie clip on the main
    timeline.
    As you progress through the presentation different SWF movies
    are loaded into the presentation. And this in turn allows me to
    change the presentations content quickly and easily for different
    clients.
    These SWF's use some of the flash preloaded content objects
    like combo box's and the like.
    However when these SWF's are called into the main
    presentation they cease to work properly.
    They work fine when tested independently of the main
    presentation.
    Does anyone know how I may be able to get these SWF's to work
    properly?
    Cheers Fletch

    The first thing to do is check the scoping in your loaded
    SWF. Any references to _root, for example, mean something different
    once the SWF is loaded into your wrapper movie.
    Also, some of the V2 components don't work properly when
    their SWF is loaded into another SWF. There's a Tech Note and easy
    workaround here:
    http://www.adobe.com/go/tn_19278
    Good luck!

  • Controlling loaded swf from main timeline

    Hello,
    I'm working on loading external swf files for ios. I am able to load the swf files and set them to visible or invisible in different frames. I am having trouble controlling the loaded swf files from the main timeline. Specifically, I would like to have a button on the main timeline, that when clicked will move a loaded swf to frame 1.
    Here is a code that loads one swf file:
    var myLoader1:Loader;
    var loaderContext1:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
    if(myLoader1 == null)
              myLoader1 = new Loader();
              addChild(myLoader1);
    myLoader1.load(new URLRequest("folder/file1.swf"),loaderContext1);
    myLoader1.visible = true;
    backbutton.addEventListener(MouseEvent.MOUSE_DOWN, backbutton1);
    function backbutton1(myEvent:MouseEvent):void {???????????? myLoader1.gotoAndStop(1);}  (this line does not work)
    (Once I load file1.swf, within the file1.swf I click a forward button to move to different frames. My question is: how do I code the 'backbutton' on the main timeline so that it causes the loaded file1.swf to go to frame 1?)
    Thank you for your help.

    sure.
    if the movieclip on the loaded swf's main timeline has reference mc, you would use:
    MovieClip(myLoader.content).mc.gotoAndStop(1);
    p.s.  you might find the following helpful,  http://kb2.adobe.com/community/publishing/918/cpsid_91887.html

  • Reducing a SWF file size / creating "instance names" for website loading time improvement

    Im hoping someone clever can help...
    What i have done so far:
    1) Created a flipbook using indesign CS5.5 that contains approx 25
    images (embedded PNG's), these need to be good quality as this is a
    portfolio - I'd also like to keep the 'page curl' effect. This makes the SWF generated cira 25MB.
    2) created a Flash website "wrapper" to hold the above flipbook and add
    features such as "bookmarks", links to other sites and forward/backward
    page navigation buttions.
    The issue we have is that because the flipbook SWF is 25MB the site
    load time is slow.
    What can be done to speed this up without compromising the image
    quality?
    1) Is there a way to make the indesign SWF smaller?
    2) is there a way in indesign to properly give each page an
    "instance name" so that they can be controlled from flash and therefore
    I can load each pages image as and when needed.
    any other ideas?
    (If you'd like to visit the website to view the loading issue http://www.lizblackdesigns.co.uk)
    Thanks
    Liz

    these need to be good quality as this is a portfolio
    The approach to your portfolio website seems very outdated and will not help you in the near future. Flash is being used less and less with the increase in Mobile Devices being used to access the internet - a large chunk of which include Apple's iDevices which don't support Flash. This alone is a reason not to do it, however there are a few other big issues with the method you have chosen.
    There is no "content" on your website for any search engine to find. No text. No meta data. No image alt tags. No titles. Nothing. In other words, your website will not be found by the people you are trying to attract. I would imagine for a portfolio site, you may want to re-think this approach.
    The way the Flash file was created is the worst possible way to add Flash to the web as you have only embedded image files - and this is your entire site?! You could have included some text, which would have been viewable by search engines, and used color shapes to increase quality but lower filesize.
    The filesize meant it took me over 1 minute to get off your home page. The average internet user will leave your site if you do not keep them interested after 5 seconds. In other words, you should have content of interest viewable within 5 seconds of load time.
    If you are set on keeping the Flash setup for your website, re-build using as much text, color shapes and lines as you can (vector work in other words) and do not rasterize/export as image. This will drastically reduce load time and increase quality. You will also want to divide your file into sections and create more than 1 HTML page so that the browser only loads a bit at a time. You might also want to set a maximum size container for the Flash file as on my browser, it looks extremely pixelated and is very large, but unclear.
    I would suggest looking into HTML5 if you are keen to create a website that can be viewed by around 98% of the web surfing people and it will also mean you can use an image slider (or similar) to show good quality images of your work. This will aid your site in being found by search engines but will also allow you to update sections of the site without re-publishing the entire Flash file.
    Rik

  • How to name a dynamically loaded swf

    heres my prblem i have a set of button buried inside a mc
    when they are clicked i need them to call upon a external mc. ive
    tried some different code but nothing works.
    _level0.contholder_mc.contractor_mc.gotoAndPlay() works but
    only one time. if i click on another button and then go back to the
    external mc i gives it another instance name. how do i stop it from
    giving dynamic instances names.
    thanks for the help

    General Flash procedure is to always code you movies separate
    from one another. If the movie is external, all its methods,
    actions and symbols should be embedded inside that movie.
    Basically, get the buttons working in the smaller movie first. Once
    they are doing what you want them to there, move over to the main
    movie and test playback from there. Often times, there will be
    minor changes necessary to an object or button to insure proper
    playback in the main movie but they are more manageable if they are
    resident to the loaded clip. So start by getting your buttons
    working within the loaded movie's fla file then move over. That
    should help you tremendously.

  • Listing objects and their instance names (of closed source SWF)

    I have an API for a flash player that I want to use, but it is closed source. I know I could try a decompiler but I need to see what it loads and what it's doing at runtime.
    I'd like to see the objects (and all their info) that it loads and has on stage along with thier instance names. I'd like to see what this SWF has/does so I can write my AS3 code accordingly... maybe add some additional event listeners.
    Is there any was to go about doing this? I know there's some AS3 commands to get this information but I dont know what they are. If you all could give me some hints at which commands would be useful that would be great.

    "I need to see what it loads"
    You can use Fiddles, Charles or Firebug to monitor traffic (what it loads).
    As for the rest of your question - good luck. Although it is possible to decompile swf of course, reverse engineering is an extremely complex time consuming task. In the majority of cases it is easier and faster to replicate functionality from scratch than to try to understand SWF's logic.
    Unless you know packages structure - there is no native way to figure out/access application domain.

  • Load external and give instance name

    I'm using this code to load and external swf, now how do I assign an instance name for it?
    var eventInitialLoader:Loader = new Loader();
    var eventInitialURL:String = parent['eventPath'+ie];
    var eventInitialRequest:URLRequest = new URLRequest(eventInitialURL);
    eventInitialLoader.load(eventInitialRequest);
    eventOdd_MC.addChild(eventInitialLoader);
    Thanks for helping!

    At some point in your code you must have a reference to the instance you want to remove, then you can just do:
    [instance].parent.removeChild([instance]);
    or set up an array:
    var instanceArr:Array = new Array();
    and when you load a new instance with the Loader, do:
    instanceArr.push(myInstance);
    and to access them:
    for (var i:uint = 0; i < myInstance; i++){
    var child = instanceArr[i];
    (do stuff with child)
    child.parent.removeChild(child);

  • CLICK in main timeline goes to where click is designated in loaded swf?

    Seems doable, but having trouble grasping the concept...
    I have a loaded swf slide show, within that slideshow, I have assigned "next" and "prev" buttons to advance and back up my slide shows via frame labels ("oneIn") for instance... here is an example:
    btn_next.addEventListener (MouseEvent.CLICK, nextClick);
    function nextClick (e:MouseEvent):void{
        this.gotoAndPlay ("twoIn");
    I would like this function to run when I click a hit state on the main timeline above it. So, how would I trigger the above function from a click on the hit state on the main timeline?
    To help, here is my code for the mouse over function using the hit state that refers to the external buttons:
    pNextH.addEventListener (MouseEvent.MOUSE_OVER, nextOver);
    function nextOver (e:MouseEvent):void{
        var mc:MovieClip = MovieClip(imageLoader.content);
        mc.btn_next.gotoAndPlay ("nextOver");

    Actually, just as I am confused a bit... would I need no function descriptor?
    Just this line? As opposed to:
    pNextH.addEventListener(MouseEvent.CLICK, nextClick);
    function nextClick (e:MouseEvent):void{
        var mc:MovieClip = MovieClip(imageLoader.content);
        (mc.content).nextClick
    I know that is wrong, but do i need a function def for the code you gave me? Or just the one line?
    pNextH.addEventListener(MouseEvent.CLICK,MovieClip(yourloader.content).nextClick );

  • Controlling a Movie Clip on the Main Timeline from a loaded SWF?

    Is it possible to control a MovieClip on the main timelne from another loaded clip?
    I see posts that control loaded clips, but most are all from the loader in the main timeline.  I have a moviclip on the main timeline that I want to make visible or invisible depending on what keyframe is playing in another loaded swf.
    If I try to call the movieClip from the loaded SWF I get "error #1119.  Access of possibly undefined property...." because it doesn't exist in the loaded SWF, just the main timeline. 
    The old AS2 way just used "_root".  Since "_root" doesn't exist any more, how do you control items on the main TimeLine from a loaded SWF?

    I am not clear what you mean because you are saying you are trying to target a movieclip that does not exist where you are trying to target it.
    Try using a trace to see what you are targeting when you you target the MovieClip(parent.parent)....
    trace(MovieClip(parent.parent));
    The other approach I mentioned earlier is the more OOP-correct approach if you would rather try that way.  Here's a rough outline of it...
    AS3 - Dispatch Event
    http://forums.adobe.com/thread/470135?tstart=120
    Example:
    Add something to trigger the event in the child (your loaded swf):
    dispatchEvent(new Event("eventTriggered")); (
    if dispatchEvent problem, see: http://www.kirupa.com/forum/showthread.php?p=1899603#post1899603)
    In your loading/parent swf, listen for the complete event on the Loader.contentLoaderInfo.  In the complete event handler, add a listener for the event on the loaded swf.
    // event handler triggered when external swf is loaded
    function loaderCompleteHandler(event:Event) {
        MovieClip(event.currentTarget.content).addEventListener("eventTriggered", eventHandler);
    function eventHandler(event:Event):void {
        trace("event dispatched in loaded swf");
       // this is where your main file can set the visible property of your movieclip

  • Loaded SWF communicating with Main Timeline

    Let's say I load an external SWF to my main timeline. In that
    loaded SWF, I'd like to have a button that when clicked, removes a
    Movie Clip from the main timeline.
    How do I do that? Should be simple, right?

    Sorry I misunderstood your question, but here is the code.
    The second part is original swf altering a movie clip in the
    external (mov2.swf), just making an mc 50% transparent....
    circle_btn.addEventListener(MouseEvent.CLICK, printButton);
    function printButton(myevent:MouseEvent){
    var portLoader:Loader=new Loader();
    var printThumbRequest:URLRequest=new URLRequest("mov2.swf");
    portLoader.load(printThumbRequest);
    stage.addChild(portLoader);
    portLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    loaded);
    function loaded(event:Event) {
    circle2_btn.addEventListener(MouseEvent.CLICK,
    talkToExternal);
    function talkToExternal(myevent:MouseEvent){
    event.target.content.green_mc.alpha=.5;
    }

  • Targeting the timeline of a loaded swf - AS2

    I'm loading an external swf into a project and I want to be able to start and stop the loaded swfs timeline at will....
    I'm loading swf into an MC:
    loadMovie("myFile.swf", swfHolder_mc);

    you can reference the loaded swf's main timeline by referencing swfHolder_mc AFTER loading is complete and the swf is initialized.

  • Loaded flash 8 swf's instance problem !

    Hi,
    I am loading a Flash 8 .swf file in Flex 3. Initially its
    working fine.
    But whenever we tried to load a another instance of that swf
    or trying to load in a separate container again, its producing
    wrong output with colors and mouse events.
    We tried with the same swf file making two different file
    (map1.swf, map2.swf), and loading them separately. But its also
    buggy.
    The MovieClip structure of one swf (map1.swf) in flash is
    like - _level0.Map.Map.NA.
    We made one swf 's (map2.swf) structure to test like -
    _level0.Map2.Map.NA
    Where colours of 'NA' instances are depending on xml and
    mouse event applied to them.
    If we load them in Flex 3 and trace out the loaded swf
    instances, whichever swf loaded first, flex started to use those
    instances everywhere.
    e.g. If map2.swf loaded first and map1.swf second, then Flex
    debug console shows -
    '_root.Map2.Map.NA' - for map2.swf and
    '_level0.diff_map_load0.pan2.contentPane.UIComponent33.instance37.instance67.Map2.Map.NA'
    - for map1.swf.
    Again, If map1.swf loaded first and map2.swf second, then
    Flex debug console shows -
    '_root.Map.Map.NA' - for map1.swf and
    '_level0.diff_map_load0.pan2.contentPane.UIComponent33.instance37.instance67.Map.Map.NA'
    - for map1.swf
    For both of the cases which one is loaded first, working
    correctly and the second one producing wrong results with colors
    and mouse events.
    Help and Suggestions needed.
    Thanks,
    Debasish Bouri.

    Authorware is old. EOD'd, in fact now.
    It's native support only officially handles Flash 6. Flash 7
    usually
    works fine if nothing 'fancy' (i.e. new components) has been
    added to
    the SWF. Flash 8 and above, however, pretty much aren't going
    to work at
    all in Authorware *using the native sprite*.
    However, if you add the Shockwave Flash ActiveX control to
    your
    flowline, that uses the same control as IE does. So as long
    as your user
    has the Flash IE player on their machine, you can load
    whatever SWF
    version that player supports.
    Working with the ActiveX control is a bit more tricky. Check
    the ActiveX
    example in your Authorware 7\ShowMe directory for an
    example...
    The biggest downside to the ActiveX approach is those SWFs
    are 'always
    on top'. Makes for good playback but you can't layer anything
    on top of
    those SWFs unfortunately (except maybe other ActiveX
    controls, which
    causes lots of flickering).
    HTH
    Erik
    Jacks007 wrote:
    > Hi All,
    > I've been creating SWF's in Flash v6 (I think it was v6)
    and they worked fine
    > in AW 7. I now have Studio 8 and can't get them to open
    in AW7 without saving
    > as the earlier version. Does anyone know why it does not
    work or if AW needs
    > an update to get the Flash 8's to work in AW as a
    Version 8 SWF?
    >

  • Giving things instance names. Flash cs4

    Ive been using adobe flash cs4 for a while now and have had little trouble giving things instance names. Now though, whenever i double click on something like i normally do to give it an instance name, the blue box no longer comes around it, i click on properties, and change the instance name. I now get a dashed line along the lines of the picture. and when i go to properties, it just says shape, and I cant edit the instance name. Just position and size, then the fill and stroke.  What is going on?

    You do not assign instance names to objects in the library.  Instance names are assigned to object on the stage.  Instance names are unique for each item on the stage.... meaning the same library object can be used multiple times... each instance of it will have a different name.  If you want to assign a name you do it either by manually entering it in the properties panel or thru actionscript code when the object is added to the movie.

  • Moving the timeline from a loaded swf file

    Hi,
    I have been at this problem for awhile now.
    I have a two swf files, whic are loaded using ths code as an example:
    stop();
    var req:URLRequest = new URLRequest("Enchilada_A.swf");
    var loader:Loader = new Loader();
    function imageLoaded(event:Event):void {
        ldContainerB.addChild(loader);
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
    loader.load(req);
    The first one is triggerrd by a MC button that is on the timeline.
    That first swf loads fine.
    At the end of that file(which is short animation)
    I have code that says:
    MovieClip(parent).gotoAndStop("frameThree");
    I have also tried:
    MovieClip(root) and
    if (movie Clip is parent) {
    MovieClip(parent).gotoAndStop("frameThree");
    and/MovieClip(parent).nextFrame();
    I have also tried placing this. or root. into the code.
    I am not talking to the timeline from this swf file.
    Once the timeline moves to the next Frame the new swf file can load.
    My solution was to combine both swf files into one, which loads from the timeline button.
    It works and I can gt by but I really woud like to learn how to load a swf and talk to the timeline fro more flexibilty.
    I'm out of strategies.
    Is my code in the wrong place(at the last frame of the animation?
    Should it be written on the timeline by creating a new var that has a function once the animation is completed.
    Any suggestions and/or commens would be greatly appreciated.
    Thanks.

    Thanks,
    I finally had a chance to get back to this project and used your suggestions, whichare definitiley helpful. I also, created a new and very basic version of the project so I could easily see what was happening.
    This is the code that works:
    stop();
    MovieClip(parent.parent).nextFrame();
    trace(container_mc);
    I'm still trying to understand how the child parent relationship is working but this will get me going in the right direction.

Maybe you are looking for

  • Email SPOOL as HTML ..

    Hi !!    We are planning to schedule certain reports in background and then want to read its spool and convert those spool to HTML and send it as aattachment to email . I check the forum and the library there are example of submitting report to abap

  • Unshuffling songs

    My Ipod nano is set to shuffle albums in the settings, but after I selected shuffle songs in the main menu it shuffles songs in my playlists every time, even when I don't want it to. How do I stop this? Also, does shuffling songs permanently change t

  • How to get the text of a message class

    Hi, I have a message class and added few message(with attributes) to that class. Now i want to read the text of the message based on the attributes and the message no. Example: Message 19 is - Where is &1. Where is &1. Where is &1. Where is &1. Infor

  • Problem creating playlists library window closes when opening new playlist

    library window closes when opening new playlist impossible to drag and drop songs from lib to new playlist

  • Exchange email account doesn't appear in iTunes

    Hi, I have several email accounts set up in Mail and all sync perfectly with my Touch apart from one, which is an Exchange account. This doesn't even show up in the list under Info, Mail Accounts in iTunes. Any suggestions? Cheers Phil