Path.To.MovieClip?

Hi,
I have this event which is not working and I am stumped!
on(rollOver) {
_root.mc_home.gotoAndStop("over");
_root.mc_home.mc_homemove.gotoAndPlay("rollover");
Instance mc_home consists of 2 keyframes labelled 'out' and
'over'.
Keyframe one has a stop() action and a brown shape to
resemable a button and the word 'Home' in a grey colour.
Keyframe 2 has a stop() action, the word 'Home' in black but
instead of a brown shape to represent a button, it has another
moveclip with the instance name of mc_homemove. This movieclip has
a frame label on its timeline called 'rollover' which is where the
magic happens within this movieclip!
When I rollover my main movieclip (instance name mc_home) the
first line of the event is run successfully:
_root.mc_home.gotoAndStop("over");
I know this because the word 'Home' changes black in colour
but the second line does not as my movieclip instance mc_homemove
does not begin to play.
Does anyone have any suggestions as to where i am going wrong
please?
Thanks in advance.
K

I think its becuase the action for the second line of code:
_root.mc_home.mc_homemove.gotoAndPlay("rollover");
is being called BEFORE it can find the movieclip named
"mc_homemove"
create a second button and have one lie of code on one and
the otherline on, well the other.
Run your movie and see what happens.

Similar Messages

  • Problem with Textsnapshot

    problem with Textsnapshot-- setSelectColor() method
    ObjText =
    _root.my_mc.pages.p1.page.pf.ph.pic.p1.getTextSnapshot();
    Totalchar = ObjText.getCount();
    trace(Totalchar); // this is returning the number of
    character in movieclip p1
    ObjText.setSelected(100, 300, true);
    ObjText.setSelectColor(0xFA0000);------not working
    The problem is the setSelectColor(0xFA0000); is not marking
    the color in the charcter from 100
    to 300.
    but the below code works fine. the only difference is that
    path ofthe movieclips
    _root.my_mc
    _root.my_mc.pages.p1.page.pf.ph.pic.p1
    var ObjText = _root.my_mc.getTextSnapshot();
    Totalchar = ObjText.getCount();
    trace(Totalchar); // this returns the number of character in
    movieclip my_mc
    ObjText.setSelected(100, 300, true);
    ObjText.setSelectColor(0xFA0000); // this works fine
    the main thing is in both the code --trace(Totalchar);--
    is giving the correct output.
    can anyone help me to solve this problem.

    use:
    var my_snap:TextSnapshot;
    s1.onRelease = function() {
    if(my_snap==undefined){
    my_snap = odd_img.getTextSnapshot();
    my_snap.setSelected(0,my_snap.getCount(),false);  // if you want to deselect previous selections
    hltextodd(st.text,my_snap);
    //******************set focus***************
    hltextodd = function (txt:String, snap:TextSnapshot) {
    var fnd_arr = new Array();
    var start_pos:Number = 0;
    start_pos = snap.findText(start_pos, txt, true);
    found = 0;
    while (start_pos>0) {
      found = found+1;
      fnd_arr[found] = start_pos;
      var finalB:Number = start_pos+txt.length;
      snap.setSelected(start_pos,finalB,true);
      trace(start_pos+', '+finalB);
      start_pos += txt.length;
      start_pos = snap.findText(start_pos, txt, false);

  • Tracing a Movieclip's Path

    Hello AS3 Gurus!
    I have a scene with a path layed out on the stage. I have a movieclip, called "follower" that is motion-path-guide-connected to the path and is also hiden with alpha=0. I have timeline animated the "follower" movieclip to follow the path from frame 1 (start of path) to frame 90 (reaches end of path). This *.fla file is attached to this post. I see that I am not allowed to post FLA files here so it can now be found here, instead:
    http://www.culshaw.info/junk_drawer/AS3Forums/tracingLines.zip
    What I want to have happen is to have a nice, smooth (not jaggedy) line appear to be growing over time.
    I have almost solved the problem with the following code:
    //----------TIMER STUFF
    var myTimer:Timer = new Timer(10, 0);
    myTimer.addEventListener(TimerEvent.TIMER, timerHandler);
    myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, completeHandler);
    //----------LINE DEFINITION
    var line:Shape = new Shape();
    line.graphics.moveTo(this.follow.x, this.follow.y);
    line.graphics.lineStyle(5, 0x66AACC, 1.0, true, LineScaleMode.NONE, CapsStyle.NONE, JointStyle.ROUND);
    //----------FUNCTIONS
    function timerHandler(te:TimerEvent):void {
         line.graphics.lineTo(this.follow.x, this.follow.y);
         this.addChild(line);
    function completeHandler(te:TimerEvent):void {
         trace("complete");
    //----------INITIAL CONDITIONS
    myTimer.start();
    The problem I am having is that the line that is traced (growing) is very tesselated (not smooth) even when I bring the Timer repeat value (how often it fires) down to a super low value (this is the value that is "10" in the new Timer definition in the above code) the line that is traced is still chunky and not very smooth.
    Two Questions:
    (1) is it possible to have the movieclip follow a path with AS3 code only -- not timeline animated to a guide path like in the attached FLA)?
    (2) how do I get the traced path to be smoother (anti-aliased) and not all jaggedy? What am I doing wrong in the above code?
    Any input, as usual, would be very much appreciated.
    Cheers,
    ropeGun

    Danny,
    Thanks! works great (that would have taken me all evening to figure
    out).
    For those newbies like me who want to try at home, here are my dbxml
    commands.
    dbxml> createContainer test.dbxml
    Creating node storage container with nodes indexed
    dbxml> putDocument "contacts" '
    <contacts>
    <contact>
    <familiarName>John</familiarName>
    <surname>Doe</surname>
    <phone work="555 555 5555" home="555 666 777"/>
    <address>
    <street>1122 Somewhere Lane</street>
    <city>Nowhere</city>
    <state>Minnesota</state>
    <zipcode>11111</zipcode>
    </address>
    </contact>
    <contact>
    <familiarName>Sue</familiarName>
    <surname>Doe</surname>
    <phone work="111 111 1111" home="222 222 2222"/>
    <address>
    <street>27 Any Street</street>
    <city>Nowhere</city>
    <state>Minnesota</state>
    <zipcode>11111</zipcode>
    </address>
    </contact>
    </contacts>
    Document added, name = contacts
    dbxml> query '
    declare namespace test = "http://test.brians.org";
    declare function test:nodepath ($node) {
    let $name := $node/name()
    let $index := count($node/preceding-sibling::*[name() = $name]) + 1
    for $nextnode in $node/ancestor::node()[1]
    return
    typeswitch ($node)
    case $a as attribute()
    return concat(test:nodepath($nextnode), "/@", $name)
    default
    return concat(test:nodepath($nextnode), "/", $name,
    "[", $index, "]")
    for $street in (collection("test.dbxml")//street[starts-with(.,"2")])
    return test:nodepath($street)
    1 objects returned for eager expression '...'
    dbxml> print
    /contacts[1]/contact[2]/address[1]/street[1]
    Craig

  • Problem in Loading Multiple image in Single Sprite/MovieClip

    Hi All,
    I am having a killing problem in loading multiple images in single movie clip/sprite using a separate class.
    Here is the ImageLoader.as class
    package com.project.utils{
        import com.project.*;
        import com.project.utils.*;
        import flash.events.EventDispatcher;
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.events.ProgressEvent;
        import flash.display.Loader;
        import flash.events.IOErrorEvent;
        import flash.net.URLLoader;
        import flash.events.MouseEvent;
        import flash.net.URLRequest;
        import flash.display.Bitmap;
        public class ImageLoader extends EventDispatcher {
            public var imgloader:Loader;
            public var imgMc:MovieClip;
            public var imgObject:Object;
            public var loaded:Number;
            public function ImageLoader():void {
                imgMc = new MovieClip();
                imgObject = new Object();
                imgloader = new Loader();
            public function loadImage(imgHolder:MovieClip, imgObj:Object):void {
                imgMc = new MovieClip();
                imgObject = new Object();
                imgloader = new Loader();
                imgMc = imgHolder;
                imgObject = imgObj;
                imgloader.contentLoaderInfo.addEventListener(Event.COMPLETE,onImgLoad);
                imgloader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,onImgLoadProgress);
                imgloader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,onImageLoadFailed);
                imgloader.load(new URLRequest(imgObj.FilePath));
            private function onImgLoad(Evt:Event):void {
                var image:Bitmap = Bitmap(Evt.target.content);
                try {
                    imgMc.removeChildAt(0);
                } catch (error:Error) {
                imgMc.addChild(image);
                try {
                    if (imgObject.URL != undefined) {
                        imgMc.buttonMode = true;
                        imgMc.removeEventListener(MouseEvent.CLICK, onImageClicked);
                        imgMc.addEventListener(MouseEvent.CLICK, onImageClicked);
                } catch (err:Error) {
                dispatchEvent(new CustomEvent("CustomEvent.ON_IMGE_LOAD"));
            private function onImageClicked(evt:MouseEvent):void {
                trace("Image Attrs:"+imgObject.URL +" Target "+imgObject.Target);
            private function onImgLoadProgress(Evt:ProgressEvent):void {
                if (Evt.bytesLoaded>0) {
                    loaded = Math.floor((Evt.bytesLoaded*100)/Evt.bytesTotal);
                    dispatchEvent(new CustomEvent("CustomEvent.ON_IMGE_LOAD_PROC",loaded));
            private function onImageLoadFailed(Evt:IOErrorEvent):void {
                trace("Image Loading Failed");
                dispatchEvent(new CustomEvent("CustomEvent.ON_IMGE_LOAD_FAIL"));
    Here I am loading some images using the above class in a for loop, like
                for (var i=0; i < 3; i++) {
                    //imgLoader=new ImageLoader;
                    imgLoader.addEventListener("CustomEvent.ON_IMGE_LOAD",onImageLoad);
                    var target:MovieClip=videolist_mc["list" + mcCount + "_mc"];
                    target.list_mc.visible=false;
                    var imgObj:Object=new Object;
                    imgObj.FilePath=list[i].Thumbnail;
                    imgObj.Url=list[i].Url;
                    imgObj.Target=list[i].Target;
                    target.list_mc.urlObj=new Object  ;
                    target.list_mc.urlObj=imgObj;
                    imgLoader.loadImage(target.list_mc.imgholder_mc,imgObj);
                    target.list_mc.lable_txt.htmlText="<b>" + list[i].Label + "</b>";
                    target.list_mc.imgholder_mc.buttonMode=true;
                    target.list_mc.imgholder_mc.addEventListener(MouseEvent.CLICK,onItemPressed);
                    mcCount++;
    In this case, the ImageLoader.as works only on the last movie clip from the for loop. For example, if i am trying to load three image in three movie clips namely img_mc1,img_mc2 and img_mc3 using the for loop and ImageLoader.as, I am getting the image loaded in the third movie clip only img_mc.
    See at the same time, If i uncomment onething in the for loop that is
    //imgLoader=new ImageLoader;         
    its working like a charm. But I know creating class objects in a for loop is not a good idea and also its causes some other problems in my application.
    So, help to get rid out of this problem.
    Thanks
    -Varun

    package com.project.utils{
        import com.project.*;
        import com.project.utils.*;
        import flash.events.EventDispatcher;
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.events.ProgressEvent;
        import flash.display.Loader;
        import flash.events.IOErrorEvent;
        import flash.net.URLLoader;
        import flash.events.MouseEvent;
        import flash.net.URLRequest;
        import flash.display.Bitmap;
        public class ImageLoader extends EventDispatcher {
            public var imgloader:Loader;
            public var imgMc:MovieClip;
            public var imgObject:Object;
            public var loaded:Number;
            public function ImageLoader():void {
    // better add you movieclip to the stage if you want to view anything added to it.
                imgMc = new MovieClip();
                imgObject = new Object();
                imgloader = new Loader();
            public function loadImage(filepath:String):void {
                imgloader.contentLoaderInfo.addEventListener(Event.COMPLETE,onImgLoad);
                imgloader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,onImgLoadPr ogress);
                imgloader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,onImageLoadF ailed);
                imgloader.load(new URLRequest(filepath));
            private function onImgLoad(Evt:Event):void {
                var image:Bitmap = Bitmap(Evt.target.content);
                try {
                    imgMc.removeChildAt(0);
                } catch (error:Error) {
                imgMc.addChild(image);
                try {
                    if (imgObject.URL != undefined) {
                        imgMc.buttonMode = true;
                        imgMc.removeEventListener(MouseEvent.CLICK, onImageClicked);
                        imgMc.addEventListener(MouseEvent.CLICK, onImageClicked);
                } catch (err:Error) {
                dispatchEvent(new CustomEvent("CustomEvent.ON_IMGE_LOAD"));
            private function onImageClicked(evt:MouseEvent):void {
                trace("Image Attrs:"+imgObject.URL +" Target "+imgObject.Target);
            private function onImgLoadProgress(Evt:ProgressEvent):void {
                if (Evt.bytesLoaded>0) {
                    loaded = Math.floor((Evt.bytesLoaded*100)/Evt.bytesTotal);
                    dispatchEvent(new CustomEvent("CustomEvent.ON_IMGE_LOAD_PROC",loaded));
            private function onImageLoadFailed(Evt:IOErrorEvent):void {
                trace("Image Loading Failed");
                dispatchEvent(new CustomEvent("CustomEvent.ON_IMGE_LOAD_FAIL"));
    Here I am loading some images using the above class in a for loop, like
                for (var i=0; i < 3; i++) {
                    var imgLoader:ImageLoader=new ImageLoader();
                    imgLoader.addEventListener("CustomEvent.ON_IMGE_LOAD",onImageLoad);
                    var target:MovieClip=videolist_mc["list" + mcCount + "_mc"];
                    target.list_mc.visible=false;
                    var imgObj:Object=new Object;
                    imgObj.FilePath=list[i].Thumbnail;
                    imgObj.Url=list[i].Url;
                    imgObj.Target=list[i].Target;
                    target.list_mc.urlObj=new Object  ;
                    target.list_mc.urlObj=imgObj;
                    imgLoader.loadImage(pass the image file's path/name);
                    target.list_mc.lable_txt.htmlText="<b>" + list[i].Label + "</b>";
                    target.list_mc.imgholder_mc.buttonMode=true;
                    target.list_mc.imgholder_mc.addEventListener(MouseEvent.CLICK,onItemPressed);
                    mcCount++;

  • Help please!  I need code for a button to stop a movieclip, when both are in a nested animation.

    I'm working on a project that has a button and a movieclip, which we want the button to stop, both nested in a movieclip on the main timeline.
    The button instance = muteBtn
    The clip to stop instance = backmusic
    The movieclip they are nested in = ecard
    There's also a preloader that works just fine on the main timeline.
    I've seen a wide variety of ways to stop a streaming MP3 and they all look way too complicated for my current Flash knowledge level.  As far as I know, if the MP3 is in a movieclip, stopping that clip will also stop the MP3.  If that's just dead wrong and what I'm trying to do will never work, please just let me know so I can struggle in another direction.
    What I'd prefer though would be the coding to make this button work.  I've tried a wide variety of ways to code something that seems like it should be so simple, and keep getting the error "Access of undefined property muteBtn".  I'm assuming this means it can't find the muteBtn in the nested layer.  How do I better define the muteBtn?  Do I then need to add something else that more clearly defines where the clip I want it to stop is since it is nested too?  PLEASE HELP ME!! Thank you in advance!
    Some of what I've tried:
    function endMusic(e:Event):void {
        ecard.backmusic.stop();
    or
    function endMusic(e:Event):void {
        backmusic.stop();
    with...
    muteBtn.addEventListener(MouseEvent.CLICK, endMusic);

    When you target objects, you need to consider the path to the object based on where you are trying to target from.  So if your code is in the main timeline and your button is inside a movieclip, then you need to target the button via the movieclip...
       movieclipName.muteBtn.addEventListener(MouseEvent.CLICK, endMusic);
    As far as stopping a moiveclip resulting in stopping a sound from playing, it is not likely to work.  To stop a sound you need to target the sound to stop it.

  • How can i assign an identifier to a movieclip using AS2 ???

    Hey guys, i'm using the scrolling pane component in my
    project. i used to enter in the content path, the identifier of the
    movieclip which i set through the library. But now i wanna give it
    a movie clip that i've created in my code...so how can i assign an
    identifier to a movieclip using AS2 so that i can use it with my
    componenets ???? THANX

    I'm trying to make a script that goes through a folder recursively, checks for every folder if it's name is "template", and if so it changes the icon of that folder to an icon
    I chose.
    I searched for an answer here, and I've only managed to find a way to assign an icon to a shortcut, but not to an existing file.
    Thanks in advance (:

  • Using variables in paths to objects

    Hi
    I'm wondering how I can use a string in a declared variable
    for a path to an object. Here's an example:
    On the press of a button a variable is declared:
    _root.nextsection = "news";
    And later on I want to use the string "news" in a path, like
    this (on a frame action):
    if (_root.nextsection == "news") {
    this.nextsection.gotoAndPlay(1);
    As you can see in the second line I'm using the variable name
    as a path... but this doesn't work.
    Any suggestions?
    Thanks

    Depending of where your if statement is, if your
    this.nextsection is the
    same as _root.nextsection, since this is a string and not an
    mc, what it
    does is:
    "news".gotoAndPlay(1).
    If you had a movieclip named news in the _root, then you
    could do:
    _root[_root.nextsection].gotoAndPlay(1) // EQUIVALENT TO
    _root["news"] or
    _root.news
    Other option is:
    var mynextsection_mc = eval("_root." + _root.nextsection) ;
    mynextsection_mc.gotoAndPlay(1);
    Flash will evaluate your constructed string "_root.news" to
    an object and
    return it, if it doesn't match anything, then you will get an
    undefined.
    JG
    "Cetrez" <[email protected]> wrote in
    message
    news:ejqacs$q6r$[email protected]..
    > Hi
    >
    > I'm wondering how I can use a string in a declared
    variable for a path to
    > an
    > object. Here's an example:
    >
    > On the press of a button a variable is declared:
    >
    > _root.nextsection = "news";
    >
    >
    >
    > And later on I want to use the string "news" in a path,
    like this (on a
    > frame
    > action):
    >
    > if (_root.nextsection == "news") {
    > this.nextsection.gotoAndPlay(1);
    >
    > }
    >
    > As you can see in the second line I'm using the variable
    name as a path...
    > but
    > this doesn't work.
    >
    > Any suggestions?
    > Thanks
    >

  • Tween or Motion path for blank keynote with animated stars?

    I create star particle effect from this tutorial: http://www.schoolofflash.com/2008/03/flash-cs3-particle-effect/ and got help from this discussion: http://forums.adobe.com/message/5518425 in order to get what I wanted. My code is:
    var starsArray:Array = new Array();
    var myTimer:Timer = new Timer(50);
    myTimer.addEventListener(TimerEvent.TIMER, addStars);
    myTimer.start();
    addEventListener(Event.ENTER_FRAME, moveStars);
    function addStars(e:TimerEvent):void
              var star:Stars = new Stars();
              star.x = stage.stageWidth / 2;
              star.y = stage.stageHeight / 2;
              star.alpha = Math.random() * .8 + .2;
              star.scaleX = star.scaleY = Math.random() * .8 + .2;
              star.xMovement = Math.random() * 10 - 5;
              star.yMovement = Math.random() * 10 - 5;
              starsArray.push(star);
              addChild(star);
              star.cacheAsBitmap = true;
    function moveStars(e:Event):void
              for each (var star:MovieClip in starsArray)
                        star.x += star.xMovement;
                        star.y += star.yMovement;
                        star.alpha -= .01;
                        star.scaleX = star.scaleY -= .01;
                        if (star.scaleX <= 0)
                                  kill(star);
    function kill(star:MovieClip):void
              starsArray.splice(starsArray.indexOf(star), 1);
              removeChild(star);
    However, I wanted to move the star particles around. The problem is that the star isn't on the screen, but is called in the actions in the blank keynote. I don't know what I should do next to get the result. I looked up online for tweens and motion paths but all i see is that they required the star to be right on the screen, I think? I also heard something about the compiled clip but I don't know how I should go about creating one and using it to move around the stars while it's animated with all the actionscript. All I wanted is for the star particles to float around the screen (on a path that I can draw out if possible).....

    Each star is created in the addStars function. Its position is set in the first two lines:
         star.x = stage.stageWidth / 2;
         star.y = stage.stageHeight / 2;
    So, to move each star to a new location when it appears on the stage, you'll need to change the x and y property values for each star. One simple way to do that is to use that same Math.random() function.
    Try changing those first two line to:
              star.x = Math.random() * stage.stageWidth;
              star.y = Math.random() * stage.stageHeight;

  • Problem in Loading a File on the MovieClip..

    I want to load an image on the MovieClip at run time..
    This should be done using file reference Class instance..
    By this user can brwose the file load whatever he wants..
    I had tried this but when user select the file in code we
    just have name of the file not whole path..
    So to load an image on movieClip we require the whole path..
    Any one knows how I can achive this...??
    Thanks...

    You have to upload it with FileReference.upload() to a PHP
    (or other server-side) script which saves it to a folder on the
    server. When the DataEvent.UPLOAD_COMPLETE_DATA event has been
    dispatched you can then use the FileReference.name to load from the
    file on the server just like any other image.

  • MovieClip(parent).function throws error TypeError: Error #1034:

    The error says there is a forced conversion of a loader to a movieclip.
    I am using a container movie main.swf to load a child movie. The child movie tries to access a variable and a function in main.swf
    child.swf contains:
    import flash.display.Loader;
    import flash.display.MovieClip;
    import flash.events.Event;
    MovieClip(parent).traceF;
    MovieClip(parent).globalVar;
    The loader Main movie is movie.swf which has its code in a Main.as doc
    package
    import flash.display.Loader;
    import flash.display.MovieClip;
    import flash.net.URLRequest;
    import flash.events.ProgressEvent;
    import flash.events.Event;
    public class Main extends MovieClip
    public var globalVar:String = "global";
    public var myLoader:Loader = new Loader ();
    public function Main()
    this.addEventListener(Event.ADDED_TO_STAGE,init);
    private function init(e:Event):void
    loadFile("child.swf");
    private function loadFile(path:String):void
    var myRequest:URLRequest = new URLRequest(path);
    myLoader.load(myRequest);
    myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
    myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
    private function loadProgress(evt:ProgressEvent):void
    var amountLoaded:Number = (evt.bytesLoaded / evt.bytesTotal)*100;
    trace("Loading: % " + amountLoaded);
    private function loadComplete(evt:Event):void
    trace("Complete - " + evt.target.content);
    addChild(myLoader);
    public function traceF ()
    trace(globalVar);

    If you are loading the swf into another swf using the Loader class, the Loader is the parent of the loaded file.  The parent of the Loader is the main swf you are probably after... MovieClip(parent.parent) from the loaded file's perspective.

  • Loading a Photoshop Web Photo Gallery into a Flash Movieclip

    I created a photogallery in Photoshop, but I want it to load
    into a movieclip in Flash and not load into it's own page. When I
    use the loadMovie() command I get an error opening the
    galleryconfig.xml file. When I move that file into the main web
    page file, I then get an error opening the photos.xml file. So I
    move that too into the main web page file. And then I get the error
    opening thumbnails/.jpg. Any ideas? I'm pretty sure it's a pathing
    issue since the gallery works fine on it's own. But I'm not sure
    what I need to change to get it to work when it imports. Any help
    would be much appreciated.
    thanks,
    liz

    Hi,
    I am not sure that this will help, as i never tried to do
    what you are doing, But, i think your best option woul be to create
    the pic/gallery in flash and i would think that would solve your
    problem.
    In Flash 8 there is a premade photo Gallery all you need to
    do is to add the pics.
    Otherwise, you can create yours in flah!!
    Hope this helps!
    G.

  • Adding "loading" movieclip to dynamic image gallery?

    Hello again,
    I've completed my XML-driven image gallery, however upon live testing I'd realized I made a rookie mistake and not put some kind of placeholder "loading" movie clip loop while the thumbnails—and subsequent full-size images—are being loaded. The images will randomly appear when loaded and I would like to be able to insert a placeholder movie clip while they load, and swap them up with the thumbnails/images after it has been loaded. The placeholder movie clip is in my library (loadingLoop), but I'm having problems getting it to work correctly.
    Below is the original function that processes the XML and adds the thumbnail images; this is where I'm trying to insert the placeholder movie clip per XML child node (every attempt I've made just keeps throwing more errors, so I've omitted my attempts to avoid confusion), and I've attached the XML file for testing. And insight or help would be appreciated.
    //Locate the external XML file and trigger xmlLoaded when complete
    xmlLoader.load(new URLRequest("data/artGallery.xml"));
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
    //Load the XML and process the image locations
    function xmlLoaded(event:Event):void {
        xml = XML(event.target.data);
        //parse the nodes in the XML file
        xmlList = xml.children();
        //count the number of nodes in the XML file via XMLList
        trace(xmlList.length());
        //loop to load all of the thumbnails, based on the number of nodes in XMLList
        //"i" = every child node in the XML file
        for (var i:int = 0; i < xmlList.length(); i++) {
            //Add loadingLoop movie clip per node and wait for thumnail to load before swapping out with imageLoader thumbnail images <-- help!!
            //for every node, create a new instance to be put on stage
            imageLoader = new Loader();
            //load each thumbnail from its location per XML node's "thumb" attribute
            imageLoader.load(new URLRequest(xmlList[i].attribute("thumb")));
            //position of thumbnail instances per XML node (horizontally across stage)
            imageLoader.x = i * 110 + 10;//thumbs are 100 x 100 so, +10 to the width, plus +10 from left edge
            //imageLoader.y = 10;
            //for each node in XML list, name the instance with the path to the location of the full size image
            imageLoader.name = xmlList[i].attribute("source");
            //for each node in the XML list, add a drop shadow
            imageLoader.filters = [thumbDShadow];
            //add thumbnails to stage
            addChild(imageLoader);
            dropTween = new Tween(imageLoader, "y", Bounce.easeOut, -100, 10, 1, true);
            //set up thumbnails to wait for a click to execute showPicture
            imageLoader.addEventListener(MouseEvent.CLICK, showPicture);
            //set up thumbnails to scale when rolled over
            imageLoader.addEventListener(MouseEvent.ROLL_OVER, sizeUP);

    Somehow I had a feeling this wouldn't be a copy-and-paste job for the full-size images. Sorry to be a bother. This is the showPicture function that is fired off when the thumbnail image is clicked (from our previous example). Two errors are thrown:
    When the thumnail is clicked:
    "Error #2007: Parameter child must be non-null.
        at flash.display::DisplayObjectContainer/removeChild()
        at MethodInfo-51()"
    But the full-size image loads nonetheless. The second loading loop (loadingLoop2) is not removed. Below is the showPicture function:
    //Load the full-size images and place onto the stage
    function showPicture(event:MouseEvent):void {
        //add new movie clip container
        var mc2:MovieClip = new MovieClip();
        addChild(mc2);
        //clear the fullLoader—this is to help clear any full-size images that may already be on the stage (they have two options, click a new thumbnail, or close the current full-size image
        fullLoader.unload();
        //re-create the fullLoader, if there was one cleared
        fullLoader = new Loader();
        //load each full size image from its location per XML node's "source" deliniated by mc.ldr's "source" attribute
        fullLoader.load(new URLRequest(event.target.name));
        //add the loder to the container
        mc2.addChild(fullLoader);
        //create new instance of second loading loop
        mc2.fsloop = new loadingLoop2();
        //add the second loading loop to the container
        mc2.addChild(mc2.fsloop);
        //for each container, add a drop shadow
        mc2.filters = [fullDShadow];
        //set the container's position center on stage, making it the size of the loading loop until the full-size images are loaded
        mc2.x = (stage.stageWidth - mc2.fsloop.width) * 0.5;
        mc2.y = (stage.stageHeight - mc2.fsloop.height) * 0.5;
        //place container on stage
        addChild(mc2);
        //fade in each container
        fadeTween = new Tween(mc2, "alpha", None.easeNone, 0, 1, 0.5, true);
        //check to see if the image has been loaded completely—this is to make sure the image's attributes can be used to re-center on stage and remove fsloop
        fullLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, removeLoop2);
        //set field to multiline so that the <br> HTML tags can be used
        imageTextField.multiline = true;
        //add text frame for description
        imageTextField.x = 10;
        imageTextField.y = 125;
        //for each full-size image, load the description text from the XML child nodes
        for (var j:int = 0; j < xmlList.length(); j++) {
            //check to make sure that the correct full-size image matches the text node when clicked
            if (xmlList[j].attribute("source") == event.target.name) {
                //add each child node as a separate line in the same text field; added HTML tags for CSS application
                imageTextField.htmlText = "<p><span class = 'projectName'>" + xmlList[j].child("projectName") + "</span><br>"
                + "<span class = 'toolsUsed'>" + xmlList[j].child("toolsUsed") + "</span><br><br>"
                + xmlList[j].child("projText") + "<br>"
                + "<span class = 'liveURL'>" + xmlList[j].child("liveURL") + "</span></p>";
        function removeLoop2(event:Event):void {
            //re-position the container to center on stage to accomodating the full sized image
            mc2.x = (stage.stageWidth - fullLoader.width) * 0.5;
            mc2.y = (stage.stageHeight - fullLoader.height) * 0.5;
            //Add the text field
            addText();
            //hide instructional text, already on stage
            galleryInfo_mc.alpha = 0;
            //remove the full-sized loading loop
            event.target.loader.parent.removeChild(MovieClip(event.target.loader.parent).loadingLoop2 );
        //set up full-size images to "self close" by clicking on it
        mc2.addEventListener(MouseEvent.CLICK, clearStage);
    The second error gets thrown when the container is clicked and the function clearStage is executed, which does not remove the container:
    "TypeError: Error #2007: Parameter child must be non-null.
        at flash.display::DisplayObjectContainer/removeChild()
        at artGallery_v1_5_fla::MainTimeline/clearStage()"
    This is the clearStage function:
    //Allow full-size image to "self close" by clikcing on it and removing the text description
    function clearStage(event:MouseEvent):void {
        //clear the fullLoader
        fullLoader.unload();
        //remove the container
        event.target.parent.removeChild(MovieClip(event.target.parent).mc2);
       //remove the text field
        removeChild(imageTextField);
        //show the instructional text that is on-stage
        galleryInfo_mc.alpha = 1;
    Help!

  • Invisible text in nested movieclip

    Hi every one!
    Is it somehow possible to display dynamic text that is first
    loaded into a container (movieclip) in one .swf which is then
    loaded into a container i another .swf? I've tried to do this but
    without any luck so far. Ive embedded both the font (Arial) and
    characters used, which did not do the trick...
    Can someone please help me?

    Hi!
    Thanks for the fast reply :-)
    Yes i use the setTextFormat for the links in the .as file. I
    tried to out comment it and it only changed the formatting of the
    text when i publish find_job.swf, when I run it through the main
    menu (the parent file) there is still no text visible...
    I didn't use htmlText for the links, so I thought that maybe
    that was the problem, but when I change the text to htmlText and
    set it to true there is no difference.
    I'm not a programmer (far from it) so in order to find out if
    it was problems in the code, I've tried to make some simple test
    files. I have a parent swf (loadText.swf) with a container
    ("container") which loads textfile.swf. Textfile.swf holds a
    dynamic textfield, that I entered text into, and the same problem
    occurs. I don't know if it's a path-problem or...?

  • Class object path?

    Hi
    I have created my own class. Lets say I called it
    vector
    I need refference to object this class, but after refering to
    this object it retuns
    [object Object] insted of full path
    I want my class object acting execty as MC class objects.
    What should I add to my class?
    I need this, becouse I want keep reference to object in array
    to loop through then, delete objects and knew witch objest is
    "active" at the moment
    example:

    micahkoga,
    > If you would like your class to behave like a movie clip
    > then your class must extend the movieclip class:
    As I understand it, the panell is only looking for an
    understanding of
    object references; I hear no intention (or need) to extend
    MovieClip.
    panell,
    The reason your trace shows [object Object] is because that
    string --
    "[object Object]" -- is the default toString() output of all
    objects. If
    you want your object's trace() output to be something else,
    you'll have to
    give it a toString() method.
    Out of curiosity, why do you need the object to return its
    reference
    path? If you already know the path (which, of course, you do
    -- because you
    traced the object), then you already know it.
    David
    stiller (at) quip (dot) net
    Dev essays:
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Multiple MovieClips Loading SWF From Same Array (Posted Code)

    Hey there,
    I'm currently working on a project that has eight separate movieclips (for loading content) on separate layers.  I have placed code in these mc's to randomly draw from the same array of 61 different swf's.  Each mc randomizes the array just fine, but here's the problem.  The code works great for one instance, but as soon as I add the code (including renaming) to the other mc's, the swf won't load/play.  I am not getting an compiler errors, and am kinda stuck as to what the problem may be.  Here's an example of the code I'm using.  It is the same for each mc, except I'm renaming the variables as well as the instances for each mc.  Thanks for any suggestions.
    Mike
    //filename = new Array("screen1.swf","screen2.swf","screen3.swf","screen4.swf","screen5.swf","screen6.swf" ,"screen7.swf","screen8.swf","screen9.swf","screen10.swf","screen11.swf","screen12.swf","s creen13.swf","screen14.swf","screen15.swf","screen16.swf","screen17.swf","screen18.swf","s creen19.swf","screen20.swf","screen21.swf","screen22.swf","screen23.swf","screen24.swf","s creen25.swf","screen26.swf","screen27.swf","screen28.swf","screen29.swf","screen30.swf","s creen31.swf","screen32.swf","screen33.swf","screen34.swf","screen35.swf","screen36.swf","s creen37.swf","screen38.swf","screen39.swf","screen40.swf","screen41.swf","screen42.swf","s creen43.swf","screen44.swf","screen45.swf","screen46.swf","screen47.swf","screen48.swf","s creen49.swf","screen50.swf","screen51.swf","screen52.swf","screen53.swf","screen54.swf","s creen55.swf","screen56.swf","screen57.swf","screen58.swf","screen59.swf","screen60.swf","s creen61.swf");
    //i = filename.length;
    //k=random(i)
    //_root.movieTarget.loadMovie(filename[k]);
    //movieTarget._xscale=80;
    //movieTarget._yscale=80;
    var fileNames:Array = ["screen1.swf","screen2.swf","screen3.swf","screen4.swf","screen5.swf","screen6.swf","scr een7.swf","screen8.swf","screen9.swf","screen10.swf","screen11.swf","screen12.swf","screen 13.swf","screen14.swf","screen15.swf","screen16.swf","screen17.swf","screen18.swf","screen 19.swf","screen20.swf","screen21.swf","screen22.swf","screen23.swf","screen24.swf","screen 25.swf","screen26.swf","screen27.swf","screen28.swf","screen29.swf","screen30.swf","screen 31.swf","screen32.swf","screen33.swf","screen34.swf","screen35.swf","screen36.swf","screen 37.swf","screen38.swf","screen39.swf","screen40.swf","screen41.swf","screen42.swf","screen 43.swf","screen44.swf","screen45.swf","screen46.swf","screen47.swf","screen48.swf","screen 49.swf","screen50.swf","screen51.swf","screen52.swf","screen53.swf","screen54.swf","screen 55.swf","screen56.swf","screen57.swf","screen58.swf","screen59.swf","screen60.swf","screen 61.swf"]
    fileNames.sort(function () {
        return Math.round(Math.random());
    trace("Random array: " + fileNames);
    var currentMovieNum:Number = 0    ;
    this.createEmptyMovieClip("container", _root.getNextHighestDepth());
    var mcl:MovieClipLoader = new MovieClipLoader();
    var mclListener:Object = new Object();
    mcl.addListener(mclListener);
    mclListener.onLoadInit = function(movieTarget:MovieClip) {
        trace("Preparing to play: " + fileNames[currentMovieNum]);
    movieTarget.loadClip(fileNames[currentMovieNum], container);
    movieTarget._xscale=80;
    movieTarget._yscale=80;
    this.onEnterFrame = function() {
        if (currentMovieNum == fileNames.length) {
            currentMovieNum = 0;
        } else {
            if (movieTarget._currentframe == movieTarget._totalframes) {
                mcl.loadClip(fileNames[currentMovieNum], movieTarget);
                currentMovieNum++;

    Thanks for taking a look at this.  The randomizer seems to work just fine, as here is a sample output from the trace:
    Random array: screen47.swf,screen2.swf,screen57.swf,screen21.swf,screen9.swf,screen49.swf,screen36.swf, screen17.swf,screen6.swf,screen59.swf,screen15.swf,screen12.swf,screen33.swf,screen25.swf, screen42.swf,screen22.swf,screen24.swf,screen40.swf,screen11.swf,screen19.swf,screen32.swf ,screen35.swf,screen7.swf,screen39.swf,screen23.swf,screen4.swf,screen1.swf,screen48.swf,s creen31.swf,screen45.swf,screen29.swf,screen18.swf,screen51.swf,screen14.swf,screen34.swf, screen10.swf,screen38.swf,screen26.swf,screen16.swf,screen13.swf,screen55.swf,screen37.swf ,screen44.swf,screen61.swf,screen43.swf,screen20.swf,screen28.swf,screen30.swf,screen56.sw f,screen50.swf,screen54.swf,screen53.swf,screen46.swf,screen58.swf,screen41.swf,screen8.sw f,screen5.swf,screen52.swf,screen3.swf,screen60.swf,screen27.swf
    Might you be able to lead me down a better path?  I'm currently unable to get this to function for multiple symbols.  The previous is the code that I've placed on the first keyframe of a movieclip with an instance name of movieTarget.  Works swimmingly for one, but once the code is placed on the other symbols on different layers, it seems to only work on the lowest layer in the project.
    M

Maybe you are looking for

  • WE8S Flash problems in IE

    I have created a Windows Embedded 8 Standard 64 bit image. I added Adobe Flash Player 11 Support application support feature module (there are no settings for this module) to the image and IE 10. When the system runs and IE is executing Flash player

  • MS SQL2000 Driver for JAVA

    Does anyone use MSSQL2000 Driver for JAVA? I wrote a store procedure which returns multiple resultset. And I wrote a program to retrive all resultsets from it. It works fine with JDBC/ODBC Bridge Driver. But i got problem with MSSQL2000 Driver by usi

  • CRMD_ORDER_Longer time

    Hi friends, We have upgraded from CRM 2.0 to 3.0 and 3.0 to 4.0 and from 4.0 to 5.0. Two days before we have gone live, two days everthing was working fine but unfortunately system performance went very slow when iam executing CRMD_ORDER, system is t

  • Blurtooth in new iphone 3Gs

    I have just bought bought the new iphone and love it dearly except the fact that I can't get the Bluetooth to work. It will turn on but only says 'searching' continuously. Other phones can find it but, they aren't allowed to connect with it. It would

  • Attachment for PO

    Hello I m new in the SAP Net Weaver Business Client. 1. I wonder how to attach a document in transaction ME21n, ME22N. I do not see the icon service object or any menu related to this. Is there anything to activate to have it in the netweaver??? 2. J