Implicit coercion of a value of type flash.display:MovieClip to an unrelated type Class.

These are my errors: in Adobe Flash CS5.5
I don't understand why this script doesn't work. I am new to Action Script 3.0 and I watched this incomplete video on youtube. -- http://www.youtube.com/watch?v=LC7BaZCForE&feature=relmfu -- and I got the fails below.
Scene 1, Layer 'actionscript', Frame 1, Line 11 1067: Implicit coercion of a value of type flash.display:MovieClip to an unrelated type Class.
Scene 1, Layer 'actionscript', Frame 1, Line 11 1118: Implicit coercion of a value with static type Object to a possibly unrelated type flash.display:DisplayObject.
Main Timeline:
import flash.filters.GlowFilter;
import flash.events.MouseEvent;
import flash.display.MovieClip;
var navBtnGlow:GlowFilter = new GlowFilter(0x999999, 0.5, 0, 15, 1, 2, true, false);
navbar_jj.addEventListener(MouseEvent.MOUSE_OVER, navOverF);
navbar_jj.addEventListener(MouseEvent.MOUSE_OUT, navOutF);
function navOverF(event:MouseEvent):void{
     event.target.filters = [navBtnGlow];
navbar_jj.setChildIndex(event.target as MovieClip(event.target), 1);
dropmenus_jj.gotoAndStop(navbar_jj.getChildAt(1).name);
trace("We are Rolled Over..." + navbar_jj.getChildAt(1).name)
function navOutF(event:MouseEvent):void{
     event.target.filters = [];
Clicker Drop Down
import flash.events.MouseEvent;
stop();
leadersframe_btn.addEventListener(MouseEvent.MOUSE_OVER, goBackF);
function goBackF(event:MouseEvent):void{
    gotoAndStop (1);

Use:
navbar_jj.setChildIndex(MovieClip(event.target), 1);
Or
navbar_jj.setChildIndex(DisplayObject(event.target), 1);

Similar Messages

  • 1067: Implicit coercion of a value of type Class to an unrelated type flash.display:MovieClip

    Hello, i've a class named LoadImages with the code:
    package
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import flash.events.Event;
        import flash.display.Loader;
        public class LoadImages extends MovieClip
            private var _root:MovieClip=new MovieClip();
            public function LoadImages(numImages:Number, rt:MovieClip)
    and i've a second class named MainJogo that call's LoadImages:
    package
        import flash.events.*;
        import flash.display.Loader;
        import flash.display.MovieClip;
        import flash.display.Stage;
        import LoadImages;
        public class MainJogo
             #error
            private var imgMc:LoadImages=new LoadImages(2,this);
              #error
            public function MainJogo(url:String)
    if i just post the MainJogo class code in TimeLine there is no problems but if i run the app like this with 2 classes i keep getting the error
    1067: Implicit coercion of a value of type Class to an unrelated type flash.display:MovieClip.
    Can someone help me please?
    thanks

    MainJogo is not a Movieclip so "this" (in the scope of MainJogo) is not a MovieClip.
    if MainJogo did extend the movieclip class, you would probably still need to cast "this" as a MovieClip.
    you could use:
    package
        import flash.events.*;
        import flash.display.Loader;
        import flash.display.MovieClip;
        import flash.display.Stage;
        import LoadImages;
        public class MainJogo extends MovieClip
    private var imgMc:LoadImages=new LoadImages(2,MovieClip(this));
            public function MainJogo(url:String)

  • 1067: Implicit coercion of a value of type void to an unrelated type Array.

            public function Helicopter (stageRef:Stage) : void
                this.stageRef =stageRef;
                addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
                addEventListener(Event.ENTER_FRAME, Backdrop);
                key = new KeyObject(stageRef);
                x = stageRef.stageWidth/2;
                y = stageRef.stageHeight/2;
    I'm basically having the following error:
    1067: Implicit coercion of a value of type void to an unrelated type Array.
    In relation to the event listener that calls 'Backdrop'. Backdrop is a public function in another class, but it does still recognise Backdrop as a function. Any ideas on what might be causing the error?

    there's no Backdrop method there.  and, if you're importing your Backdrop class, you can't use a Backdrop method.  i don't know what you're trying to do but if you're trying to create a Backdrop instance use the following:
    package com.chopper.helicopter
                import flash.display.MovieClip;
                import flash.events.Event;
                import com.senocular.utils.KeyObject;
                import flash.display.Stage;
                import flash.ui.Keyboard;
            public class Backdrop extends flash.display.MovieClip
            public function Backdrop() : void
      trace ("Working code")
    /* none of this makes sense
                x += vx;
                if (vx > maxspeed)
                    vx = maxspeed;
                else if (vx < -maxspeed)
                    vx = -maxspeed;
    package com.chopper.helicopter
        import flash.display.MovieClip;
        import flash.events.Event;
        import com.senocular.utils.KeyObject;
        import flash.display.Stage;
        import flash.ui.Keyboard;
        public class Helicopter extends MovieClip
            private var gravity:Number = 1;
            private var vy:Number = 0;
            public var vx:Number = 0;
            private var key:KeyObject;
            private var stageRef:Stage;
    private var bd:Backdrop;
            public var maxspeedG:Number = 6;
            public var maxspeed:Number = 3;
            private var friction:Number = 0.92;
            public function Helicopter (_stageRef:Stage) : void
                stageRef =_stageRef;
                addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
                trace ("working code")
                addEventListener(Event.ADDED_TO_STAGE, backdropF);
                key = new KeyObject(stageRef);
                x = stageRef.stageWidth/2;
                y = stageRef.stageHeight/2;
    private function backdropF(e:Event):void{
    bd=new Backdrop();
    stageRef.addChild(bd);
            public function loop(e:Event) : void
    // some of these variables appear to be undefined
                vy += gravity;
                y += vy;
                x += vx;
                if (vy > maxspeedG)
                    vy = maxspeedG;
                else if (vy < -maxspeed)
                    vy = -maxspeed;
                if (vx > maxspeed)
                    vx = maxspeed;
                else if (vx < -maxspeed)
                    vx = -maxspeed;
                if (vx > 0)
                    scaleX = 1;
                else if (vx < 0)
                    scaleX = -1;
                if (y > stageRef.stageHeight)
                    y = stageRef.stageHeight;
                    vy = -8
                rotation = vx*2;
                if (key.isDown(Keyboard.RIGHT))
                    vx += .5;
                else if (key.isDown(Keyboard.LEFT))
                    vx -= .5;
                else
                    vx *= friction;
                if (key.isDown(Keyboard.UP))
                    vy -= 1;
                else if (key.isDown(Keyboard.DOWN))
                    vy += .5;

  • 1067: Implicit coercion of a value of type String to an unrelated type

    Hi,
    I created a webservice based on sql server 2005 with several methods successfully.
    I am having headach now just trying to do some simple tests with Flex :-(
    I used the "Import WebService", it created some code "generated webservices".
    My test method p_SEARCH_NAME_SOUNDEX is based on a sql procedure wich take a varchar (128) as a parameter => NAL_NOM.
    I am just trying to debug this function (error at line in red)
           public function searchEntry(name:String):void
                // Register the event listener for the findEntry operation.
                //agenda.addfindEntryEventListener(handleSearchResult);
                myWS.addp_SEARCH_NAME_SOUNDEXEventListener(handleSearchResult);
                // Call the operation if we have a valid name.
                if(name!= null && name.length > 0)
                   myWS.p_SEARCH_NAME_SOUNDEX(name);
    I got this error message:
    067: Implicit coercion of a value of type String to an unrelated type generated.webservices:NAL_NOM_type1.
    FLEX has creaetd a type called NAL_NOM_type1 for my class:
    * NAL_NOM_type1.as
    * This file was auto-generated from WSDL by the Apache Axis2 generator modified by Adobe
    * Any change made to this file will be overwritten when the code is re-generated.
    package generated.webservices
        import mx.utils.ObjectProxy;
        import flash.utils.ByteArray;
        import mx.rpc.soap.types.*;
         * Wrapper class for a operation required type
        public class NAL_NOM_type1
             * Constructor, initializes the type class
            public function NAL_NOM_type1() {}
            public var varchar:String;public function toString():String
                return varchar.toString();
    I tried to do myWS.p_SEARCH_NAME_SOUNDEX(NAL_NOM_type1(name));
    and also declared "name" as NAL_NOM_type1... but i still get this error.
    This is how it declared my webservice method:
            public function p_SEARCH_NAME_SOUNDEX(nAL_NOM:NAL_NOM_type1):AsyncToken
                 var _internal_token:AsyncToken = _baseService.p_SEARCH_NAME_SOUNDEX(nAL_NOM);
                _internal_token.addEventListener("result",_P_SEARCH_NAME_SOUNDEX_populate_results);
                _internal_token.addEventListener("fault",throwFault);
                return _internal_token;
    I am even not on the level of assigning the data to my grid... i just want to see how it gets the data first in debug.
    Thanks in advance for you help.
    kr,
    Meta

    Thanks _Natasha_
    I tried this:
    var t = new NAL_NOM_type1();
    t.varchar = name;
    myWS.p_SEARCH_NAME_SOUNDEX(t);
    It passes the 1st step :-) but I get another error now :-/
    I think it try to get back NAL_NOM_type1 from the server of course on the WSDL side it know only NAL_NOM
    Error: Cannot find definition for type 'http://NABSQL64DEV/::NAL_NOM_type1'
        at mx.rpc.xml::XMLEncoder/encodeType()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc \xml\XMLEncoder.as:1426]
    I guess I have to change my constructor type... i am not used to these stuff :-s
    is this generating method the best way to access your data with webservices?
    the turorials I saw are xml file or array based... is there any link similar to my issue so I can learn better?

  • Implicit coercion of a value of type String to an unError while Adding Dynamic Rows To Flex DataGrid

    Hi friends
    I  want to add interger for in next next rows while clicking tab  button,one i enter all the values in one row if i press tab means next  row will be editable.for making that i added the following code.i have  some error shows like this
        [Bindable]
                    private var tasks:ArrayCollection;
                    private static const ADD_TASK:int= "";
                    private function init():void
                        tasks = new ArrayCollection();
                        tasks.addItem(new Task(0.01,100000,0));
                        tasks.addItem({frmAmount:ADD_TASK});
                    private function checkEdit(e:DataGridEvent):void
                        // Do not allow editing of Add Task row except for
                        // "Click to Add" column
                        if(e.rowIndex == tasks.length - 1 && e.columnIndex != 0)
                            e.preventDefault();
            private function editEnd(e:DataGridEvent):void
                    // Adding a new task
                    if(e.rowIndex == tasks.length - 1)
                    var txtIn:TextInput =TextInput(e.currentTarget.itemEditorInstance);
                    var dt:Object = e.itemRenderer.data;
                    // Add new task
                    if(parseInt(txtIn.text) != ADD_TASK)
                        tasks.addItemAt(new Task(parseInt(txtIn.text), 0, ""), e.rowIndex);----->Multiple markers at this line:
                                                                                                                             -1067: Implicit coercion of a value of type String to an unrelated type int.
                                                                                                                                -txtIn
                    // Destroy item editor
                    commPlanDetGrid.destroyItemEditor();
                        // Stop default behavior
                    e.preventDefault();
            ]]>
    Please help if any suggession
    Thanks in advance
    B.Venkatesan

    The error message indicates the problem fairly clearly.  _feed_list is defined as a ComboBox in your first line of code.  You are passing that as an argument in your populate(_feed_list) line of code.  However, the populate function is expecting an XMLList object to be passed, not a ComboBox.
    You probably really mean to be using...
              populate(feed_items);
    since that is the only XMLList to be found

  • Error:1067 - Implicit coercion of a value of type QName to an unrelated type QName

    hi,
    I'm new in flex and my english not good. I'll try to explain
    my problem :(
    I have an application mxml and a component mxml. I imported a
    wsdl from .net webservice.
    In main mxml I added:
    <mx:Application .....
    xmlns:webservices="generated.webservices.*"/>
    and
    <webservices:xService id="m_service"/>
    there is no problem for this. But when I added into component
    mxml like this:
    <mx:Canvas.....
    xmlns:webservices2="generated.webservices.*"/>
    and
    <webservices2:xService id="m_service2"/>
    I'm getting the following error:
    error line sample: (and 633 similar lines in
    generated.webservices)
    responseMessage.wrappedQName = new QName("
    http://tempuri.org/","GetMemberListResponse");
    error:
    1067: Implicit coercion of a value of type QName to an
    unrelated type QName
    When I removed the <webservices2:xService
    id="m_service2"/> line from component mxml, I'm not getting an
    error.
    Flex 3.0 - sdk 4.0
    Thanx for your helps

    thanx your answer,
    I changed (like this:[WebService(Namespace = "
    http://Info.WebService/MyInfoService"))
    but it doesn't work. I still have same problem.
    It's really strange problem. When I used in application mxml,
    it's working. But when I used in component mxml, I'm getting error.
    I tested the web servise in other test application mxml with
    following code: (it's working excellent)
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" xmlns:webservices="generated.webservices.*"
    creationComplete="test12()">
    <mx:Script>
    <![CDATA[
    import mx.rpc.AsyncToken;
    private function test12():void
    m_service12.addgetFuelList_header(GetAuthHeader());
    m_service12.getFuelList();
    ]]>
    </mx:Script>
    <mx:Script source="***/ServiceAuthHeaderGetter.as"/>
    <webservices:TankInfoService id="m_service12"/>
    <mx:DataGrid
    dataProvider="{m_service12.getFuelList_lastResult}">
    </mx:DataGrid>
    </mx:Application>
    And finally I closed "Enable strict type checking" from
    project properties and the errors are disappeared.
    But now I got new problems with webservice :)
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    I guess <webservices:TankInfoService id="m_service"/>
    is null.
    But why?
    in component mxml
    I added xmlns:webservices="generated.webservices.*" namespace
    and
    <webservices:TankInfoService id="m_service"/>
    my code is:
    m_service.addgetMemberList_header(GetAuthHeader());
    m_service.getMemberByUserPassword(this.txtUser.text,
    this.txtPassword.text);
    the error:
    TypeError: Error #1009: Cannot access a property or method
    of a null object reference.
    Any ideas???

  • 1067: Implicit coercion of a value of type void to an unrelated type mx.collections:ArrayCollection.

    Here is what I have going on.
    When a button in my app is clicked it will instantiate a new object called ButtonCommand, within that object I create a new instance of a ListVO called vo.  I then reference my model object that also has a separate instance of the same Value Object ListVO class, reference its properties and place it into the corresponding property of the new VO object. Here is the code.
    var vo:ListVO = new ListVO();
    vo.name = model.list.name;
    vo.id = model.list.id;
    vo.amount = model.list.amount;
    vo.category = model.list.category;
    Within that same ButtonCommand class, next line I am trying to add the new ListVO instance to an arrayCollection that is also referenced from my model object, so here is the code for that.
    model.listCollection = model.listCollection.addItem(vo);
    I get the following error : -1067: Implicit coercion of a value of type void to an unrelated type mx.collections:ArrayCollection.
    And here is my getter/setter for the model.listCollection.
    public function get listCollection ():ArrayCollection
          return _listCollection;
    public function set listCollection(value:ArrayCollection):void
          _listCollection = value;
    Any Ideas?

    I thought model.listCollection is an ArrayCollection?
    model.listCollection is an ArrayCollection as shown in the example model code a few posts back.
    public class Model extends Actor
         //- PROPERTIES - //
         //-- other properties are here
         private var _listCollection:ArrayCollection = new ArrayCollection();
         public function Model()
         super();
         //other getter and setters here
         public function get listCollection ():ArrayCollection
         return _listCollection;
         public function set listCollection(value:ArrayCollection):void
         _listCollection = value;
    I am finding this to be very odd, seems like a simple getter setter situation, but I feel I must be missing something. The code trace(model.listCollection); should trace out as an ArrayCollection and not the VO object I am trying to add to it. Also when i run the code model.listCollection.addItem(vo); it should add the vo to the array collection through my setter, but yet it seems to try to access my getter.
    I took Kglads advice and traced out  _listCollection within my getter before my return statement and it returns [object ListVO]..... confused for sure. I am going to change the _listCollection property in the model from private with a getter/setter to a public and see what happens.

  • Error while migrating to Flex 4.5.1 (1067: Implicit coercion of a value...)

    I am getting the following error while migrating my application from Flex 3.6 to Flex 4.5.1:
    1067: Implicit coercion of a value of type __AS3__.vec:Vector.<Object> to an unrelated type Array.
    The error is thrown on the following piece of code:
    var list:ArrayCollection=new ArrayCollection(dgSoftwareTitles.selectedItems);
    dgSoftwareTitles is defined as:
    <s:DataGrid id="dgShareCategoryForTransfer"
    x="34"
    y="369"
    requestedRowCount="5"
    width="90%"
    selectedIndex="-1"
    selectionMode="multipleRows">
    <s:columns>
    <s:ArrayList>
    <s:GridColumn headerText="SoftwareTitle"
    dataField="idSoftware"
    visible="false"/>
    <s:GridColumn headerText="SoftwareName"
    dataField="softwareName"
    visible="false"/>
    ...more GridColumns
    </s:columns>
    </s:ArrayList>
    </s:DataGrid>
    Any ideas why this would trow the "1067: Implicit coercion of a value of type __AS3__.vec:Vector.<Object> to an unrelated type Array" error?
    Thanks!
    Lee

    I think that dgSoftwareTitles.selectedItems is a type of Vector while
    public function ArrayCollection(source:Array = null) expects an array as a source.

  • 1061: Call to a possibly undefined method setSize through a reference with static type flash.display:SimpleButton.

    Hi all.
    I am trying to set the size of the buttons on my site:
    http://www.samtest09.nineteenseventysix.com
    i am using the script:
    imagesb_btn.setSize(width, height);
    imagesb_btn.setSize(100, 50);
    but i keep getting the above error message when i try to publish.
    As far as i am aware im using as3 script in an as3 movie.
    Thanks for any help

    thanks for that Raymond, it works fine.
    now what id really like to ask is, is there a way that now i have set the size, the button will stay that size no matter what size browser or screen your on?
    i.e. the site has the buttons on the left and is set to fullscreen. but if i restore down the button gets smaller the smaller the screen gets. i would like the button to stay the same size.
    Thanks for your help
    stuart

  • For ... in loop giving me an "implicit coercion" error--but describeType says I've got right type?

    Hi All,
    I've got the following code:
    var currentStateIndex:int = 0;
    for (var index:int in this.states){
         if(this.currentState == this.states[index].name){
              currentStateIndex = index;
              break;
    I'm trying to identify the index of the current state.  It's giving me an error on the for line, saying "Implicit coercion of a value of type String to an unrelated type int."  Hmm, strange, I thought--wouldn't the keys of the this.states array (and it is just a plain vanilla array) be integers?
    So, I tried this:
    var currentStateIndex:int = 0;
    for (var index:* in this.states){
         var theType:* = flash.utils.describeType(index);
         if(this.currentState == this.states[index].name){
              currentStateIndex = index;
              break;
    I used the debugger to inspect the value of theType.  It's this:
    <type name="int" base="Object" isDynamic="false" isFinal="true" isStatic="false">
      <extendsClass type="Object"/>
      <constructor>
        <parameter index="1" type="*" optional="true"/>
      </constructor>
    </type>
    So, indeed, describeType says that the index value is of type "int"... so why can't I strongly type it as an int?

    rtalton wrote:
    This works:
                    var currentStateIndex:int;
                     for (var idx:String in this.states) {
                        if (this.currentState == this.states[idx].name) {
                            //the names match!
                            currentStateIndex = int(idx);//cast as an integer.
                            break;
    But using your method you will never get a match for the base state, which is always "null", and does not have a name property.
    What is the right way to identify the index of the current state, if the current state is the default state?

  • What is the best way of dealing with an "implicit coercion" of an array to a sprite?

    Hello everyone!
         With continued help from this forum I am getting closer to having a working program. I look forward to being able to help others like myself once I finish learning the AS3 ropes.
         I will briefly explain what I am trying to achieve and then follow it up with my question.
    Background
         I have created a 12 x 9 random number grid that populates each cell with a corresponding image based on each cell's numeric value. I have also created a shuffle button that randomizes the numbers in the grid. The problem I am running into is getting my button-click event to clear the current images off the grid in order to assign new ones (i.e. deleting the display stack objects in order to place news ones in the same locations).
    Question
         My question is this: what is the best way to handle an implicit coercion from an array to a sprite? I have pasted my entire code below so that you can see how the functions are supposed to work together. My trouble apparently lies with not being able to use an array value with a sprite (the sprite represents the actual arrangement of the grid on the display stack while the array starts out as a number than gets assigned an image which should be passed to the sprite).
    ============================================================================
    package 
    import flash.display.MovieClip;
    import flash.display.DisplayObject;
    import flash.events.MouseEvent;
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFormat;
    import flash.utils.getDefinitionByName;
    public class Blanko extends MovieClip
          // Holds 12*9 grid of cells.
          var grid:Sprite;
          // Holds the shuffle button.
          var shuffleButton:Sprite;
          // Equals 12 columns, 9 rows.
          var cols:int = 12;
          var rows:int = 9;
          // Equals number of cells in grid (108).
          var cells:int = cols * rows;
          // Sets cell width and height to 40 pixels.
          var cellW:int = 40;
          var cellH:int = 40;
          // Holds 108 cell images.
          var imageArray:Array = [];
          // Holds 108 numerical values for the cells in the grid.
          var cellNumbers:Array = [];
          // Constructor calls "generateGrid" and "makeShuffleButton" functions.
          public function Blanko()
               generateGrid();
               makeShuffleButton();
      // Creates and displays the 12*9 grid.
      private function generateGrid():void
           grid = new Sprite;
           var i:int = 0;
           for (i = 0; i < cells; i++)
                cellNumbers.push(i % 9 + 1);
           trace("Before shuffle: ", cellNumbers);
           shuffleCells(cellNumbers);
           trace("After shuffle: ", cellNumbers);
           var _cell:Sprite;
           for (i = 0; i < cells; i++)
                // This next line is where the implicit coercion occurs. "_cell" is a sprite that tries
                   to temporarily equal an array value.
                _cell = drawCells(cellNumbers[i]);
                _cell.x = (i % cols) * cellW;
                _cell.y = (i / cols) * cellH;
                grid.addChild(_cell);
      // Creates a "shuffle" button and adds an on-click mouse event.
      private function makeShuffleButton():void
           var _label:TextField = new TextField();
           _label.autoSize = "center";
           TextField(_label).multiline = TextField(_label).wordWrap = false;
           TextField(_label).defaultTextFormat = new TextFormat("Arial", 11, 0xFFFFFF, "bold");
           _label.text = "SHUFFLE";
           _label.x = 4;
           _label.y = 2;
           shuffleButton = new Sprite();
           shuffleButton.graphics.beginFill(0x484848);
           shuffleButton.graphics.drawRoundRect(0, 0, _label.width + _label.x * 2, _label.height +
                                                _label.y * 2, 10);
           shuffleButton.addChild(_label);
           shuffleButton.buttonMode = shuffleButton.useHandCursor = true;
           shuffleButton.mouseChildren = false;
           shuffleButton.x = grid.x + 30 + grid.width - shuffleButton.width;
           shuffleButton.y = grid.y + grid.height + 10;
           this.addChild(shuffleButton);
           shuffleButton.addEventListener(MouseEvent.CLICK, onShuffleButtonClick);
      // Clears cell images, shuffles their numbers and then assigns them new images.
      private function onShuffleButtonClick():void
       eraseCells();
       shuffleCells(cellNumbers);
       trace("After shuffle: ", cellNumbers);
       for (var i:int = 0; i < cells; i++)
        drawCells(cellNumbers[i]);
      // Removes any existing cell images from the display stack.
      private function eraseCells(): void
       while (imageArray.numChildren > 0)
        imageArray.removeChildAt(0);
      // Shuffles cell numbers (randomizes array).
      private function shuffleCells(_array:Array):void
       var _number:int = 0;
       var _a:int = 0;
       var _b:int = 0;
       var _rand:int = 0;
       for (var i:int = _array.length - 1; i > 0; i--)
        _rand = Math.random() * (i - 1);
        _a = _array[i];
        _b = _array[_rand];
        _array[i] = _b;
        _array[_rand] = _a;
      // Retrieves and assigns a custom image to a cell based on its numerical value.
      private function drawCells(_numeral:int):Array
       var _classRef:Class = Class(getDefinitionByName("skin" + _numeral));
       _classRef.x = 30;
       imageArray.push(_classRef);
       imageArray.addChild(_classRef);
       return imageArray;
    ===========================================================================
         Any help with this is greatly appreciated. Thanks!

    Rothrock,
         Thank you for the reply. Let me address a few things here in the hopes of allowing you (and others) to better understand my reasoning for doing things in this manner (admittedly, there is probably a much better/easier approach to what I am trying to accomplish which is one of the things I hope to learn/discover from these posts).
         The elements inside my "imageArray" are all individual graphics that I had imported, changed their type to movie clips using .Sprite as their base class (instead of .MovieClip) and then saved as classes. The reason I did this was because the classes could then be referenced via "getDefinitionByName" by each cell value that was being passed to it. In this grid every number from 1 to 9 appears randomly 12 times each (making the 108 cells which populate the grid). I did not, at the time (nor do I now), know of a better method to implement for making sure that each image appears in the cell that has the corresponding value (i.e. every time a cell has the value of 8 then the custom graphic/class "skin8" will be assigned to it so that the viewer will be able to see a more aesthetically pleasing numerical representation, that is to say a slightly more fancy looking number with a picture behind it). I was advised to store these images in an array so that I could destroy them when I reshuffle the grid in order to make room for the new images (but I probably messed up the instructions).
         If the "drawCell" function only returns a sprite rather than the image array itself, doesn't that mean that my "eraseCells" function won't be able to delete the array's children as their values weren't first returned to the global variable which my erasing function is accessing?
         As for the function name "drawCells," you have to keep in mind that a) my program has been redesigned in stages as I add new functionality/remove old functionality (such as removing text labels and formatting which were originally in this function) and b) that my program is called "Blanko."
         I will try and attach an Illustrator exported JPG file that contains the image I am using as the class "skin7" just to give you an example of what I'm trying to use as labels (although it won't let me insert it here in this post, so I will try it in the next post).
    Thank you for your help!

  • Implicit coercion Error while Adding Dynamic Rows To Flex DataGrid

    Hi friends
    I   want to add interger for in next next rows while clicking tab   button,one i enter all the values in one row if i press tab means next   row will be editable.for making that i added the following code.i have   some error shows like this
        [Bindable]
                    private var tasks:ArrayCollection;
                    private static const ADD_TASK:int= "";
                    private function init():void
                        tasks = new ArrayCollection();
                        tasks.addItem(new Task(0.01,100000,0));
                        tasks.addItem({frmAmount:ADD_TASK});
                    private function checkEdit(e:DataGridEvent):void
                        // Do not allow editing of Add Task row except for
                        // "Click to Add" column
                        if(e.rowIndex == tasks.length - 1 && e.columnIndex != 0)
                            e.preventDefault();
            private function editEnd(e:DataGridEvent):void
                    // Adding a new task
                    if(e.rowIndex == tasks.length - 1)
                    var txtIn:TextInput =TextInput(e.currentTarget.itemEditorInstance);
                    var dt:Object = e.itemRenderer.data;
                    // Add new task
                    if(parseInt(txtIn.text) != ADD_TASK)
                        tasks.addItemAt(new Task(parseInt(txtIn.text), 0, ""), e.rowIndex);----->Multiple markers at this line:
                                                                                                                               -1067: Implicit  coercion of a value of type String to an unrelated type int.
                                                                                                                                  -txtIn
                    // Destroy item editor
                    commPlanDetGrid.destroyItemEditor();
                        // Stop default behavior
                    e.preventDefault();
            ]]>
    Please help if any suggession
    Thanks in advance
    B.Venkatesan

    Venktesan,
    You are trying compare String and int..! which is not possible try to case the txtIn.text to int using parseInt(txtIn.text).
    ORIGINAL:
    if(txtIn.text != ADD_TASK).---->error : Comparison between a value with static type String and a possibly unrelated type int
                        tasks.addItemAt(new Task(txtIn.text, 0, ""), e.rowIndex);----> error:Implicit coercion of a value of type String to an unrelated type int.
    EDITED:
    if(parseInt(txtIn.text) != ADD_TASK).---->error : Comparison between a value with static type String and a possibly unrelated type int
                        tasks.addItemAt(new Task(parseInt(txtIn.text), 0, ""), e.rowIndex);----> error:Implicit coercion of a value of type String to an unrelated type int.
    Thanks
    Pradeep

  • AS3: Classes, subclasses and "implicit coercion"

    Hi.
    I have created several custom classes:
    - Category, containing a string with the category's name.
    - SubCategory, extends Category.
    - CategoryList, containing an array of Category instances and
    a function getCategoryByName.
    - SubCategoryTracer, with a function subTrace that traces the
    name of a given SubCategory.
    When I use subTrace, if the argument is a direct SubCategory,
    it works fine, but if it's the result of getCategoryByName, even
    when it does return a SubCategory object, I get the following
    error:
    1118: Implicit coercion of a value with static type
    tests:Category to a possibly unrelated type tests:SubCategory.
    How can I get this to work? Thanks in advance.

    1. I guess you need to change the code to the following (read the comments):
    // Creates an object from the class called mySample
    var externalFile:mySample = new mySample();
    // allows the program to read the text box as a number
    * these two lines DO NOT read text field values when they change
    * so these two vars are useless unless you want to retain original values
    var num1 = Number(txtBox1.text)
    var num2 = Number(txtBox2.text)
    //Button event listener
    btnCalc.addEventListener(MouseEvent.CLICK, clickHandler);
    function clickHandler(e:MouseEvent):void
              // read textfields' values every time user clicks the button
              resultTextBox.text = String(externalFile.addNumbers(Number(txtBox1.text), Number(txtBox2.text)));
    2. You need to get into a habit to strictly type you variables and objects.
    3. You should get into a habit to declare variable namespace (private, public, etc.) of the variables. SO you class variables declarations should be:
    private var num1:Number;
    private var num2:Number;
    private var answer:Number;
    4. It is wise to name classes starting with upper case - it is a convention that makes AS programmer life easier.
    5. Since your class has no other task but calculate and return new value - declaring additional calss level variables (num1, num2, and answer) introduces an unnecessary overhead. These variables existence would be justified only if they were reused.
    I suggest your class should be like that (note that addNumber method's parameters are typed to Number):
    package
              public class MySample
                        //create a function
                        public function addNumbers(num1:Number, num2:Number):Number
                                  return num1 + num2; //this function returns something that can be used elsewhere

  • Manipulating Flash Library MovieClips in Actionscript

    I drew up some graphic symbols in Illustrator and imported and defined them as MovieClips in the Flash library.
    That way I could just place them where I want to visually on the stage. As I have been solidifying the visual design,
    I have been implementing it in Actionscript to access the flexibility the code provides.
    In order to port a symbol to actionscript I did the following:
    Then in actionscript I tried the following:
    Times2.visible = false;
    The "show code hint" led me think I could do that.
    But I get this error:
    Scene 1, Layer 'Code', Frame 2, Line 37 1119: Access of possibly undefined property visible through a reference with static type Class.
    What am I doing wrong here?
    Thanks

    I tried creating an instance of Times2 in Actionscript.
    var myTimes:Times2 = new Times2();
    myTimes.x = 125.0;
    myTimes.y = 125.0;
    but I get the following error:
    TypeError: Error #1034: Type Coercion failed: cannot convert Times2@2b8ffb89 to fl.motion.AnimatorFactory.
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at Multiply_fla::MainTimeline()
    I don't know why it wants to convert it to fl.motion.AnimatorFactory.
    I checked on-line help and found many instances of frustrated users with error #1034, but they all had
    different circumstances. I could not related them to my own situation.
    Very befuddled,

  • MESSAGE lv_errmsg TYPE 'E' vs. MESSAGE lv_errmsg TYPE 'E' DISPLAY LIKE 'I'.

    Hello!
    What is the difference between these two statements?
    MESSAGE lv_errmsg TYPE 'E'
    MESSAGE lv_errmsg TYPE 'E' DISPLAY LIKE 'I'.

    MESSAGE lv_errmsg TYPE 'E' DISPLAY LIKE 'I'.
    will generate the Information type of message. This will not display the Red message in the status bar. It will give the Popup.
    MESSAGE lv_errmsg TYPE 'E' .
    Will generate the normal error message.
    But, both message will not execute any statement after that.
    Regards,
    Naimesh Patel

Maybe you are looking for

  • Best practice followed on CONTRACT

    Hello All What are the best practice needs to be followed on changing the material data information , Step 1. created a contract for Material and PO released agains contract. later some times. Step 2:- material master changes some important piece of

  • How to use Query Builder in JDeveloper?

    I am not able to use Query Builder with JDeveloper version 11g 2. The online documentation about Query Builder: http://docs.oracle.com/cd/E35521_01/user.111230/e17455/db_tools.htm#OJDUG2380 "To use Query Builder: Open the SQL Worksheet. Right-click a

  • Cannot keep an internet connection

    I did not have the problem with my last computer, but with this new Gateway I bought, I can keep an internet connection for about 5-10 minutes, then I will lose it for 3-6 minutes.  Other two computers in the house work fine when this one is out.  We

  • Why does iOS5 drains battery more than iOS4?

    Upgraded to iOS 5 a few weeks ago and iCloud about a week ago.  Something is draining my battery.  I charge it each and every night (goes on charger at 10pm or earlier).  At 5:30 I'm up and disconnect before leaving home around 7:15am.  Prior to iOS

  • Need Full Drivers for Audigy 2

    Hi. Before I installed the latest update for the Audigy 2 driver, I assumed that it would need me to uninstall my present driver. So I did, and later learned that the drivers on the Creative website are not full. I also lost my driver CD, so can anyb