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

Tags: Adobe Animate

Similar Questions

  • Help please! I using Muse (the free trial version) very well since last week, but the last few times I tried to use it, it comes back with ' TypeError: Error #1009 pouvez anyonve tried to use it, it comes back with ' error can all

    Help please! I using Muse (the free trial version) very well since last week, but the last few times I tried to use it, it comes back with ' TypeError: Error #1009 pouvez anyonve tried to use it, it comes back with ' error can someone help me figure out what the problem... I have a few days I really help neee what the problem is... I have a deadline in a few days so I really need! Thank you

    Screen Shot 2015-05-11 at 20.32.34.png

    Restart your Mac. The OSX Drag Manager got in a bad state. The only way to reset it is to restart your computer.

  • Get the error ORA-39146 while trying to import data from 10 g to 12 c

    Hi all


    im getting below error while trying to import data from 10 g to 12 c


    ORA-39146: schema 'B_SITES' does not exist
    import in WE8MSWIN1252 and AL16UTF16 NCHAR character set
    export in the UTF8 character set and AL16UTF16 NCHAR character set
    ATTENTION: the possible loss of data to character set conversions


    can someone help how do we change to WE8MSWIN1252 UTF8 character set...

    Hello

    "ORA-39146: there is no schema 'B_SITES'.

    ORA-39146: schema 'string' does not exist

    Cause: The specified schema was referenced as the source of a REMAP_SCHEMA parameter, but did not exist in the dump file (for

    Action: Specify the correct name of the schema to be remapped.

    Anand

  • HTTP 404 error when trying to import

    Hello

    I'm trying to import an application into our environment UAT, I've exported from the development environment, but am redirected to the HTTP 404 - page not found page error when I click on the button import. I also tried to import the application in the same instance I exported from, to see if it was a specific database issue, but get the same result.

    Export Db version: 10.2.0.2.0
    Version of Db Import: 10.2.0.4.0
    APEX version: 3.2.0.00.27

    Here's a sample from the Apache error log file:

    [Mon Sep 24 12:11:09 2009] [error] [client 10.17.14.12] [ecid: 1251112269:10.17.8.36:31956:19164:1, 0] mod_plsql: /pls/apex/wwv_flow.accept HTTP-404-ORA-00942: table or view does not exist\n
    [Mon Sep 24 12:11:09 2009] [error] [client 10.17.14.12] [ecid: 1251112269:10.17.8.36:31956:19164:2, 0] method not valid in demand - 7d92713d041a

    I have also ensured that the PlsqlNLSLanguage entry is commented on the dads.conf file, to make sure there is no confusion about the character set, but that made no difference either.

    I hope someone out there can help you!

    See you soon,.

    Dougie

    Published by: user10990624 on August 24, 2009 06:04

    Dougie,

    The attempt to use SQL * Plus to import the application is a distraction from the real problem.

    It seems that you have users/developers connect development apex using Basic authentication challenge. You should not do this. You must create a standard DADDY with the username apex_public_user and the password eventually obfuscated and the PlsqlNLSLanguage entry. Developers should use this DAD in requests for applications development environment. End users can continue to run applications that you develop using the DAD who forces the stimulation of authentication. Some things will fail if they run applications through connections of DAD who do not have expected of the PlsqlNLSLanguage input.

    Scott

  • Trying to import video, but have the error "error abandoned video playback.

    Hello

    can someone tell me what the error message means, I'm trying to import a video into my project, but I think it is it prevents loading. My code looks like this:

    I have downloaded movies to my adobe server and made the film directory is exactly the same but still having not much of chance. does anyone know how to get around it?

    Thank you

    Hey

    only, I had the wrong file directory, does not need to reference the page on which it is.

    but thanks for your response

    Emily

  • 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

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

  • TypeError: Error #1034-&gt; you want to display a swf

    Hello

    I m new to AS3 and try to load/display swf´s on the scene. The swf´s should run, and if the user clicks on a button the following swf should be displayed.

    So far, this works if I use certain swf´s that are also created with Flash Player 9 and AS3. But if I use a swf file created by someone else I get a TypeError: Error #1034. So far, I have no idea why this happens. Maybe you can take 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's the XML:

    < banner >

    banner1.swf < item > < / item >

    banner2.swf < item > < / item >

    banner3.swf < item > < / item >

    < / banners >

    The complete error (in German :)

    TypeError: Error #1034: Typumwandlung fehlgeschlagen: flash.display::AVM1Movie@34d4df9 kann nicht in flash.display.MovieClip transformed werden.
    at teaser_fla::MainTimeline/setMovieClip()

    The problem will be related to trying to manipulate a file AS1/AS2 with AS3... can't do.  In this case, you are probably just look at the first few errors when you try to manipulate an AS2 object by attempting to cast as an AS3 MovieClip object.  You run into problems later when you try to check/read on this file (currentFrame isn't AS1/AS2 property, but you are trying to extract).

    By the Flash help documentation...

    "ActionScript 3.0 code can load a SWF file written in ActionScript 1.0 or 2.0, but it can not access the functions and variables to the SWF file."

    You can implement the LocalConnection class to overcome some of the problems, but if you use files from other people, you're likely to hit a wall...

    "Created in ActionScript 3.0 LocalConnection objects can communicate with LocalConnection objects created in ActionScript 1.0 or 2.0.

    The reverse is also true: created in ActionScript 1.0 or 2.0 LocalConnection objects can communicate with LocalConnection objects created in ActionScript 3.0. Flash Player automatically manages the communication between different versions of LocalConnection objects. »

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

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

    The error said that there is a forced conversion of a charger to a movieclip.

    I use a container movie main.swf to load a film of the child. The film child 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 film main charger is movie.swf has its code in a doc Main.as

    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 void Main()

    {

    this.addEventListener (Event.ADDED_TO_STAGE, init);

    }

    init(e:Event):void private function

    {

    loadFile ("child.swf");

    }

    loadFile(path:String):void private function

    {

    var myRequest:URLRequest = new URLRequest (path);

    myLoader.load (myRequest);

    myLoader.contentLoaderInfo.addEventListener (ProgressEvent.PROGRESS, loadProgress);

    myLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, loadComplete);

    }

    loadProgress(evt:ProgressEvent):void private function

    {

    var amountLoaded:Number = (evt.bytesLoaded / evt.bytesTotal) * 100;

    trace ("loading: %" + amountLoaded);

    }

    loadComplete(evt:Event):void private function

    {

    trace ("Complete-" + evt.target.content);

    addChild (myLoader);

    }

    public void traceF)

    {

    trace (globalVar);

    }

    }

    }

    If you load the SWF in another swf using the class Loader, the loader is the parent of the loaded file.  The parent of the charger is the main swf, you are probably after... MovieClip (parent.parent) from the point of view of the loaded file.

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

  • I just tried to update Firefox to version 9.0.1. Extract of 13%, and then I got an error message cannot open output file. Can you help me please?

    I just tried to update Firefox to version 9.0.1. Extract of 13%, and then I got the error message cannot open output file.

    The file can be uploaded incorrectly. Could you it redownload again from http://getfirefox.com?

  • I tried to install Windows Vista SP1 since July without success. I stopped trying in October but just tried it once more and I get the error code 8024200d message when it fails to install.

    I tried to install Windows Vista SP1 since July without success. I stopped trying in October but just tried it once more and I get the error code 8024200d message when it fails to install.

    See this previous thread on the problem: http://www.google.com/search?hl=en&safe=off&rls=com.microsoft: en - US & q = + site: social.technet.microsoft.com + 8024200d & ei = hkchS4O6M9HolAfh8viLCg & a = X & oi = forum_cluster & resnum = 1 & ct = more results, & ved = 0CA0QrQIwAA

    Unlimited installation and compatibility for Vista SP1 support is available free of charge from April 2008, through June 30, 2009.  This support now will cost $59 us $ (or more) per incident.

    Good luck!

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • Just installed Windows 7. Windows udate watch 21 important security updates but they will install. I get the error code 80070539. Tried to install the updates but the shut down the computer, but the computer stops until they install.

    Just installed Windows 7. Windows udate watch 21 important security updates but they will install. I get the error code 80070539. Tried to install updates by shutting down the computer, but the computer stops until they install.

    Hello Tallydupp, welcome.

    Do you by chance have Google Desktop? Some users have reported interference problems in Winodws 7 while using an older version of Google Desktop.
    Try to uninstall it if it exists.

    Let us know what happens

    Thank you! Ryan Thieman
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • I wanted to install the trial version of indesign creative cloud cc. and sucsessfull. but when I want to run the program it just a massage of error: Error 11. I tried many things on aldready support center, but there is no s

    I wanted to install the trial version of indesign creative cloud cc. and sucsessfull. but when I want to run the program it just a massage of error: Error 11. I tried a lot about aldready support center, but there is no solution. Can you help me?

    Hi Ninat43034799,

    Please uninstall InDesign CC to your machine using the cleaning tool: use of the Adobe Creative Cloud cleaning tool to solve installation problems

    After that, reinstall the product of your creative cloud desktop application.

    Let us know if this was helpful, waiting for your response.

Maybe you are looking for

  • Satellite L300-13R - WLAN does not not on Windows 7

    I am on Windows 7, it can't detect the wireless device, says I need to reinstall the driver, vista and xp driver install it as they say that they do not support my opperating system. I currently have to plug an ethernet cable to get internet. I use a

  • Webcam Logitech B910 work 6.14 to 6.18

    [The update by the moderator topic title should be more descriptive. [Original topic title was: 'Webcam does not work'] Hello Like many others my webcam does not work with Skype. It works well with other applications, but it does not detect Skype. In

  • W540 Freeze on boot screen, when it is connected to the docking station

    Occurred when docked to a docking (so far) OS - Windows 7 Pro 64 BIOS 2.24

  • How to save a binary image

    Hello everyone. How to save a binary image in a computer? If I right click on the image, then choose "Save Image... ', the saved image will appear empty. I understand that the image is in 0 and 1 but I do not know how to implement the code. Thank you

  • HP series 3510 icon on the desktop does not open print Center

    Just create new pc with Windows 7.  Reinstalled HP series 3510 printer and desktop icon appears, but do not open the ink levels showing Print Center and printing/scanning options.  I went to devices and printers in Control Center and click with the r