Error 1034: Conversion of video to an instance of a custom object?

I have several video clips on the stage who each unique instance names.

I need to instantiate instances of a custom class that I created. It gives me an error, and I know I am missing probably a simple concept somewhere, something wrong, but I don't know what it is.

Here is my code:

In the main timeline, I (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 until the object is never instantiated. It compiles, but when running, 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's important:

package {}
import flash.display.MovieClip;

SerializableAttribute public class extends MovieClip {} GeoGroup
public var abbrev:String;
public var fullName:String;
public var assignedOrder:Number;
public var lock: Boolean;

public void 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, but I'm new to OOP, switching of procedural issues, so I don't know that I'm a bad concept somewhere.


Thank you very much!
Amber

to have several library objects belong to the same class, assign each a class have different, but each shares the same base (like GeoGroup) class.

You can assign dynamic properties members of your GeoGroup anytime, not just when they are created.  so, you could change your constructor and add the GeoGroup members in the authoring environment.

or you can leave your class only GeoGroup and you can add objects to the stage using actionscript.  for example: addChild().

at this point, I think it would be easier for you to let your single class constructor, remove the scene GeoGroup members and add them using actionscript.  You can simplify your coding by adding your listeners to the class:

package {}
import flash.display.MovieClip;
  
SerializableAttribute public class extends MovieClip {} GeoGroup
public var abbrev:String;
public var fullName:String;
public var assignedOrder:Number;
public var lock: Boolean;

public void GeoGroup (abbrev:String, fullName:String, assignedOrder:Number, lock: Boolean) {}
This.ABBREV = abbrev;
this.fullName = fullName;
this.assignedOrder = assignedOrder;
This.Lock = lock;

this.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);
}

}
}

////////////////////////

then on your timeline:

var puzzleAL: GeoGroup = new GeoGroup ('AL', 'Alabama', 1, false);

addChild (puzzleAL);

Tags: Adobe Animate

