TypeError: Error #1034 - Want to display a swf

Hi,
I´m new to AS3 and try to load/display swf´s on the stage. The swf´s should run and if the user clicks a button the next swf should be displayed.
That works so far if I use some swf´s that are created also with FlashPlayer 9 and AS3. But if I use a swf created by someone else I get a TypeError: Error #1034. So far, I have no idea why this happens. Maybe you can have a look at my code and give me a hint. Thanks in advance.
var configfile = "test.xml";
var xml_url:String = configfile;
var urlLoader:URLLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, setClips);
var xml:XML;
var currentClip:int = 0;
var clips:Array = new Array(); btnPrevious.addEventListener(MouseEvent.CLICK, previousClip);
setChildIndex(btnPrevious,1);
btnNext.addEventListener(MouseEvent.CLICK, nextClip);    
setChildIndex(btnNext,1);
function setClips(e:Event) {
    this.xml = new XML(e.target.data);
    this.playClip(this.currentClip);
function playClip(index:Number) {              
    if (!this.clips[index]) {           
        var request:URLRequest = new URLRequest(this.xml.item[index]);           
        var loader:Loader = new Loader();
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.setMovieClip);    
        loader.load(request);
    else {
        this.currentClip = index;              
     this.clips[this.currentClip].play();    
        this.addChild(this.clips[this.currentClip]);
        setChildIndex(this.clips[this.currentClip],0);              
        this.clips[this.currentClip].addEventListener(Event.ENTER_FRAME, this.onEnterFrameCheck);
function nextClip(e:MouseEvent) {
     this.clips[this.currentClip].gotoAndStop(0);
        this.removeChild(this.clips[this.currentClip]);
     this.currentClip = this.currentClip + 1;    
     if(this.currentClip == this.xml.item.length()) {
          this.currentClip = 0;
     this.playClip(this.currentClip);    
function previousClip(e:MouseEvent) {
    this.clips[this.currentClip].gotoAndStop(0);
    this.removeChild(this.clips[this.currentClip]);
    this.currentClip = this.currentClip - 1;
    if(this.currentClip == -1) {
       this.currentClip = this.xml.item.length() - 1;    }         this.playClip(this.currentClip);    
function setMovieClip(e:Event):void {    this.clips[this.currentClip] = MovieClip(e.target.loader.content);
    this.addChild(this.clips[this.currentClip]);
    setChildIndex(this.clips[this.currentClip],0);  
    this.clips[this.currentClip].addEventListener(Event.ENTER_FRAME, this.onEnterFrameCheck);
function onEnterFrameCheck(e:Event):void {
    if(this.clips[this.currentClip] && this.clips[this.currentClip].currentFrame == this.clips[this.currentClip].totalFrames) {
        this.clips[this.currentClip].gotoAndStop(0);    
        this.clips[this.currentClip].removeEventListener(Event.ENTER_FRAME, this.onEnterFrameCheck);         
        this.removeChild(this.clips[this.currentClip]);    
        if(this.currentClip >= this.xml.item.length()-1) {
             this.currentClip = -1;
     }                               this.currentClip++;              
        this.playClip(this.currentClip);
urlLoader.load(new URLRequest(this.xml_url)); 
stop();
And here The XML:
<banners>
<item>banner1.swf</item>
<item>banner2.swf</item>
<item>banner3.swf</item>
</banners>
The full Error Message (In German:)
TypeError: Error #1034: Typumwandlung fehlgeschlagen: flash.display::AVM1Movie@34d4df9 kann nicht in flash.display.MovieClip umgewandelt werden.
    at teaser_fla::MainTimeline/setMovieClip()

The problem will be related to trying to manipulate an AS1/AS2 file using AS3... it cannot be done.  In this case, you are probably just seeing the first of a few errors where you try to manipulate an AS2 object by trying to cast it as an AS3 MovieClip object.  You would run into problems later when you try controlling/reading that same file (currentFrame is not an AS1/AS2 property, but you attempt to extract it).
Per the Flash Help documentation...
"ActionScript 3.0 code can load a SWF file written in ActionScript 1.0 or 2.0, but it cannot access the SWF file's variables and functions. "
You can implement the LocalConnection class to overcome some of the issues, but if you are using other people's files, you are likely to hit a wall...
"LocalConnection objects created in ActionScript 3.0 can communicate with LocalConnection objects created in ActionScript 1.0 or 2.0.
The reverse is also true: LocalConnection objects created in ActionScript 1.0 or 2.0 can communicate with LocalConnection objects created in ActionScript 3.0. Flash Player handles this communication between LocalConnection objects of different versions automatically."

Similar Messages

  • Flash CS4 - Images in gallery will not show- TypeError: Error #1034: Type Coercion failed: cannot co

    So for my A2 studies I have to make an interactive product using flash. Long story short, I needed to make a flash gallery. I am using the "Zen Gallery Flash Component" and this is my code;
    galleryInstance.albums=[                                                             {                                                                         imagesFolder:"N:\ICT\ICT Unit 10\Prototype 3\images",                                                                       icon:"4.jpg",                                                                       items:                                                                       [                                                                                 {source:"1.jpg"},                                                                                 {source:"2.png"},                                                                                 {source:"3.jpg"},                                                                                 {source:"4.jpg"},                                                                                 {source:"5.jpg"}                                                                       ]                                                             },                                                             {                                                                       imagesFolder:"N:\ICT\ICT Unit 10\Prototype 3\images",                                                                       icon:"8.jpg",                                                                       items:                                                                       [                                                                                 {source:"6.png"},                                                                                 {source:"7.jpg"},                                                                                 {source:"8.jpg"},                                                                                 {source:"9.jpg"},                                                                                 {source:"10.jpg"}                                                                       ]                                                             }                                                             ]; galleryInstance.build(); 
    The user manual does not specify any more coding is needed (I read all the relevant parts and couldn't find anything). The problem is that my images do not show but when exporting the flash product, the gallery is fully functionon - it seems that it cannot locate my images.
    In addition to this, I get multiple Output Errors;
    TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::IOErrorEvent@2d09a709 to Error. TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::IOErrorEvent@2d09a709 to Error. TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::IOErrorEvent@2d09a709 to Error.etc..
    What am I doing wrong?

    I'm not sure, the gallery just appeares to be an SWF.
    This is all that came up when I clicked it (I had a look at the parameters and they don't seem to help in the addition of pictures).
    There appears to be no forum for this flash component :L

  • 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.

  • ActionScript 3.0: Error #1034: Type Coercion failed: cannot convert displayObject$ to DefaultPackage

    I'm a student I have a final project want to deliver it after two days.
    I'm making a drag and drop game, I watched a tutorial to do that.
    But after ending coding I faced a weird error!
    I've I checked that my code is the same as the code in the tutorial.
    This is the Debug error report:
        Attempting to launch and connect to Player using URL E:\FL\ActionScript\Drag and Drop Project\DragAndDrop.swf
        [SWF] E:\FL\ActionScript\Drag and Drop Project\DragAndDrop.swf - 87403 bytes after decompression
        TypeError: Error #1034: Type Coercion failed: cannot convert paper1$ to DragDrop.
                  at Targets()[E:\FL\ActionScript\Drag and Drop Project\Targets.as:23]
    My `.fla` File is containing 12 Objects to drag and another 12 Objects to drop on it.
    The idea here is when drop the Object on the target the Object will become invisible and the target become visible (in `.fla` file `target alpha = 0`).
    I made two classes:
    DragDrop.as : for the objects that I'm going to drag.
    Targets.as  : for the targets that I'm going to drop Objects on it.
    Note: match function is to animate "GameOver" MovieClip When complete the game.
    DragDrop.as:
        package
                  import flash.display.*;
                  import flash.events.*;
                  public class DragDrop extends Sprite
                            var origX:Number;
                            var origY:Number;
                            var target:DisplayObject;
                            public function DragDrop()
                                      // constructor code
                                      origX = x;
                                      origY = y;
                                      addEventListener(MouseEvent.MOUSE_DOWN, drag);
                                      buttonMode = true;
                            function drag(evt:MouseEvent):void
                                      stage.addEventListener(MouseEvent.MOUSE_UP, drop);
                                      startDrag();
                                      parent.addChild(this);
                            function drop(evt:MouseEvent):void
                                      stage.removeEventListener(MouseEvent.MOUSE_UP, drop);
                                      stopDrag();
                                      if(hitTestObject(target))
                                                visible = false;
                                                target.alpha = 1;
                                                Object(parent).match();
                                      x = origX;
                                      y = origY;
    Targets.as:
        package
                  import flash.display.*;
                  import flash.events.*;
                  public class Targets extends MovieClip
                            var dragdrops:Array;
                            var numOfMatches:uint = 0;
                            var speed:Number = 25;
                            public function Targets()
                                      // constructor code
                                      dragdrops = [paper1,paper2,paper3,paper4,paper5,paper6,
                                                                     paper7,paper8,paper9,paper10,paper11,paper12,];
                                      var currentObject:DragDrop;
                                      for(var i:uint = 0; i < dragdrops.length; i++)
                                                currentObject = dragdrops[i];
                                                currentObject.target = getChildByName(currentObject.name + "_target");
                            public function match():void
                                      numOfMatches++;
                                      if(numOfMatches == dragdrops.length)
                                                win.addEventListener(Event.ENTER_FRAME, winGame);
                            function winGame(event:Event):void
                                      win.y -= speed;
                                      if(win.y <= 0)
                                                win.y = 0;
                                                win.removeEventListener(Event.ENTER_FRAME, winGame);
                                                win.addEventListener(MouseEvent.CLICK, clickWin);
                            function clickWin(event:MouseEvent):void
                                      win.removeEventListener(MouseEvent.CLICK, clickWin);
                                      win.addEventListener(Event.ENTER_FRAME, animateDown);
                                      var currentObject:DragDrop;
                                      for(var i:uint = 0; i < dragdrops.length; i++)
                                                currentObject = dragdrops[i];
                                                getChildByName(currentObject.name + "_target").alpha = 0;
                                                currentObject.visible = true;
                                      numOfMatches = 0;
                                      addChild(win);
                            function animateDown(event:Event):void
                                      win.y += speed;
                                      if(win.y >= stage.stageHeight)
                                                win.y = stage.stageHeight;
                                                win.removeEventListener(Event.ENTER_FRAME, animateDown);
    ...Thanks

    Thank you very much for replying.
    - dragdrops represents: the dragable objects.
    - Targets obtaining the dropable objects by hitTestObject, then the dropable objects visible is turned to false, & the target visible turned to true.
    Dragable objects is a 12 elements all of them have an instance names: paper1....paper12.
    When I focused to the project I noticed that I forget to give the dragable objects an instance names!
    after making the instance names to them, a new error occures:
    E:\FL\ActionScript\Drag and Drop Project\Targets.as, Line 11
    1046: Type was not found or was not a compile-time constant: paper1.
    This error is continuing to paper2, paper3.....paper12 !
    Please download my project, I must deliver it to my college in 24/12. I will never forget your favor. thanks.
    https://www.dropbox.com/s/8mdg5w17vvryzso/Drag%20and%20Drop%20Project.rar | 715KB

  • Problem with stage and Error #1034

    Hi!
    Well I'm newbie in AS, writing it only for a 5 days and I've come across error which gives me a lot headache. I was searching for solution to it for quite some time now and didnt understand what I suppose to do with solution.
    So, here is my problem if someone is willing to take a look at it.
    Error:
    TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@ef6fb51 to flash.display.MovieClip.
    at Association_fla::MainTimeline/frame30()
    at flash.display::MovieClip/gotoAndStop()
    at Association_fla::Association_12/prikazi()
    at MethodInfo-32()
    I have a lot of layers and movieclips inside my fla and so pasting all of my code isn' t an option, cause there is a lot of newb, memory wasting programming it could take hours for someone to look into it.
    Problem here is, if I understood it right, that my stage isn't a movieclip as I referenced it, most probably in this section of code:
    MovieClip(parent).gotoAndPlay("result");    //  in  stage / association_mc
    Didn't have that error while doing same thing in other movieclips like:
    MovieClip(parent).gotoAndPlay("home");  //  in  stage / instructions_mc
    And last question is: How can reference my main stage? I'm using MovieClip(parent) to get to it, but I see that everyone using just stage object from Stage class
    Thank you in advance!
    Mario

    also reports call to undefined method :/
    1061: Call to a possibly undefined method gotoAndPlay through a reference with static type flash.display:DisplayObjectContainer.
    edit:
    After numerous checking code all over again and testing and tracing everything i found out that problem occurs when going to result label at Frame 31 when playing the result_mc movie.
    going from different movieclip to it gives this errors
    TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@ea9fb51 to flash.display.MovieClip.
    at Association_fla::MainTimeline/frame30()
    at flash.display::MovieClip/gotoAndPlay()
    at Association_fla::Association_12/prikazi()
    at MethodInfo-32()
    TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@1fc76b51 to flash.display.MovieClip.
    at Association_fla::MainTimeline/frame30()
    at flash.display::MovieClip/gotoAndStop()
    at Association_fla::Home_2/gotoA()
    TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@1fc59b51 to flash.display.MovieClip.
    at Association_fla::MainTimeline/frame30()
    at flash.display::MovieClip/gotoAndPlay()
    at Association_fla::Highscorescopy_36/gotoM()
    edit2:
    resolved !
    found on one forum this answer, maybe it will help someone else
    I've just had the same problem myself. A bit of detective work revealed that it has nothing to do with the code, but occurs when:
    The swf is being run from a remote server.
    You have a custom class on the stage which has an instance name.
    The class is NOT declared as "Export in first frame".
    An instance of the class doesn't appear on the first frame of the movie.
    So the solution, in my case, was just to tick "Export in first frame" in the library symbol linkage options. This made everything work fine, but if anyone knows why this is then I'd be interested to know.

  • Error 1034: Converting movie clip to instance of a custom object?

    I have several movie clips on the stage that each have unique instance names.
    I need to instantiate them as instances of a custom class I have created. This is giving me an error, and I know I'm probably missing some simple concept somewhere, doing something wrong, but I don't know what it is.
    Here is my code:
    In the main timeline, I have (simplified):
    var puzzleAL:GeoGroup = new GeoGroup ("AL", "Alabama", 1, false);
    puzzleAL.addEventListener(TouchEvent.TOUCH_BEGIN, geoTouchBeginHandler);
    function geoTouchBeginHandler (e:TouchEvent): void {
        e.target.gotoAndStop("Over");
        nameDisplay.gotoAndStop(e.target.abbrev);
        e.target.addEventListener(TouchEvent.TOUCH_END, geoTouchEndHandler);
    function geoTouchEndHandler (e:TouchEvent): void {
        if (e.target.lock == false) {
            e.target.gotoAndStop("Off");
        else if (e.target.lock == true) {
            e.target.gotoAndStop("Lock");
        nameDisplay.gotoAndStop("USA");
        e.target.removeEventListener(TouchEvent.TOUCH_END, geoTouchEndHandler);
    It throws an error before the object is ever instantiated. It compiles, but at runtime I get:
    TypeError: Error #1034: Type Coercion failed: cannot convert Puzzleography_fla::Alaska_2@da0a0f9 to GeoGroup.
         at flash.display::MovieClip/gotoAndStop()
         at Puzzleography_fla::MainTimeline/goToFrame()
    My class code looks like this, if it matters:
    package  {
        import flash.display.MovieClip;
        public class GeoGroup extends MovieClip {
            public var abbrev:String;
            public var fullName:String;
            public var assignedOrder:Number;
            public var lock:Boolean;
            public function GeoGroup(abbrev:String, fullName:String, assignedOrder:Number, lock:Boolean) {
                this.abbrev = abbrev;
                this.fullName = fullName;
                this.assignedOrder = assignedOrder;
                this.lock = lock;
    I'm missing something obvious, I know it, but I'm new to OOP, switching from procedural, so I'm sure I'm getting a concept wrong somewhere.
    Thanks so much!
    Amber

    yes, it makes sense and yes, you'll need to learn a little.
    I have 50 movie clips not linked to any actionscript in the movie.
    that's incorrect.  those movieclips are linked to all the actionscript that applies to their class.  so, even if those movieclips weren't part of the GeoClass, they still have all the properties, methods and events of the movieclip class (created by adobe developers).
    The fact these movieclips are actually GeoGroup objects extending the movieclip class, adds even more code to them.  and, so far that's all good and exactly what you should do.
    They are all on the stage. They are all named with their instance names "puzzleAZ" "puzzleTX" etc.
    no problem, usually.  (but in your case, a problem explained below.)
    I want to be able to add variables to them, such as strings and numbers, so that I can call puzzleAZ.size or puzzleAZ.fullName to get "XX Acres" or "Arizona" returned.
    so, in programming lingo you want your objects to be members of a dynamic (ie, you can add properties) class.  the movieclip class is just such a class.
    I created a separate class (GeoGroup) that extends MovieClip that has in it all the variables I need and tried to assign each movie clip to that class.
    here's the problem.  when you created your GeoGroup class you mandated that certain parameters be passed to the constructor.  when you add a class member (like each of those puzzle pieces) to the stage, the class constructor is invoked (along with everything else in that class).  However, no parameters are passed to your constructor so the flash compiler points out the issue and refuses to run your code.
    there are two ways you could proceed:
    1.  remove the parameters from the constructor
    2.  don't add any class members to the stage in the authoring environment.
    p.s.  this is your GeoGroup constructor:
          public function GeoGroup(abbrev:String, fullName:String, assignedOrder:Number, lock:Boolean) {
                this.abbrev = abbrev;
                this.fullName = fullName;
                this.assignedOrder = assignedOrder;
                this.lock = lock;
    the paramters that contructor requires are 2 strings, one number and one boolean.

  • Error 1034

    i am trying to bring over some classes i made in as2 to as3.
    i've migrated everything appropriately but keep getting this error:
    TypeError: Error #1034: Type Coercion failed: cannot convert
    ball$ to flash.display.MovieClip. at
    test_animateClass_fla::MainTimeline/frame1()
    test_animateClass.fla has a movieclip called 'ball' in its
    library that has linkage set to:
    export for actionscript
    export in first frame
    class: ball
    base class: flash.display.MovieClip
    and the .fla loads an external class into it, Animate, which
    then tries to use addChild() to add a copy of 'ball' to the stage
    when it's created. a movieClip variable is passed into Animate()
    from the .fla, which in this case, is the movieClip 'ball'.
    why does it have this error converting 'ball' to
    flash.display.MovieClip?? ball IS a MovieClip already..

    quote:
    Originally posted by:
    shottogan
    it is able to create a MovieClip from the passed through
    variable with which it then visualizes itself through..
    This is exactly why I don't see the value of this approach.
    Why would you need to create a MovieClip from a passed variable? I
    can see it only if, say, you load an external swf --> get class
    definition from its library --> pass a CLASS into this function
    --> instantiate this class.
    If your Animate class is instantiated in the same swf where
    the ball resides - your approach is a huge overkill because you can
    instantiate ball directly inside Animate class. Based on the name
    of the Animate class I assume you intend to animate a passed
    variable. In this case - why not to instantiate and add to display
    list ball and such in the scope where you instantiate Animate and
    then just animate it? Or just pass an instance and place it in to
    Animate's display list? But, again, since you attempt to place the
    instance into the parent scope - why bother with all these
    difficulties and not to place ball directly in the parent.
    If you do not need to animate the instance - this approach is
    a double overkill IMHO. AS3 handles positioning and other
    DisplayObject properties beautifully. Its like putting microwave
    into an oven to bake a cake inside microwave.
    In any case I feel that something doesn't match up in this
    approach. Of course, there is no information about context in which
    you use it so all my thinking can be wrong.
    By the way, I see a lot of complaints about Adobe removing
    duplicateMovieClip method but so far the more I work with AS3 the
    less I see a necessity for this functionality - things can be
    easily instantiated AS3 native ways.

  • Error #1034 Type Coercion fail with registerClassAlias and nested Vectors

    I'm attempting to use flash.net.registerClassAlias and ByteArray.writeObject in order to serialize/deserialize data with static type information.  It works as you'd expect in the general case but I've run into problems with some nested Vectors that I don't understand.  Hopefully someone can point out if I'm just missing something.
    For what I understand, we must register both the scalar types and a one-deep specification of a Vector for that scalar type in order to use nested Vectors.  For example:
                flash.net.registerClassAlias("TestStructureInner", TestStructureInner);
                flash.net.registerClassAlias("VectorTestInner", Vector.<TestStructureInner> as Class);
    This should allow us to read/write objects of type TestStructureInner, Vector.<TestStructureInner>, and Vector.<Vector.<TestStructureInner>> into ByteArrays.  And in general it seems to work.
    Attached though is a simplified test case that fails, however.  The first time we deserialize the data it works.  The subsequent time, however, we encounter the following runtime error #1034.
        TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@304fcb9 to __AS3__.vec.Vector.<__AS3__.vec::Vector.<Test0.as$30::TestStructureInner>>.
        TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@304fbc9 to __AS3__.vec.Vector.<__AS3__.vec::Vector.<Test0.as$30::TestStructureInner>>.
        TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@304fdd1 to __AS3__.vec.Vector.<__AS3__.vec::Vector.<Test0.as$30::TestStructureInner>>.
        TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@304fce1 to __AS3__.vec.Vector.<__AS3__.vec::Vector.<Test0.as$30::TestStructureInner>>.
        TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@304fbf1 to __AS3__.vec.Vector.<__AS3__.vec::Vector.<Test0.as$30::TestStructureInner>>.
        TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@304fec1 to __AS3__.vec.Vector.<__AS3__.vec::Vector.<Test0.as$30::TestStructureInner>>.
        TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@304fad9 to __AS3__.vec.Vector.<__AS3__.vec::Vector.<Test0.as$30::TestStructureInner>>.
        TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@304fa61 to __AS3__.vec.Vector.<__AS3__.vec::Vector.<Test0.as$30::TestStructureInner>>.
        TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@304f9e9 to __AS3__.vec.Vector.<__AS3__.vec::Vector.<Test0.as$30::TestStructureInner>>.
        TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@304f971 to __AS3__.vec.Vector.<__AS3__.vec::Vector.<Test0.as$30::TestStructureInner>>.
    Re-registering the class aliases again via flash.net.registerClassAlias works in this test case but isn't 100% for our actual application (I'm reticent to even mention it but it seems relevant).  Is there a step I'm missing here?  Any light shed would be appreciated.
    // mxmlc -debug Test0.as
    package
        import Base64; // http://code.google.com/p/jpauclair-blog/source/browse/trunk/Experiment/Base64/src/Base64.a s
        import flash.net.registerClassAlias;
        import flash.events.Event;
        import flash.utils.ByteArray;
        import flash.display.Sprite;
        import flash.display.Stage;
        import flash.system.System;
        public class Test0 extends Sprite
            static private const OPERATION_SERIALIZE:uint = 0;
            static private const OPERATION_DESERIALIZE_AND_FAIL:uint = 1;
            static private const OPERATION_DESERIALIZE_AND_SUCCEED:uint = 2;
            static private var staticStage:Stage;
            private var bar:Vector.<TestStructure>;
    * common functions
            static private function registerClassAliases():void
                flash.net.registerClassAlias("TestStructureInner", TestStructureInner);
                flash.net.registerClassAlias("VectorTestInner", Vector.<TestStructureInner> as Class);
                flash.net.registerClassAlias("TestStructure", TestStructure);
            static public function staticDeserialize():Object
                var byteArray:ByteArray = Base64.decode("EBUAG1Rlc3RTdHJ1Y3R1cmUKEwAHZm9vEAEAH1ZlY3RvclRlc3RJbm5lcgoBEAEABAoBEAEABA oBEAEABAoBEAEABAoBEAEABAoBEAEABAoBEAEABAoBEAEABAoBEAEABA==");
                byteArray.position = 0;
                return byteArray.readObject();
            public function Test0():void
                registerClassAliases();
                // Switching operation between the constants demonstrates failure/success in a couple of different ways.
                // SERIALIZE is just used to prepare the base64 string for subsequent tests.
                var operation:int = OPERATION_SERIALIZE_AND_FAIL;
                if (operation == OPERATION_SERIALIZE)
                    trace("Serializing");
                    // outputs base64 string for subsequent tests
                    serialize();
                else if (operation == OPERATION_DESERIALIZE_AND_FAIL)
                    trace("Fail case");
                    // perform successful one deserialization, then one failing one.
                    deserializeOnceThenFail();
                else if (operation == OPERATION_DESERIALIZE_AND_SUCCEED)
                    trace("Success via re-registration");
                    // perform successful one deserialization, then another successful one.
                    deserializeOnceThenSucceed();
    * serialize
            // outputs base64 string we use for subsequent tests.
            private function serialize():void
                var baz:Vector.<TestStructure> = new Vector.<TestStructure>;
                for (var i:int=0; i<10; ++i)
                    baz.push(new TestStructure);
                var byteArray:ByteArray = new ByteArray;
                byteArray.writeObject(baz);
                trace(Base64.encode(byteArray));
    * deserializeOnceThenFail
            // perform successful one deserialization, then one failing one.
            public function deserializeOnceThenFail():void
                // save stage
                staticStage = stage;
                // the first deserialize will proceed without error.
                staticDeserialize();
                trace("Successful deserialize");
                // add an event listener in order to invoke error on subsequent frame
                stage.addEventListener(Event.ENTER_FRAME, doEnterFrameOnceThenFail);
            // remove event listener and invoke again.
            static private function doEnterFrameOnceThenFail(e:Event):void
                staticStage.removeEventListener(Event.ENTER_FRAME, doEnterFrameOnceThenFail);
                staticDeserialize();
                trace("unsuccessful deserialize2");
    * deserializeOnceThenSucceed
    * Here, we re-call flash.net.registerClassAlias on all our class types when running.
            // perform successful one deserialization, then one failing one.
            public function deserializeOnceThenSucceed():void
                // save stage
                staticStage = stage;
                // the first deserialize will proceed without error.
                staticDeserialize();
                trace("Successful deserialize");
                // add an event listener in order to invoke error on subsequent frame
                stage.addEventListener(Event.ENTER_FRAME, doEnterFrameOnceThenSucceed);
            // remove event listener and invoke again.
            static private function doEnterFrameOnceThenSucceed(e:Event):void
                staticStage.removeEventListener(Event.ENTER_FRAME, doEnterFrameOnceThenSucceed);
                registerClassAliases();
                staticDeserialize();
                trace("successful deserialize2");
    internal class TestStructureInner
              public var value:int;
    internal class TestStructure
              public var foo:Vector.<Vector.<TestStructureInner>> = new Vector.<Vector.<TestStructureInner>>;

    The error would imply that ImageAssetEvent does not inherit
    DisplayEvent. Either modify the inheritance chain or listen for a
    basic Event object (flash.events.Event) and cast inside the
    function.

  • Can't figure out why I'm getting error #1034

    var handsUpChannel:SoundChannel = new SoundChannel();
    var handsUp:Sound = new Sound();
      handsUp.load(new URLRequest("audioFiles/finalAudio/song1.mp3"));
    var watUpChannel:SoundChannel = new SoundChannel();
    var watUp:Sound = new Sound();
      watUp.load(new URLRequest("audioFiles/finalAudio/song2.mp3"));
    var cowboyChannel:SoundChannel = new SoundChannel();
    var cowboy:Sound = new Sound();
      cowboy.load(new URLRequest("audioFiles/finalAudio/song3.mp3"));
    var casualChannel:SoundChannel = new SoundChannel();
    var casual:Sound = new Sound();
      casual.load(new URLRequest("audioFiles/finalAudio/song4.mp3"));
      handsUp.addEventListener(MouseEvent.MOUSE_DOWN, handsUpStart);
      watUp.addEventListener(MouseEvent.MOUSE_DOWN, watUpStart);
      cowboy.addEventListener(MouseEvent.MOUSE_DOWN, cowboyStart);
      casual.addEventListener(MouseEvent.MOUSE_DOWN, casualStart);
    function handsUpStart(event:MouseEvent):void  {
      handsUpChannel = handsUp.play();
    function watUpStart(event:MouseEvent):void  {
      watUpChannel = watUp.play();
    function cowboyStart(event:MouseEvent):void  {
      cowboyChannel = cowboy.play();
    function casualStart(event:MouseEvent):void  {
      casualChannel = casual.play();
    I'm trying to play audio using a MovieClip object. I have multiple other objects with the exact same code, just changing the variables, working perfectly.
    All it says is:
    TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@1327340d1 to flash.media.Sound.
      at flash.display::Sprite/constructChildren()
      at flash.display::Sprite()
      at flash.display::MovieClip()
      at Unit2_AudioFail_fla::MainTimeline()
    help please

    You appear to be naming the buttons the same as the Sound objects.  You will need to define different names for one or the other.

  • I'm getting error 1034

    Error 1034: Type Coercion failed: cannot convert flash.display::MovieClip@2f27ecc1 to fl.video.FLVPlayback.
    I have a FLVPlayback module on the timeline with a working .flv video. When I compile, there are no errors, but the OUTPUT window gets this when I test the movie:
    TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@2f27ecc1 to fl.video.FLVPlayback.
        at flash.display::Sprite/constructChildren()
        at flash.display::Sprite()
        at flash.display::MovieClip()
        at Laser()
        at Laser/frame1()
    Laser is a class in an external package called LaserDevelop.as. There are no functions in the class using an FLV component or referencing the instance name (Stars).
    In frame 1 of the Flash movie timeline, I have this code:
    import flash.events.KeyboardEvent;
    import flash.text.TextField;
    import fl.video.*;
    import flash.display.*;
    import comm.LaserDevelop;
    var LT:Laser = new Laser();  // create instance of Package external code
    stage.addEventListener(KeyboardEvent.KEY_DOWN,LT.keyDownHandler);
    stage.addEventListener(KeyboardEvent.KEY_UP,LT.keyUpHandler);
    Stars.addEventListener(VideoEvent.COMPLETE, rewind);
    function rewind(eventObject:VideoEvent):void
        Stars.autoRewind = true;
        Stars.play();
    Even when I comment out everything from "Stars.addEventListener" down, the same error results.
    Anyone?

    1. Please tell me how to respond from within the forum (can't find a
    "reply" button).
    2. I moved all the code from the external .as file to frame 1 of the
    timeline. After removing the "package" and "public" declarators, the
    code all works fine from inside the timeline.
    For some reason, a package with the same code externally causes
    problems. Is it possible that using an external package for code
    requires every instance on the stage to be called from code making
    things you drag-and-drop to the stage non-functional?
    Michael

  • Adobe Air updater goes Error #1034

    Hi,
    we've packaged an air application with an old version of air runtime that is automatically deployed to our customer computer.
    Everything goes well on install, but when we launch our application, it logically propose our customer to update to the last version of Air.
    The problem is that during the update process of air runtime (our application is still running), we have an error #1034 appearing.
    the Adobe Air Updater logs are the following :
    [2012-01-06:10:40:11] Runtime Installer begin with version 3.0.0.4080 on Windows 7 x86
    [2012-01-06:10:40:11] Commandline is: -silent -eulaAccepted
    [2012-01-06:10:40:11] Installed runtime (3.0.0.4080) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2012-01-06:10:40:11] Runtime Installer end with exit code 0
    [2012-01-06:10:40:42] Launching subprocess with commandline c:\Program Files (x86)\Common Files\Adobe AIR\Versions\1.0\Resources\Adobe AIR Updater -updatecheck
    [2012-01-06:10:40:42] Runtime Installer begin with version 3.0.0.4080 on Windows 7 x86
    [2012-01-06:10:40:42] Commandline is: -updatecheck
    [2012-01-06:10:40:42] Installed runtime (3.0.0.4080) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2012-01-06:10:40:42] Performing pingback request
    [2012-01-06:10:40:43] Pingback request completed with HTTP status 200
    [2012-01-06:10:40:43] Starting runtime background update check
    [2012-01-06:10:40:43] Begin Background update download from http://airdownload.adobe.com/air/3/background/windows/x86/patch/3.0.0.4080/update
    [2012-01-06:10:40:43] Unpackaging http://airdownload.adobe.com/air/3/background/windows/x86/patch/3.0.0.4080/update to C:\Users\ksaidi\AppData\Roaming\Adobe\AIR\Updater\Background
    [2012-01-06:10:40:44] Unpackaging complete
    [2012-01-06:10:40:44] Download success
    [2012-01-06:10:40:44] Runtime updated downloaded
    [2012-01-06:10:40:44] Exiting due to error: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="Unhandled exception TypeError: Error #1034" errorID=1034]
    [2012-01-06:10:41:05] Runtime Installer end with exit code 7
    The most disturbing is that if we close our application and run the updater alone, everything goes well, and our application is running perfectly.
    Anyone have a clue on what is happening?
    Thanks a lot
    Antoine

    I've seen this error before in a few posts, but I don't think I've seen a solution or exact cause.  Are you seeing this on every system you try or is it isolated to particular machines?  If it's occurring everywhere, would you be willing to send me ([email protected]) your installer so I can give it a try?
    Thanks,
    Chris

  • TypeError: Error #1009 (loaded SWF)

    I'm pulling out my hair on this one!
    I'm just starting a site (full-Flash site) using CS3 and AS3.
    I'm pretty much accustom to the new AS3 changes. I built a rough
    structure to make sure the way I wanted to set the site up would
    work (loading in external SWFs, etc.). The tests worked.
    Now, I'm going in to make some things real, and I'm getting
    this error as soon as an external SWF loads in:
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at test_fla::MainTimeline/test_fla::frame2()
    I've tried narrowing it down, couldn't find the exact culprit
    (had to remove every ounce of ActionScript before it started to
    function again). So I started to rebuild that movie entirely --
    cleared out the Library and deleted every layer. Didn't work.
    Couldn't even add a stop(); action in Frame 1.
    Then I started completely fresh File > New, rebuilt again.
    I tested after every single change. I finally built it up to the
    point where I first tested the original, and it worked. So, then I
    added a couple more things tested again, and got the error again.
    Ahh, so I removed EXACTLY what I had just added. Tested again. SAME
    ERROR -- now it won't go away no matter what I remove!
    Crazier yet is that I can still load in my other test SWF
    files and they have actions in them, and they're set up the exact
    same way -- but they work...
    The whole site is new, so every SWF is CS3/AS3. I'm not even
    doing anything crazy, so I'm getting pretty frustrated trying to
    build an all AS3 site and I can't even do basic stuff....
    I can upload/email the FLA files in question if anyone has
    time to look...
    Thanks,
    Brandon

    Well, when I test the loaded SWF within the Flash environment
    (by itself), it plays just fine.
    Then, I try to play the root containing movie (both within
    Flash and on the web server) and as soon as that section loads, is
    when the error occurs.
    I've tried tracing everything. even down to putting trace()
    actions between every layer. Can't determine what causes it...
    One thing I noticed (but I assume is a naming convention that
    Flash uses), is in the error above you see "test_fla", well, lets
    say I have these files:
    test-container.fla
    test-home.fla
    I don't have a test_fla, but the error code refers to it
    anyway...

  • Error in sql server with a trigger (I want to display a customize message, when the user left a blank field or null) How can I do?

    How I display a customize message(with a trigger)when a user left a blank field? I want to the stop the insert statament if the user left  the status field in blank. I create a trigger but now I can't enter a row, i used an instead trigger
    too but doesn't work. I want to display a customize message when the user left the
    status field in blank or null. 
     I have the following code:
    CREATE TRIGGER [dbo].[BLANKFIELD] 
    ON [dbo].[Status] 
    FOR INSERT 
    AS 
    BEGIN 
    IF (SELECT COUNT(*) FROM inserted WHERE Status IS NULL) =1
     PRINT 'Please Fill the Status  field is required'
    Rollback;
    END 

    I agree with other comments that you should do this with specifying that the column is NOT NULL to prevent it from being NULL and a constraint if you don't want it to be blank (spaces or the empty string - note that the empty string is not the same thing
    as NULL).
    But for completeness, the reason your trigger does not ever allow you to enter a row is the code
    IF (SELECT COUNT(*) FROM inserted WHERE Status IS NULL) =1
    PRINT 'Please Fill the Status field is required'
    Rollback;
    Since you don't have a begin/end block after IF, the only conditionally executed statement is the one immediately following the IF (that is the PRINT).  So the Rollback is always executed whether or not the IF is true and so all updates are rejected.
    So if you were to do this in a trigger you could do something like the following
    CREATE TRIGGER [dbo].[BLANKFIELD]
    ON [dbo].[Status]
    FOR INSERT
    AS
    BEGIN
    IF EXISTS(SELECT * FROM inserted WHERE Status IS NULL)
    BEGIN
    PRINT 'Please Fill the Status field is required';
    Rollback;
    END
    END
    (As José noted, there can be more than one row in the inserted pseudo table, so you don't want to test whether the COUNT = 1, instead just whether one or more rows exist where the Status  is null.  If you want to prevent Status is NULL, or all
    spaces, or the empty string, then your IF statement would be
    IF EXISTS(SELECT * FROM inserted WHERE ISNULL(Status, '') = '')
    Tom

  • TypeError: Error #1007:Tried to create an instance in a no constructor

    Hello guys,
    Im stuck with actionscript error, i really need help here the error i got:-
    TypeError: Error #1007:Tried to create an instance in a no constructor.
    at Away3dScene/initObjects()
        at Away3dScene/init()
        at flash.display::DisplayObjectContainer/addChild()
        at Away3dProject()
    So use Away3d, however dont know really where is the error becouse every thing seems be okay, im using adobe flash cs5.5, flash player 10.
    main.as code:
    package
        import flash.display.Sprite;
        import flash.display.StageScaleMode;
        import flash.display.StageAlign;
        import net.hires.utils.Stats;
        public class Away3dProject extends Sprite
            public function Away3dProject()
                stage.scaleMode =  StageScaleMode.NO_SCALE;
                stage.align =  StageAlign.TOP_LEFT;
                var scene:Away3dScene = new Away3dScene();
                addChild(scene);
                var stats:Stats = new Stats();
                addChild(stats);
         and here Away3dscene.as:
    package
        import away3d.cameras.Camera3D;
        import away3d.containers.Scene3D;
        import away3d.containers.View3D;
        import away3d.core.base.Object3D;
        import away3d.core.clip.RectangleClipping;
        import away3d.core.math.Number3D;
        import away3d.materials.WireColorMaterial;
        import away3d.overlays.LensFlare;
        import away3d.primitives.Plane;
        import flash.display.BlendMode;
        import flash.display.Sprite;
        import flash.events.Event;
        public class Away3dScene extends Sprite
            //[Embed(source="assets/library.swf", symbol="Halo")]
            private var Halo:Class;
            //[Embed(source="assets/library.swf", symbol="Flare1")]
            private var Flare1:Class;
            //[Embed(source="assets/library.swf", symbol="Flare2")]
            private var Flare2:Class;
            //[Embed(source="assets/library.swf", symbol="Flare3")]
            private var Flare3:Class;
            private var _scene:Scene3D;
            private var _camera:Camera3D;
            private var _view:View3D;
            private var _flare:LensFlare;
            public function Away3dScene()
                this.addEventListener(Event.ADDED_TO_STAGE, init);
            private function init(evt:Event):void
                initScene();
                initObjects();
                this.addEventListener(Event.ENTER_FRAME, render);
            private function initObjects():void
                /*var floor:Plane = new Plane();
                floor.width = floor.height = 100000;
                floor.segmentsW = floor.segmentsH = 12;
                floor.y = -3500;
                floor.material = new WireColorMaterial(0x333333);
                _scene.addChild(floor);*/
                var flareSourceDummy:Object3D = new Object3D();
                flareSourceDummy.x = 1000;
                flareSourceDummy.y = 500;
                flareSourceDummy.z = 3000;
                _scene.addChild(flareSourceDummy);
                _flare = new LensFlare(flareSourceDummy, _camera);
                _flare.setBurnClip(_view);
                _flare.setHaloAsset(new Halo());
                _flare.addFlareAsset(new Flare1());
                _flare.addFlareAsset(new Flare3());
                _flare.addFlareAsset(new Flare1());
                _flare.addFlareAsset(new Flare2());
                _flare.useRotation = false;
                //_flare.useAlpha = false;
                //_flare.useScaling = false;
                //_flare.useBurning = false;
                //_flare.blendMode = BlendMode.SCREEN;
                //_flare.burnMethod = LensFlare.BURN_METHOD_COLOR_TRANSFORM;
                _view.addOverlay(_flare);
            private function hoverCamera():void
                var mX:Number = this.mouseX > 0 ? this.mouseX : 0;
                var mY:Number = this.mouseY > 0 ? this.mouseY : 0;
                var tarX:Number = 3*(mX - stage.stageWidth/2);
                var tarY:Number = -2*(mY - stage.stageHeight/2);
                var dX:Number = _camera.x - tarX;
                var dY:Number = _camera.y - tarY;
                _camera.x -= dX*0.25;
                _camera.y -= dY*0.25;
                _camera.lookAt(new Number3D(0, 0, 0));
            private function initScene():void
                _scene = new Scene3D();
                _camera = new Camera3D({z:-1500});
                _view = new View3D({scene:_scene, camera:_camera});
                _view.x = stage.stageWidth/2;
                _view.y = stage.stageHeight/2;
                _view.clipping = new RectangleClipping({minX:-stage.stageWidth/2, minY:-stage.stageHeight/2, maxX:stage.stageWidth/2, maxY:stage.stageHeight/2});
                _view.opaqueBackground = 0;
                addChild(_view);
            private function render(evt:Event):void
                hoverCamera();
                _view.render();
          Please guys, any idea will be helpful to me.
        Best,

    Yes, you right, now after i do what you explain appear more informations. 
      at Away3dScene/initObjects()[C:\Users\ahmed\Desktop\3d\Away3dScene.as:65]
        at Away3dScene/init()[C:\Users\ahmed\Desktop\3d\Away3dScene.as:44]
        at flash.display::DisplayObjectContainer/addChild()
        at Away3dProject()[C:\Users\ahmed\Desktop\3d\Away3dProject.as:17]
    error number 65 in Away3dScene is: _flare.setHaloAsset(new Halo());
    error number 44 in Away3dScene is: initObjects();
    error number 17 in Away3dProject.as is: addChild(scene);
    and the last error is: at flash.display::DisplayObjectContainer/addChild()
    But what is strange i test project at flash builder and he work fine, i just want move from flash builder to run in flash cs5.5, so i move Away3dProject.as, Away3dScene.as, and i add Away3d classes to flash cs5.5 and also   add net class to flash cs5.5.
    also i add all movies clips to my libriry project, please could you help me to find why i got this error with flash cs5.5.
    Best,

  • TypeError: Error #1009: Cannot access a property or method of a null object reference.      at FC_Home_A

    Dear Sir,
    I really need your valuable assistance i was about to finish a project but at very last moment i am stuck. Here is the explanation below...
    I have two files called "holder.swf" and "slide.swf" i want to improt the "slide.swf" using this action below
    var myLoader:Loader = new Loader();
    var url:URLRequest = new URLRequest("slide.swf");
    myLoader.load(url);
    addChild(myLoader);
    myLoader.x = 2;
    myLoader.y = 2;
    Also i have attached the flash file of "holder.swf". My concern is the moment i am calling the "slide.swf" inside the "holder.swf" it is showing the following error...
    " TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at FC_Home_Ads_Holder_v2_fla::MainTimeline() "
    Here are the files uploaded for your reference, please download this file http://www.touchpixl.com/ForumsAdobecom.zip
    This error is being occured from "MainTimeline.as" file here is the code been use inside of this file below....
    package FC_Home_Ads_Holder_v2_fla
        import __AS3__.vec.*;
        import adobe.utils.*;
        import com.danehansen.*;
        import com.greensock.*;
        import com.greensock.easing.*;
        import com.greensock.plugins.*;
        import flash.accessibility.*;
        import flash.desktop.*;
        import flash.display.*;
        import flash.errors.*;
        import flash.events.*;
        import flash.external.*;
        import flash.filters.*;
        import flash.geom.*;
        import flash.globalization.*;
        import flash.media.*;
        import flash.net.*;
        import flash.net.drm.*;
        import flash.printing.*;
        import flash.profiler.*;
        import flash.sampler.*;
        import flash.sensors.*;
        import flash.system.*;
        import flash.text.*;
        import flash.text.engine.*;
        import flash.text.ime.*;
        import flash.ui.*;
        import flash.utils.*;
        import flash.xml.*;
        public dynamic class MainTimeline extends flash.display.MovieClip
            public function MainTimeline()
                new Vector.<String>(6)[0] = "Productivity";
                new Vector.<String>(6)[1] = "Leadership";
                new Vector.<String>(6)[2] = "Execution";
                new Vector.<String>(6)[3] = "Education";
                new Vector.<String>(6)[4] = "Speed of Trust";
                new Vector.<String>(6)[5] = "Sales";
                super();
                addFrameScript(0, this.frame1);
                return;
            public function init():void
                var loc1:*=null;
                com.greensock.plugins.TweenPlugin.activate([com.greensock.plugins.Aut oAlphaPlugin]);
                loc1 = new flash.net.URLLoader(new flash.net.URLRequest(this.XML_LOC));
                var loc2:*;
                this.next_mc.buttonMode = loc2 = true;
                this.prev_mc.buttonMode = loc2;
                stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;
                stage.align = flash.display.StageAlign.TOP_LEFT;
                loc1.addEventListener(flash.events.Event.COMPLETE, this.xmlLoaded, false, 0, true);
                this.prev_mc.addEventListener(flash.events.MouseEvent.CLICK, this.minusClick, false, 0, true);
                this.next_mc.addEventListener(flash.events.MouseEvent.CLICK, this.plusClick, false, 0, true);
                return;
            public function xmlLoaded(arg1:flash.events.Event):void
                var loc1:*=null;
                var loc2:*=0;
                this.xmlData = new XML(arg1.target.data);
                loc2 = 0;
                while (loc2 < this.LABELS.length)
                    loc1 = new Btn(this.LABELS[loc2], loc2);
                    this.btnHolder_mc.addChild(loc1);
                    this.BTNS.push(loc1);
                    trace(this.LABELS[loc2]);
                    ++loc2;
                this.current = uint(this.xmlData.@firstPick);
                trace("-----width-----");
                trace(this.contentMask.width);
                var loc3:*=this.contentMask.width / this.LABELS.length;
                trace(loc3);
                loc2 = 0;
                while (loc2 < this.BTNS.length)
                    this.BTNS[loc2].width = loc3;
                    this.BTNS[loc2].x = loc3 * loc2;
                    ++loc2;
                this.btnHolder_mc.addEventListener(flash.events.MouseEvent.CLICK, this.numClick, false, 0, true);
                this.selectMovie();
                return;
            public function numClick(arg1:flash.events.MouseEvent):void
                this.killTimer();
                this.current = arg1.target.i;
                this.selectMovie();
                return;
            public function killTimer():void
                this.timerGoing = false;
                if (this.timer)
                    this.timer.reset();
                    this.timer.addEventListener(flash.events.TimerEvent.TIMER, this.plusClick, false, 0, true);
                    this.timer = null;
                return;
            public function selectMovie():void
                if (this.timerGoing)
                    this.timer = new flash.utils.Timer(uint(this.xmlData.ad[com.danehansen.MyMath.modulo(t his.current, this.xmlData.ad.length())].@delay), 1);
                    this.timer.start();
                    this.timer.addEventListener(flash.events.TimerEvent.TIMER, this.plusClick, false, 0, true);
                while (this.holder_mc.numChildren > 0)
                    this.holder_mc.removeChild(this.holder_mc.getChildAt(0));
                var loc1:*=new flash.display.Loader();
                loc1.load(new flash.net.URLRequest(this.xmlData.ad[com.danehansen.MyMath.modulo(thi s.current, this.xmlData.ad.length())].@loc));
                this.holder_mc.addChild(loc1);
                var loc2:*=0;
                while (loc2 < this.BTNS.length)
                    this.BTNS[loc2].deselect();
                    ++loc2;
                this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].select();
                var loc3:*=this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].x + this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].width / 2 + this.btnHolder_mc.x;
                trace("addLength:" + this.xmlData.ad.length());
                trace(loc3, com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length()));
                com.greensock.TweenLite.to(this.indicator_mc, 0.3, {"x":loc3, "ease":com.greensock.easing.Cubic.easeOut});
                loc1.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, this.adLoaded, false, 0, true);
                return;
            public function adLoaded(arg1:flash.events.Event):void
                var evt:flash.events.Event;
                var loc1:*;
                evt = arg1;
                try
                    evt.target.content.xmlData = this.xmlData.ad[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())];
                catch (er:Error)
                return;
            public function minusClick(arg1:flash.events.MouseEvent):void
                this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current - 1);
                loc1.current = loc2;
                this.selectMovie();
                return;
            public function plusClick(arg1:flash.events.Event):void
                if (arg1.type != "timer")
                    this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current + 1);
                loc1.current = loc2;
                this.selectMovie();
                trace("next");
                return;
            public function ENDED(arg1:flash.events.Event):void
                if (arg1.type != "timer")
                    this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current + 1);
                loc1.current = loc2;
                this.selectMovie();
                trace("next");
                return;
            public function STARTED(arg1:flash.events.Event):void
                this.killTimer();
                return;
            function frame1():*
                this.timerGoing = true;
                addEventListener("endNow", this.ENDED, false, 0, true);
                addEventListener("startNow", this.STARTED, false, 0, true);
                this.init();
                return;
            public const XML_LOC:String=stage.loaderInfo.parameters.xmlLoc ? stage.loaderInfo.parameters.xmlLoc : "home_ads.xml";
            public const LABELS:__AS3__.vec.Vector.<String>=new Vector.<String>(6);
            public const BTNS:__AS3__.vec.Vector.<Btn>=new Vector.<Btn>();
            public const TRANSITION_TIME:Number=0.2;
            public var contentMask:flash.display.MovieClip;
            public var btnHolder_mc:flash.display.MovieClip;
            public var holder_mc:flash.display.MovieClip;
            public var indicator_mc:flash.display.MovieClip;
            public var prev_mc:flash.display.MovieClip;
            public var next_mc:flash.display.MovieClip;
            public var current:int;
            public var xmlData:XML;
            public var timer:flash.utils.Timer;
            public var timerGoing:Boolean;
    Here is the folder uploaded on the server for you to get clear picture, please click on this link to download the entire folder. http://www.touchpixl.com/ForumsAdobecom.zip
    I am not being able to resolve the issue, it needs a master to get the proper solution. I would request you to help me.
    Thanks & Regards
    Sanjib Das

    Here is the entire code of MainTimeline.as below, please correct it.
    package FC_Home_Ads_Holder_v2_fla
        import __AS3__.vec.*;
        import adobe.utils.*;
        import com.danehansen.*;
        import com.greensock.*;
        import com.greensock.easing.*;
        import com.greensock.plugins.*;
        import flash.accessibility.*;
        import flash.desktop.*;
        import flash.display.*;
        import flash.errors.*;
        import flash.events.*;
        import flash.external.*;
        import flash.filters.*;
        import flash.geom.*;
        import flash.globalization.*;
        import flash.media.*;
        import flash.net.*;
        import flash.net.drm.*;
        import flash.printing.*;
        import flash.profiler.*;
        import flash.sampler.*;
        import flash.sensors.*;
        import flash.system.*;
        import flash.text.*;
        import flash.text.engine.*;
        import flash.text.ime.*;
        import flash.ui.*;
        import flash.utils.*;
        import flash.xml.*;
        public dynamic class MainTimeline extends flash.display.MovieClip
            public function MainTimeline()
                new Vector.<String>(6)[0] = "Productivity";
                new Vector.<String>(6)[1] = "Leadership";
                new Vector.<String>(6)[2] = "Execution";
                new Vector.<String>(6)[3] = "Education";
                new Vector.<String>(6)[4] = "Speed of Trust";
                new Vector.<String>(6)[5] = "Sales";
                super();
                addFrameScript(0, this.frame1);
                return;
            public function init():void
                var loc1:*=null;
                com.greensock.plugins.TweenPlugin.activate([com.greensock.plugins.AutoAlphaPlugin]);
                loc1 = new flash.net.URLLoader(new flash.net.URLRequest(this.XML_LOC));
                var loc2:*;
                this.next_mc.buttonMode = loc2 = true;
                this.prev_mc.buttonMode = loc2 = true;
                stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;
                stage.align = flash.display.StageAlign.TOP_LEFT;
                loc1.addEventListener(flash.events.Event.COMPLETE, this.xmlLoaded, false, 0, true);
                this.prev_mc.addEventListener(flash.events.MouseEvent.CLICK, this.minusClick, false, 0, true);
                this.next_mc.addEventListener(flash.events.MouseEvent.CLICK, this.plusClick, false, 0, true);
                return;
            public function xmlLoaded(arg1:flash.events.Event):void
                var loc1:*=null;
                var loc2:*=0;
                this.xmlData = new XML(arg1.target.data);
                loc2 = 0;
                while (loc2 < this.LABELS.length)
                    loc1 = new Btn(this.LABELS[loc2], loc2);
                    this.btnHolder_mc.addChild(loc1);
                    this.BTNS.push(loc1);
                    trace(this.LABELS[loc2]);
                    ++loc2;
                this.current = uint(this.xmlData.@firstPick);
                trace("-----width-----");
                trace(this.contentMask.width);
                var loc3:*=this.contentMask.width / this.LABELS.length;
                trace(loc3);
                loc2 = 0;
                while (loc2 < this.BTNS.length)
                    this.BTNS[loc2].width = loc3;
                    this.BTNS[loc2].x = loc3 * loc2;
                    ++loc2;
                this.btnHolder_mc.addEventListener(flash.events.MouseEvent.CLICK, this.numClick, false, 0, true);
                this.selectMovie();
                return;
            public function numClick(arg1:flash.events.MouseEvent):void
                this.killTimer();
                this.current = arg1.target.i;
                this.selectMovie();
                return;
            public function killTimer():void
                this.timerGoing = false;
                if (this.timer)
                    this.timer.reset();
                    this.timer.addEventListener(flash.events.TimerEvent.TIMER, this.plusClick, false, 0, true);
                    this.timer = null;
                return;
            public function selectMovie():void
                if (this.timerGoing)
                    this.timer = new flash.utils.Timer(uint(this.xmlData.ad[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].@delay), 1);
                    this.timer.start();
                    this.timer.addEventListener(flash.events.TimerEvent.TIMER, this.plusClick, false, 0, true);
                while (this.holder_mc.numChildren > 0)
                    this.holder_mc.removeChild(this.holder_mc.getChildAt(0));
                var loc1:*=new flash.display.Loader();
                loc1.load(new flash.net.URLRequest(this.xmlData.ad[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].@loc));
                this.holder_mc.addChild(loc1);
                var loc2:*=0;
                while (loc2 < this.BTNS.length)
                    this.BTNS[loc2].deselect();
                    ++loc2;
                this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].select();
                var loc3:*=this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].x + this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].width / 2 + this.btnHolder_mc.x;
                trace("addLength:" + this.xmlData.ad.length());
                trace(loc3, com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length()));
                com.greensock.TweenLite.to(this.indicator_mc, 0.3, {"x":loc3, "ease":com.greensock.easing.Cubic.easeOut});
                loc1.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, this.adLoaded, false, 0, true);
                return;
            public function adLoaded(arg1:flash.events.Event):void
                var evt:flash.events.Event;
                var loc1:*;
                evt = arg1;
                try
                    evt.target.content.xmlData = this.xmlData.ad[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())];
                catch (er:Error)
                return;
            public function minusClick(arg1:flash.events.MouseEvent):void
                this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current - 1);
                loc1.current = loc2;
                this.selectMovie();
                return;
            public function plusClick(arg1:flash.events.Event):void
                if (arg1.type != "timer")
                    this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current + 1);
                loc1.current = loc2;
                this.selectMovie();
                trace("next");
                return;
            public function ENDED(arg1:flash.events.Event):void
                if (arg1.type != "timer")
                    this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current + 1);
                loc1.current = loc2;
                this.selectMovie();
                trace("next");
                return;
            public function STARTED(arg1:flash.events.Event):void
                this.killTimer();
                return;
            function frame1():*
                this.timerGoing = true;
                addEventListener("endNow", this.ENDED, false, 0, true);
                addEventListener("startNow", this.STARTED, false, 0, true);
                this.init();
                return;
            public const XML_LOC:String=stage.loaderInfo.parameters.xmlLoc ? stage.loaderInfo.parameters.xmlLoc : "home_ads.xml";
            public const LABELS:__AS3__.vec.Vector.<String>=new Vector.<String>(6);
            public const BTNS:__AS3__.vec.Vector.<Btn>=new Vector.<Btn>();
            public const TRANSITION_TIME:Number=0.2;
            public var contentMask:flash.display.MovieClip;
            public var btnHolder_mc:flash.display.MovieClip;
            public var holder_mc:flash.display.MovieClip;
            public var indicator_mc:flash.display.MovieClip;
            public var prev_mc:flash.display.MovieClip;
            public var next_mc:flash.display.MovieClip;
            public var current:int;
            public var xmlData:XML;
            public var timer:flash.utils.Timer;
            public var timerGoing:Boolean;

Maybe you are looking for

  • Final Cut No Go After 5.1.2 upgrade

    Hi Guys & Girls To make it short... I upgraded to FCP 5.0... ok..so far so good Then I upgraded to Tiger 10.4 and upgraded off the net the apple updates to make it 10.4.8 again..so far so good.. I thought until I opened FCP to finish some work FCP wo

  • BT stack disappears after restart.

    In a Portege M200 I downloaded the toshiba BT stack last version (3.10). Everything is ok during installation. BT devices are working properly (at least the headset). When I Power on again the pc, all BT stack files disappear(seems correctly unistall

  • Iweb '08 and Personal Domain/GoDaddy

    I had a terrible time with this before and so gave up and used domain forwarding but now I wanted to try again. I researched here in the forums because I remember that there were a LOT of threads about it. I found this Step by step: 1. Login into you

  • Pavilion zt 1172 notebook

    I have a pavilion zt1172 notebook which i am trying to upgrade to usb 2.0 can anyone instruct me as to the best pcmcia card to purchase, i only need it to operate my logitech web cam/hp printer and my remote mouse.

  • Gapless playback information

    sometimes it does it, but only when i dont want it to and then it slows down itunes completely but when im going to be away for awhile, i dont know how to make it run the scan to do the gapless playback info scan, does anyone know how?