1118: the target of the implicit mandatory command for values of static objects may be non-correlated type Number ., 1118 static
1. Error description
Multiple tags of this row:-1118: the target of the implicit mandatory command that belongs to the value of the static type Object may be non-correlated type Number. -Left
2. Error cause
/*** Refresh button function */protected function refresh_clickHandler (event: MouseEvent): void {var hx: Number = hsb. left; var hy: Number = hsb. y; // var dx: Number = dataGrid. contentMouseX; // var dy: Number = dataGrid. contentMouseY; // Alert. show ("hx:" + hx + "\ n" + "hy:" + hy + "\ n" + "dx: "+ dx +" \ n "+" dy: "+ dy); Alert. show ("hx:" + hx + "\ n" + "hy:" + hy );}
<s:HScrollBar id="hsb" width="100%" viewport="{dataGrid}"/>
Convert hx from numeric type to Object
3. Solution
/*** Refresh button function */protected function refresh_clickHandler (event: MouseEvent): void {var hx: Object = hsb. left; var hy: Number = hsb. y; // var dx: Number = dataGrid. contentMouseX; // var dy: Number = dataGrid. contentMouseY; // Alert. show ("hx:" + hx + "\ n" + "hy:" + hy + "\ n" + "dx: "+ dx +" \ n "+" dy: "+ dy); Alert. show ("hx:" + hx + "\ n" + "hy:" + hy );}
1118: the target of the implicit mandatory command for values of static objects can be non-related flash
You must know that the removeChild function accepts DisplayObject as the parameter type and is not a stage or MovieClip object. Therefore, you must make a conversion here, this.removeChild(DisplayObject(me.tar get ));
1118: the target of the implicit mandatory command that belongs to the value of flashdisplay: DisplayObject of the static type can be non-correlated.
In strict mode, the compiler checks whether the types of the assigned objects are consistent. If they are inconsistent, an error is returned. However, this behavior can be compiled successfully in non-rigorous mode.
In this assignment statement, the type of the object to be assigned on the left is MovieClip, and the object obtained by the getChildAt () method called by the assignment object is DisplayObject. The two are inconsistent, therefore, an error is reported in the rigorous mode.
So here, we only need to manually convert the object on the right to MovieClip for processing.
Var mc: MovieClip = menu. getChildAt (z) as MovieClip;
So there is no problem.