Similar Questions

  • 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);
    }
           
    }
    }

  • Muse crashing when sending to the site Business Catalyst or Preview - Error #1034

    I'm working on adding via HTML & Wistia videos on a site of Muse. Everything worked well for testing (3 videos of 7) locations. I was able to listen to samples and download on BusinessCatalyst with everything works fine. Once I added the rest of the videos, I started to get the following error when I try to get an overview of the site or to download on BusinessCatalyst.

    I tried to go back and remove the 4 extra videos added and video version 3 started giving me the same error.

    What the problem could be the ideas? I've looked everywhere and can't seem to find an answer to any discussion.

    Here is the full error:

    Failed to execute task "EXPORT_PAGE_HTML": Error #1034: Type

    Coercion failed: cannot convert

    flashx.textLayout.elements::ListElement@7fff2d05661 to

    flashx.textLayout.elements.ParagraphElement.

    This error is triggered by a ball or a numbered list in a text frame where the internal structure of the list, while valid, is to form the export code is not expected.

    If your site is relatively small, the fastest workaround is likely to use file > Preview Page in the browser to determine what page contains the list of issues. Once you have found, convert every list on this page in plain text, and then again in a list. (The creation of list code creates the structure of export is expected.) Some beyond change, which was made after the list existed resulted in a structure the export code didn't know how to handle. We are still working to understand what this edit is so we can fix the root cause of this error.)

    If your site is larger, it may be more practical to send us the file and we can use development tools to find and difficulty of the issues list and you will receive the file. You can send the .muse file to [email protected] as well as a link to this topic. If the file is larger than 20 MB, you can use a service like Adobe SendNow, Dropbox, WeTransfer, etc. (if you use a service, please include your email address in the body of the message back, given that not all services to include it in the invite sharing they send.) Thank you.

    Really sorry for the inconvenience.

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

  • Windows Live Messenger error: A conversation with (user name) could not be started. Please try again.

    When you try to send a text message to a number using Windows Live Messenger I get this error: "a conversation with (user name) could not be started. Please try again. "I can't send a text message to a phone using Windows Live Messenger. What is the problem?

    Ask in the Windows Live Solution Center Portal Messenger.

  • error 1601 installing facebook video

    error 1601 installing facebook video

    Hello

    1. You try to download Facebook videos?
    2. What browser do you use?
    3. Have you tried using other browsers?

    In order to provide better assistance, post back with detailed information on the issue. The link below will allow you to ask questions in the Forums.

    Suggestions for a question on the help forums

    http://support.Microsoft.com/kb/555375

    See this link for the video problems when you use Internet explorer:

    The video problems when you use Internet Explorer

    http://support.Microsoft.com/kb/2532294

    It will be useful.

  • Videos converted with the conversion software video DAM do not play properl

    Videos converted with the conversion software video DAM do not always play correctly

    and


    The use of Video Manager to check in an additional file video AVI, by clicking on the "renditions" link at the bottom of the page, a page filled with characters scrambled instead of a video playback in Windows Media Player.

    I have configure the FlipFactory with oracle ECM job ststus form Flipfactory her complicated but when I tried the video from ECM not simply

    Thank you all,

    I solved the problems that I update the DCU for last vision of 11... 8...

  • vSphere Web Client: Error #1034 when you connect.

    Hello

    Hope someone can help me with this one.

    When I try to connect to the vSphere Web Client I get this error (in Flash format) box:

    An internal error occurred - error #1034

    webclient_error.gif

    This occurs just after a successful authentication

    I have tried different browsers, the Flash upgrade, etc... No luck.

    Any ideas? It used to work fine, but I don't have any idea what has changed.

    Thank you!

    Thanks for the suggestion of julienvarela.

    Apparently, the error was caused by a limited amount of free disk space on drive (C) of the server. After I added more space, the error disappeared.

  • Why the button in movieclip produces Error #1034

    I have a menu sliding with several clips.  I want to add buttons to each Panel to link to a PDF file.  The button works, but the code produces the following error:

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

    at slideshow_fla::MainTimeline/onClick()

    I tried to bypass the portion of interpolation of Panel by searching for type of child, but it does not seem to ignore the button.  What Miss me?

    Import gs.*;

    Gs.easing import. *;

    S1.props = {lx:0, rx: 350, ind:1};

    S2.props = {lx:36.45, rx: 386.45, ind:2};

    S3.props = {lx:72.90, rx: 422.95, ind:3};

    S4.props = {lx:109.40, rx: 459.45, ind:4};

    S5.props = {lx:145.85, rx: 495.90, ind:5};

    S6.props = {lx:182.35, rx: 532,40, ind:6};

    S7.props = {lx:218.80, rx: 568.85, ind:7};

    S8.props = {lx:255.25, rx: 605.30, ind:8};

    S9.props = {lx:291.75, rx: 641.80, ind:9};

    S10.props = {lx:328.20, rx: 678.25, ind:10};

    S11.props = {lx:364.70, rx: 714.45, ind:11};

    S12.props = {lx:401.15, rx: 751.20, ind:12};

    S13.props = {lx:437.60, rx: 787.65, ind:13};

    S14.props = {lx:474.10, rx: 824.15, ind:14};

    S15.props = {lx:510.55, rx: 860.60, ind:15};

    S16.props = {lx:547.05, rx: 897.10, ind:16};

    S17.props = {lx:583.50, rx: 933.55, ind:17};

    S1.addEventListener (MouseEvent.CLICK, onClick);

    S2.addEventListener (MouseEvent.CLICK, onClick);

    S3.addEventListener (MouseEvent.CLICK, onClick);

    S4.addEventListener (MouseEvent.CLICK, onClick);

    S5.addEventListener (MouseEvent.CLICK, onClick);

    S6.addEventListener (MouseEvent.CLICK, onClick);

    S7.addEventListener (MouseEvent.CLICK, onClick);

    S8.addEventListener (MouseEvent.CLICK, onClick);

    S9.addEventListener (MouseEvent.CLICK, onClick);

    S10.addEventListener (MouseEvent.CLICK, onClick);

    S11.addEventListener (MouseEvent.CLICK, onClick);

    S12.addEventListener (MouseEvent.CLICK, onClick);

    S13.addEventListener (MouseEvent.CLICK, onClick);

    S14.addEventListener (MouseEvent.CLICK, onClick);

    S15.addEventListener (MouseEvent.CLICK, onClick);

    S16.addEventListener (MouseEvent.CLICK, onClick);

    S17.addEventListener (MouseEvent.CLICK, onClick);

    function onClick(e:MouseEvent):void

    {

    var click: MovieClip = MovieClip (e.target);

    for (var i: int = 0; i < numChildren; i ++)

    {

    If (getChildAt (i) is the MovieClip) {}

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

    If (mc.props.ind < = clicked.props.ind)

    TweenLite.to (mc, 1, {x: mc.props.lx, ease:Expo.easeOut});})

    on the other

    TweenLite.to (mc, 1, {x: mc.props.rx, ease:Expo.easeOut});})

    }

    }

    }

    S1. B1.addEventListener (MouseEvent.CLICK, onBtn1Press);

    function onBtn1Press(e:MouseEvent)

    {

    trace ("button 1 pressed");

    }

    You must enable debugging so you can see the line of code to the origin of the problem, but looking at your code, it looks like the problem:

    var click: MovieClip = MovieClip (e.target);

    Fix it

  • Error encountered frying to install the first instance of Adobe Acrobat DC on MAC

    Error encountered frying to install the first instance of Adobe Acrobat DC on MAC

    Uninstall all acrobat/readers and try again.

    If you continue to see a mistake, attach a screenshot of it.  is there is none or it is non-specific, troubleshooting install problems with log files. CS5, CS5.5, CS6

  • Error 1034

    I'm a muse of om error 1034 hvile opdating a site. He will not go, cannot shut down, restart or something else.

    What should I do?

    Walter

    Hi Walter

    Could you please share your with us .muse file to study? Please send it to [email protected]. If your file is larger than 20 MB, you can use something like Adobe SendNow SendThisFile or Dropbox. Don't forget to mention the link to this forum thread in your email so that we can identify the file.

  • Error 1034 trying to save.

    I was going to post this in the bug report form, but Adobe Muse is not listed.

    The error is simple, when I try to save my progress, I get this error. "Error #1034: could not convert...". "as pictured below. After clicking OK, the program crashes. When I reopen it Muse, he once prompted me with a different error (unfortunately did not record the error #) but I was unable to reproduce this error as rather now it asks just to try to recover my last action.

    The error appeared if stop after 4 tries to save, and I was able to save under a different name and does not replace the old one. I tried to recreate the error with other files, but without success.

    Error_and_Adobe_Muse_CC_and_JFH_Photobooths_LLC.jpg

    UPDATE:

    After the opening of the 2nd copy of the file, I received this mentioned error rain high, but could not recreate. I got this 4 'missing links' WARNING since I added a new photo gallery. I don't know if it's a bug from the engine of Gallery or just how files are stored on my server. In addition to the error, I noticed a few other 3 random files and files of muse.

    Error_and_site_update_gallery_2.jpgerror other random files.jpg

    Thanks for the detailed post. Please send the file MuseLog.txt of the 'Documents' folder to my attention at [email protected]. I would like to see what additional information it contains about the errors you encounter. Thank you.

  • 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 #1034: Doesn't have a Type constraint

    import flash.events. *;

    import flash.display. *;

    var origX:Number;

    var origY:Number;

    var target: DisplayObject;

    var matchNum:uint;

    redClick.buttonMode = true;

    blueClick.buttonMode = true;

    yellowClick.buttonMode = true;

    redClick.addEventListener (MouseEvent.MOUSE_DOWN, redDrag);

    function redDrag(event:MouseEvent):void

    {

    redClick.origX = redClick.x;

    redClick.origY = redClick.y;

    blueClick.origX = blueClick.x;

    blueClick.origY = blueClick.y;

    yellowClick.origX = yellowClick.x;

    yellowClick.origY = yellowClick.y;

    stage.addEventListener (MouseEvent.MOUSE_UP, drop);

    redClick.startDrag ();

    stage.addChild (this);

    }

    blueClick.addEventListener (MouseEvent.MOUSE_DOWN, blueDrag);

    function blueDrag(event:MouseEvent):void

    {

    redClick.origX = redClick.x;

    redClick.origY = redClick.y;

    blueClick.origX = blueClick.x;

    blueClick.origY = blueClick.y;

    yellowClick.origX = yellowClick.x;

    yellowClick.origY = yellowClick.y;

    stage.addEventListener (MouseEvent.MOUSE_UP, drop);

    blueClick.startDrag ();

    stage.addChild (this);

    }

    yellowClick.addEventListener (MouseEvent.MOUSE_DOWN, yellowDrag);

    function yellowDrag(event:MouseEvent):void

    {

    redClick.origX = redClick.x;

    redClick.origY = redClick.y;

    blueClick.origX = blueClick.x;

    blueClick.origY = blueClick.y;

    yellowClick.origX = yellowClick.x;

    yellowClick.origY = yellowClick.y;

    stage.addEventListener (MouseEvent.MOUSE_UP, drop);

    yellowClick.startDrag ();

    stage.addChild (this);

    }

    function drop(event:MouseEvent):void

    {

    stage.removeEventListener (MouseEvent.MOUSE_UP, drop);

    stopDrag();

    If (redClick.hitTestObject (redDrop))

    {

    redClick.visible = false;

    redDrop.alpha = 1;

    matchNum ++;

    }

    If (blueClick.hitTestObject (blueDrop))

    {

    blueClick.visible = false;

    blueDrop.alpha = 1;

    matchNum ++;

    }

    If (yellowClick.hitTestObject (yellowDrop))

    {

    yellowClick.visible = false;

    yellowDrop.alpha = 1;

    matchNum ++;

    }

    redClick.x = redClick.origX;

    redClick.y = redClick.origY;

    blueClick.x = blueClick.origX;

    blueClick.y = blueClick.origY;

    yellowClick.x = yellowClick.origX;

    yellowClick.y = yellowClick.origY;

    If (matchNum > 2)

    {

    MovieClip (parent) .gotoAndStop (2);

    }

    }

    Stop();

    Here is the error:

    TypeError: Error #1034: Type coercion failed: cannot convert flash.display::Stage@4c845089 to flash.display.MovieClip.

    at dragdrop_fla::Symbol1_1/drop()

    Pls help ~ ~ ~ > n <

    the problem is caused by these statements:

    stage.addChild (this);

    those to change:

    this.parent.addChild (this);  or "this" reparenting to the main timeline instead of the stage when you need to reference the main timeline.

    p.s. "this" will be visible throughout your main timeline unless you were using removeChild.  That is to say, you can:

    {if(matchNum>2)}

    this.parent.removeChild (this);

          MovieClip (this.parent) .gotoAndStop (2);

    }

Maybe you are looking for