TypeError: Error #1034: Type coercion failed: cannot convert flash.display::MovieClip@64e6ca1 in fla

Hi all

I get this window pop-out error when I pressed a button. The earpiece button contains the following code:

btn_start.addEventListener(MouseEvent.CLICK, gotoStart);
function gotoStart(e:MouseEvent):void{ 
     btn_start.removeEventListener(MouseEvent.CLICK, gotoStart);
     gotoAndStop("START");
}

TypeError: Error #1034: Type ISP led constraint: cannot convert flash.display::MovieClip@64e6ca1 to flash.display.SimpleButton

at flash.display::MovieClip/gotoAndStop()

to attendanceCheck / gotoStart () [attendanceCheck::frame2:31]

After searching the cause for a while, I can't find what's wrong with it...

Help me please...

Thank you

Zainuu

As I said, there is nothing wrong with this code.  So, since the error indicates that you treat a MovieClip, as if it were a SimpleButton control, somewhere in your design you have done something to try to force this MovieClip to be a button (or possibly vice versa if it's actually a button).  Check the properties panel and elsewhere to see if you have something that could be tempting to be that touches another object type than it is selected.

Try to create a new movieclip and assign it to that name (detached from each other) and see if you still receive the error.  If it works, then I recommend just create a new movieclip and replace the current where the problem arose.

Tags: Adobe Animate

Similar Questions

  • Error #1034: Type coercion failed: cannot convert mx.controls::TextArea@7914c29 to myComponents.DocumentTextArea

    Hi guys

    I dynamically add new linebreaks in my arraycollections. The first text box fits in the table, but in the second text box is inserted into the table I get the error in the title of this thread. Code below:

    TypeError: Error #1034: Type coercion failed: cannot convert mx.controls::TextArea@7914c29 to myComponents.DocumentTextArea.
    to test2 / getDocObj () [C:\Documents and Settings\Administrator\My Documents\Flex Builder 3\test2\src\test2.mxml:82]
    to test2 / checkLength () [C:\Documents and Settings\Administrator\My Documents\Flex Builder 3\test2\src\test2.mxml:42]

    private void checkLength(event:KeyboardEvent):void
    {
    var textArea:TextArea = new TextArea();
    textArea = getDocObj (event.currentTarget.id); -Error begins here.
    doc. Text = event.currentTarget.id;

    If (event.keyCode == 8 & & textArea.length == 0) {}
    removeChildTextArea (textArea, event.currentTarget.id);
    documentPage.setFocus ();
    }
    Else if (event.keyCode == 8 & & (documentPage.height - documentPage.mx_internal::getTextField () .height) < = (documentPage.height - documentPage.textHeight)) {}
    documentPage.setFocus ();
    }
    ElseIf (textArea.height - textArea.mx_internal::getTextField () .height > = textArea.height - textArea.textHeight) {}
    create new textarea
    var newtextArea:DocumentTextArea = new DocumentTextArea();
    documentContainer.addChild (newtextArea.getTextArea ());
    newtextArea.getTextArea () .setFocus ();
    newtextArea.getTextArea () .addEventListener (KeyboardEvent.KEY_UP, checkLength);
    documentArray.addItem (textArea);

    if(documentArray.Length == 0) {}
    newtextArea.getTextArea () = (0) user.user m:System.NET.SocketAddress.ToString ();
    }
    else {}
    documentPointer += 1;
    newtextArea.getTextArea (user.user = documentPointer.toString ());
    }
    }
    }

    private void getDocObj(id:int):TextArea
    {
    trace ("size of table '+ documentArray.length +' and the size of the id is"+ (id) m:System.NET.SocketAddress.ToString () ");
    var findTextArea:DocumentTextArea = DocumentTextArea (documentArray.getItemAt ((id)));
    Return findTextArea.getTextArea ();
    }

    You try to get a TextArea to this DocumentTextArea, it is the problem, why you do not change this line

     var textArea:TextArea = new TextArea();
    

    To do this:

     var textArea:DocumentTextArea= new DocumentTextArea();
    
  • DateField as itemrender causes Error #1034: Type coercion failed: cannot convert '10/03/2006.

    I have itemrende onliner.

    < mx:DataGridColumn dataField = "solddate."
    headerText = "Date".
    itemRenderer = "mx.controls.DateField"
    rendererIsEditor = "true".
    editorDataField = "selectedDate" / >

    XML =

    < solddate > 10/03/2006 < / solddate >

    This translates

    DateField as itemrender causes Error #1034: Type coercion failed: cannot convert ' 10/03/2006' in Date.

    Is it possible for me to be

    1. change the output xml to the required format

    or

    2 convert the data within the itemrenderer

    The answer is here http://blog.flexmonkeypatches.com/2008/04/08/datefield-itemeditor-when-date-is-a-string/comment-page-1/
    
    or you can do it inline like
    
    DataGridColumn headerText="Date"                   editable="true"                    rendererIsEditor="true">                              DateField selectedDate="{new Date(Date.parse(data.@solddate as String))}"/>                                               DataGridColumn>
    
    
    
  • Type coercion failed: cannot convert flash. events::Event in mx.event.IndexChangedEvent

    Hello

    Get this error.

    I saw the following thread and the solution developed in...

    https://bugs.Adobe.com/jira/browse/SDK-11156

    I don't know in what file it comes? I have a few 100 files in my project is thr origin no identity that records?

    Thanks and greetings

    mxvx

    In such a scenario, it will probably not an as the error stack trace

    occurs at the top of the stack as it tries to force the type of error.

    I think that your description to be opposite of what is probably happening.  The

    problem is that the compiler has seen the IndexChangedEvent type metadata, but

    a regular event is being distributed by some internal control and probably

    formation of bubbles.

    These scenarios are difficult to debug.  I recommend the use of a capture phase

    Manager on systemManager so you can get an overview of each event until it doesn't

    more in the case of the flow.  I hope that the last his event.target is the

    guilty.

  • Error #1034: Type coercion failed: error in FocusManager

    Hello

    I use ActionScript 3.0.

    Here I want to setFocus on a DisplayObject (flash.display.DisplayObject).

    I tried:

    var dispObject:DisplayObject;

    dispObject = code here to get the DisplayObject instance. valid obtained DisplayObject

    var focusManager1:FocusManager = dispObject ['focusManager'];
    var component: IFocusManagerComponent = dispObject as IFocusManagerComponent.
    If (focusManager1! = null & & components! = null)
    {
    focusManager1.setFocus (component);
    }

    But I am getting: Error #1034: Type coercion failed: cannot convert mx.managers::FocusManager@3881e41 in mx.managers.FocusManager.

    It's the line: var focusManager1:FocusManager = dispObject ['focusManager'];

    The same code would work if I use mx.core.UIComponent instead of DisplayObject, I guess.

    But I'm not able to convert DisplayObject UIComponent (invalid cast).

    Can someone help me please.

    Thank you

    Pradeep.

    mx.managers.FocusManager is for Flex components and does not work with any other objects.

    In order to set the focus on an InteractiveObject (you can't set the focus on a DisplayObject, that isn't an InteractiveObject) use stage.focus .

  • Error #1034: Type coercion failed: error

    Hello

    I use ActionScript 3.0.

    Here I want to setFocus on a DisplayObject (flash.display.DisplayObject).

    I tried:

    var dispObject:DisplayObject;

    dispObject = code here to get the DisplayObject instance. valid obtained DisplayObject

    var focusManager1:FocusManager = dispObject ['focusManager'];
    var component: IFocusManagerComponent = dispObject as IFocusManagerComponent.
    If (focusManager1! = null & & components! = null)
    {
    focusManager1.setFocus (component);
    }

    But I am getting: Error #1034: Type coercion failed: cannot convert mx.managers::FocusManager@3881e41 in mx.managers.FocusManager.

    It's the line: var focusManager1:FocusManager = dispObject ['focusManager'];

    The same code would work if I use mx.core.UIComponent instead of DisplayObject, I guess.

    But I'm not able to convert DisplayObject UIComponent (invalid cast).

    Can someone help me please.

    Thank you

    Pradeep.

    Set the property to to focus on the scene:

    internship. Focus = someDisplayObject;

  • TypeError: Error #1034: Type constraint has no

    Hi, I use a ready Panel accordion in Flash ( here )

    now, when I add a touch any on this frame I get this error when I click on the tabs of the accordion:

    TypeError: Error #1034: Type coercion failed: cannot convert flash.display::SimpleButton@48596ab9 to flash.display.MovieClip.


    and when I add a movieclip on the stage I get this error just after click on all of the accordion panels:


    TypeError: Error #1010: a term is undefined and has no properties.     at mobver2_fla::MainTimeline/onClick()


    Here are the main script for the accordion panel:

    import gs.*;
    import gs.easing.*;
    
    panel1.props = {ly:53, ry:650, ind:1};
    panel2.props = {ly:115, ry:700, ind:2};
    panel3.props = {ly:169, ry:750, ind:3};
    
    panel1.addEventListener(MouseEvent.CLICK, onClick);
    panel2.addEventListener(MouseEvent.CLICK, onClick);
    panel3.addEventListener(MouseEvent.CLICK, onClick);
    
    function onClick(e:MouseEvent):void
    {
        var clicked:MovieClip = MovieClip(e.target);
        for(var i:int=0; i<numChildren; i++)
        {
            var mc:MovieClip = MovieClip(getChildAt(i));
            if(mc.props.ind <= clicked.props.ind)
                TweenLite.to(mc, 1, {y:mc.props.ly, ease:Bounce.easeOut});
            else
                TweenLite.to(mc, 1, {y:mc.props.ry, ease:Bounce.easeOut});
        }
    }
    

    It seems to this script on all effect the movieclip or buttons in the frame, but I can't understand how I need to separate from the other buttons and movieclips from that. I really need to add some button and movie clip on these panels and the frame

    For the first error, the onCLick function is not letting a child on stage through without that he's trying to turn it into a MovieClip via the line:

    var mc:MovieClip = MovieClip (getChildAt (i));

    What you need to do is to check the type of each object before you try to turn it into something that can not.

    • function onClick(e:MouseEvent):void
    • {
    • var click: MovieClip = MovieClip (e.target);
    • for (var i: int = 0; i
    • {
    • If (getChildAt (i) is the MovieClip) {}
    • var mc:MovieClip = MovieClip (getChildAt (i));
    • If (mc.props.ind<=>
    • TweenLite.to (mc, 1, {y: mc.props.ly, ease:Bounce.easeOut});})
    • on the other
    • TweenLite.to (mc, 1, {y: mc.props.ry, ease:Bounce.easeOut});})
    • }
    • }
    • }

    For the second errorit could be the case when there are other movieclips that are children who do not attend the accordion and should not be run thru that treatment is because they have not the properties they need

  • Error 5000: The class 'Particle' must subclass 'flash.display.MovieClip' because it is linked to a symbol in the library of this type.

    Running Flash CS3, I looked at the tutorial from lynda.com on strengthening the systems of particles in ActionScript 3.0 to create a few sparks shooting in an animation.  I'm stuck to what I think is a point really basic, but I can't seem to cross it.  Basically, all I'm doing at this point is to create a class called particle (that I'll learn to do things that the particles to make a little later) bind it to a MovieClip on the stage in my .fla file and use the function to update the particle to move it around the stage in a way defined in the instance (so I can later give properties of different movement to) each as an instance generated the MC).  I know there are easier ways to accomplish my basic task without loading an external module, but this seems to makes it so I have to hurt something very simple, that I can't see so I thought I'd post the code here and see what I'm missing.

    I start with a file called Particle.as in the same folder as my file Test.fla Spark.

    In Particle.as, I have the following code:

    package
    {
    import flash.display. *;

    Particles/public class extends MovieClip
    {
    public xVelocity:Number;
    public yVelocity:Number;

    public void Particle()
    {
    xVelocity = 0;
    yVelocity = 0;
    }

    public void update (): void
    {
    This.x += xVelocity;
    This.y += yVelocity.

    }
    }
    }

    So, I declare that all the particles are built with no movement, but if they are explicitly granted an x or y velocity, they will pass by there a lot when updating the instance function is called in the timeline panel.

    Then in my file Test.fla spark, I have a small shape in a MovieClip called Spark.  In the properties of binding of spark, I chose to export for ActionScript and export in first frame.  The class is called Spark and the Base class is the particle.  For testing purposes, I dropped an instance on the stage and called spark.  Then in the layer actions in the first image (the timeline is just the spark layer and the layer actions, a long frame each with no "stop();" so it should run forever), I have included the following code:

    spark.xVelocity = 5;
    spark.yVelocity = - 1;

    function updateSpark(event:Event):void
    {
    Spark.Update ();
    }

    addEventListener (Event.ENTER_FRAME, updateSpark);

    Is what it seems that this should be on every Flash ENTER_FRAME should call updateSpark, which is a function that handles the event update() for the instance of the spark which is a movieclip instance that has an update event that moves x and y of the position of their relative velocity variables.  It seems simple enough to me, but when I ctrl-enter to test the movie, I get the following compiler 3 errors:

    Particle.As line 1: 5000: the class 'Particle' must subclass 'flash.display.MovieClip' because it is linked to a symbol in the library of this type.

    Particle.As line 7:1071: syntax error: expected a keyword (for example function definition) after the public attribute, not xVelocity.

    Particle.As line 7:1084: Syntax error: expecting rightbrace before the semicolon.

    Since I imported flash.display. * and declares the class public particle so it extends MovieClip I have no idea why I get this error of 5000.  I see this issue come up a lot when searching Google and forums, but none of the resolutions that I could find have suggested an approach that applies to me or solve the problem.

    Any help to fix this would be appreciated.  I enclose a zip of the FLA a files as described above in case there is something in the settings of publication that I messed up inadvertently.  In addition, if you can get this to compile without error, then the problem may be due to my Flash CS3 Pro install which will result in the problem isn't with my code and start looking at me in a different direction.

    Thank you

    Scott

    Yes, 'var '.

  • Error #1034: Type constraint is not?

    Hello

    I am using CS4 and ActionScript 3

    I am trying to create a product, and when I play it I get this error:

    TypeError: Error #1034: Type coercion failed: cannot convert flash.display::MovieClip@16ed7e1 to flash.display.SimpleButton.

    at flash.display::MovieClip/gotoAndPlay()
    at Homepage_fla::MainTimeline/after() [Homepage_fla. MainTimeline::frame88:5]

    The coding of the scene is:


    Stop();

    Goto function (event: MouseEvent): void {}
    gotoAndPlay (1, 'Courses');
    }
    function GoBack(event:MouseEvent): void {}
    gotoAndPlay (1, "open");
    }
    function Home (event:MouseEvent): void {}
    gotoAndPlay (1, 'Homepage');
    }

    btn_bac.addEventListener (MouseEvent.CLICK, GoBack);

    btn_thecourse.addEventListener (MouseEvent.CLICK, Goto);

    btn_homepagee.addEventListener (MouseEvent.CLICK, host);

    The error really makes no sense and I'm no expert on the coding of the timeline, I never use it.

    Having goToAndPlay (1, "The Cource"); in the main timeline is indicative of the playhead to frame 1 in the stage called "The Cource.

    You have a scene for all these pages, and you have a separate scene called "The Cource"? Is it a spelling error, and should be "the course"?

    The thing that I don't understand is why his thought the main timeline is a SimpleButton control.

  • TypeError: Error #1034

    Hello

    I keep getting errors in my fla file output, at the beginning it was: TypeError: Error #1009: cannot access a property or method of a null object reference.

    and now it's: TypeError: Error #1034: Type coercion failed: cannot convert flash.events::Event@3916d151 in flash.events.MouseEvent.

    at flash.display::DisplayObjectContainer/removeChildAt()

    to Project3_fla::MainTimeline/ongoPage2() [Project3_fla. MainTimeline::frame32:7]

    Here is the code for the box above:

    import flash.events.MouseEvent;

    next1_btn.addEventListener (MouseEvent.CLICK, ongoPage2);

    function ongoPage2(Event:MouseEvent):void {}

    if (numChildren > 8) {}

    removeChildAt (8);

    }

    gotoAndStop ("Page2");

    }

    back1_btn.addEventListener (MouseEvent.CLICK, ongoStart);

    function ongoStart(Event:MouseEvent):void {}

    if (numChildren > 8) {}

    removeChildAt (8);

    }

    gotoAndStop ("Start")

    }

    home1_btn.addEventListener (MouseEvent.CLICK, ongoStart1);

    function ongoStart1(Event:MouseEvent):void {}

    if (numChildren > 8) {}

    removeChildAt (8);

    }

    gotoAndStop ("Start");

    }

    video1_btn.addEventListener (MouseEvent.CLICK, ongoVid1);

    function ongoVid1(Event:MouseEvent):void {}

    videobox1 = new Videobox1();

    videobox1.x = 20;

    videobox1.y = 6;

    addChildAt (videobox1, 8);

    }

    info1_btn.addEventListener (MouseEvent.CLICK, ongoInfo1);

    function ongoInfo1(Event:MouseEvent):void {}

    infobox1 = new Infobox1();

    infobox1.x = 20;

    infobox1.y = 6;

    addChildAt (infobox1, 8)

    }

    Can someone help me with this?

    Thank you very much

    For error 1009, if you don't change anything to solve this problem, it is probably still there. And according to the error message, no matter what the object targeted on line 21 is not present when this line of code executes.

    What about the other error, try changing all your arguments to the function to not use "Event: MouseEvent ' use event: MouseEvent or evt:MouseEvent or e:MouseEvent or whatever it is: MouseEvent, but not Event: MouseEvent.  Event is a name of class like MouseEvent.  See if that helps clear on this error.

  • Import of swl in a fla - TypeError: Error #1034:

    I'm new to flash CS4 and have spent 2 days reading forum help and online tutorials trying to load external swf into a fla file using buttons.

    I don't even have the extent of the default film loading. Here is the code that I use (using reports.swf as my default) which is in the first frame of the Actions layer.


    var Xpos:Number = 10;
    var Ypos:Number = 10;
    var swf:MovieClip;
    var loader: Loader = new Loader ();

    var defaultSWF; URLRequest ("reports.swf");

    Loader.Load (defaultSWF);
    Loader.x = XPos;
    Loader.y = YPos;
    addChild (loader);

    Here is the error message I have - "testAC3impoort_fla" being the fla in which I am trying to load the external swf file)...

    TypeError: Error #1034: Type coercion failed: cannot convert "reports.swf" in flash.net.URLRequest.
    at testAC3impoort_fla::MainTimeline/frame1()

    I checked that all my file names are correct and located in the same folder.

    My main fla and swf are published AC3.

    Someone to help me to solve this first part of my first attempts at AC3 scripting (good code to paste into AC3 etc.) is probably going to hear my cries of joy wherever they are in the world... lol

    Trevor

    Your statement is wrong.  Try:

    var defaultSWF:URLRequest = new URLRequest ("reports.swf");

  • TypeError: Error #1034: has no Type constraint: IFocusManager + button

    I'm writing an application that only uses the keyboard to navigate through the components on a page.

    When the user clicks the button the arrow, emphasis is placed on the component that has focus.

    For example, I have a container that has several images page layout, the user can access other images

    This container by using the arrow keys.

    First of all, I tried to use images as the component to store the image, but I discovered that I could not set the focus on a

    component images. Then I used buttons and set the property to the icon of the source of the image, and it worked fine.

    But then I did a botton in another mxml component, I named ButtonImageGadget so that I could put the icon property the

    the main application file. When I run and navigate to the switch that is a button is buttonImagel file, I get an error.

    «TypeError: Error #1034: Type constraint failed: cannot convert components::buttonImage@121ca15c1 to mx.managers.IFocusManagerComponent.»

    Anyone know how I can fix this problem? I would really appreciate it. Here are some of my code:

    buttonImage.mxml

    <? XML version = "1.0" encoding = "utf-8"? >

    " < = xmlns:fx s:Group ' http://ns.Adobe.com/MXML/2009 "

    .....

    .....

    < s:Button

    Width = "160" height = "220".

    Icon = "images/genre.png"

    focusColor = "#28ff2b" / >

    < / s:Group >

    MainApplication.mxml

    This is the code in the script block

    <? XML version = "1.0" encoding = "utf-8"? >

    " < = xmlns:fx s:Application ' http://ns.Adobe.com/MXML/2009 "

    ....

    ....

    Switch (Key)

    {

    -case Keyboard.LEFT: //left keycode: 37

    {

    If ((pattern. (IndexOf ("content_container")) > 0)

    {

    IFocusM.setFocus (nav_content_container [elem_id] .left);

    drawInitialFocus (nav_content_container [elem_id] .left);

    IFocusM.getFocus () .drawFocus (true);

    focused_component = String (IFocusM.getFocus ());

    trace ("Focus is now on" + focused_component);

    }

    ....

    ....

    This is the mxml code in the MainApplication.mxml

    < s:TileGroup id = "content_container.

    width = "700" height = "100%".

    horizontalGap = "20" verticalGap = "20" >

    < s:Button id = "first" width = "200" height = "250" icon = "images/charlottes_web.jpeg" focusColor = ' #28ff2b ' focusThickness = "4" / > "

    < s:Button id = "second" icon = "images/bad_lieutenant.jpeg" focusColor = "#28ff2b" / > "

    < s:Button id = "third" icon = "images/caroline.jpeg" focusColor = "#28ff2b" / > "

    < s:Button id = "fourth" icon = "images/che.jpeg" focusColor = "#28ff2b" / > "

    < s:Button id = "fifth" icon = "images/date_movie.jpeg" focusColor = "#28ff2b" / > "

    < components: ButtonImageGadget id = "last" / >

    < / s:TileGroup >

    < / s:Application >

    What else is in the Group?  The top tag should be button if possible.

  • Could not be converted flash.display:Sprite

    Cannot convert flash.display::Sprite@39394a9 to flash.display.MovieClip.

    Some examples of code

    var enemyArray:Array = new Array();

    var mySprite:Sprite;
    mySprite = new Sprite();
    addChild (mySprite);

    var myEnemy:Enemy;
    myEnemy = new Enemy();

    mySprite.addChild (myEnemy);
    enemyArray.push (myEnemy);

    removeEnemy(e:Enemy)
    {
    for (var i in enemyArray)
    {
    If (enemyArray [i] == e)
    {
    enemyArray.splice(1,i);
    }
    }
    }
    ----------------------------------------
    -------
    the enemy class: If anemy is off the screen, it will attract the deleteEnemy
    then it will remove the enemy soon after that that he will call the parent removeChild() to eliminate the enemy to the table

    deleteEnemy()
    {
    MovieClip (parent) .removeEnemy (this);
    parent.removeChild (this);
    }

    Then, it will get the error above,

    I guess the problem is, class enemy cant access the removeEnemy() in the parent class

    but when I remove the sprite like this:

    addChild (myEnemy);

    instead:

    mySprite.addChild (myEnemy);

    then it will be ok, but my goal is, how can enemy called the removeEnemy() in parent while it is inside the sprite

    Here is the structure if no sprite:

    main > examples > enemy

    Sample - is the clip parent of enemy

    -now enemy can call the removeEnemy() of the sample

    with sprite:

    main > examples > sprite > enemy

    -now the enemy cannot call the removeEnemy() in the sample

    My goal is, enemy can call the removeEnemy() of the sample while its inside a sprite

    TNX for the help in advance...

    you said, "How can enemy called the removeEnemy() to parent."  If that were true, the code that I proposed would have worked.

    If removeEnemy() is not the parent of the enemy, where it is relatively to the enemy?  in your 2nd post, you said:

    sample > sprite > enemy

    which indicates that removeEnemy() is the enemy parent.parent:

    MovieClip (parent.parent) .removeEnemy)

  • Embedding a SWF Movieclip gives the error: "cannot convert box_swf to flash.display.MovieClip.

    Hello, I am getting a weird error on a very simple code.

    I have a swf containing a clip with the Linkage name "Box". The movieclip has an animation of 30 images, still Flash Builder keeps mistake saying: this isn't a clip!

    SerializableAttribute public class Main extends Sprite

    {

    [Embed (source = "... / assets/box.swf", symbol = "Box")] public static A_Box: Class const;

    public void Main()

    {

    var box: MovieClip = new A_Box();

    }

    }

    #1034: constraint type failed: cannot convert box_swf$161b93e3bc30cfa0cb18e1d734943c6f-1063626660@53720a1 to flash.display.MovieClip.

    If I try to bring it as a leprechaun, it works very well (var box: Sprite = new A_Box();), but then it does not animate, because it is considered as a sprite.

    I looked around 20 examples online, the code is very simple and I can't seem to find anything wrong with my code. I also rechecked 300

    time and the Movieclip is correctly set up inside the Swf. (name of the link, several frames, export for actionscript Framework 1, etc.)

    Then... Why does is not the only work of Sprite and MovieClip?

    I'm doing something wrong or is this maybe a problem of FlashBuilder/Air13.0?

    Thank you!

    I opened my project again today to see if it suddenly works perfectly... Something must have been in cache because I got hurt with her for six hours yesterday, and now without changing it works immediately the bat.

    I find that there are problems cache as such in FB. Sometimes the changes I have made do not appear in the project at all (including the removal of the top classes) until I restart FB. Really wish that Adobe get their act together and release a patch to fix some of the bugs all.

  • TypeError: Error #1034: error forced conversion: just trying to import a swf into another swf

    TypeError: Error #1034: error forced conversion: you can not convert "game.swf" in LoadActivities.

    I have a main fla and its document class and a specific class of LoadActivities to load the games in a main container (which is a platform/side scrolling game)

    The part of the code in the document class that is causing the problem:

    MAIN DOCUMENT CLASS

    private function processCollisions (): void
    {
    If (thePlayer.hitTestPoint (q.x, q.y))
    {
    this.removeEventListener (Event.ENTER_FRAME, mainGameLoop);
    LoadActivities("game.swf");
    return;
    }

    It is a platform game. When the player hit testing q (which is simply a cirlce for the test that calls a QUIZ) I want to stop the main loop of the game platform (container) and import a quiz.swf.

    I use a dedicated class LoadActivities

    LoadActivities

    package {}
    import flash.display.Loader;
    import flash.net.URLRequest;
    import flash.events. *;
    import flash.display. *;

    SerializableAttribute public class LoadActivities extends MovieClip {}

    public void LoadActivities (game): void
    {

    var loader: Loader = new Loader;
    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, handler);
    Loader.Load (new URLRequest (game));
    }
    public void handler(e:Event):void
    {
    var mc:MovieClip = MovieClip (e.target.loader);
    addChild (mc);
    }

    }

    This should be:

    codeBeastAdobe wrote:

    In ENGLISH it would be forced to Type error failed. You can not convert "game.swf" in LoadActivities.

    TypeError: Error #1034: conversion forzada error: no are you can convert "game.swf" in LoadActivities.
    to DocumentMain / processCollisions () [C:\Users\Usuario\Downloads\as3_sides croller_part4 Original\examples\DocumentMain.as:300]


    MAIN DOCUMENT CLASS

    private function processCollisions (): void
    {
    If (thePlayer.hitTestPoint (q.x, q.y))
    {
    this.removeEventListener (Event.ENTER_FRAME, mainGameLoop);
                   var la: LoadActivies = new LoadActivities ("game.swf");
    return;
    }

    SPECIFIC CLASS - LoadActivities

    package {}
    import flash.display.Loader;
    import flash.net.URLRequest;
    import flash.events. *;
    import flash.display. *;
       
    SerializableAttribute public class LoadActivities extends MovieClip {}

    public void LoadActivities(game:String):void
    {
               
    var loader: Loader = new Loader;


    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, handler);
    Loader.Load (new URLRequest (game));
    }
    public void handler(e:Event):void
    {
    var mc:MovieClip = MovieClip (e.target.loader.content);
    trace (MC);
    addChild (mc);
    }
           
    }
    }

Maybe you are looking for