开发者

flex: 1120 access to undefined property

I was trying to place some simple effects on an image using HBox using Hslider/Checkbox.

I am unable to incorporate the required effects on the image.I an getting the errors "120 access to undefined property" ....poiny开发者_JAVA百科ing to "HSlider/change".

What can be the error/solution to this?

<?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:HBox top="10" left="10">
       <mx:HSlider top="-10" left="100" value="-10" toolTip="Rotation" 
             change="myImg.rotation=event.currentTarget"    
                            liveDragging="true">
       </mx:HSlider>
      </mx:HBox>
      <mx:CheckBox label="Visible" change="myImg.visible=event.currentTarget.selected"          
          selected="true"/>
      <mx:Image name="myImg" source="file:///C|/Users/terry/Desktop/test/myImage.jpg" 
                       height="100" top="60" left="30" rotation="-10">
           <mx:filters>
             <mx:DropShadowFilter />
        </mx:filters>
        </mx:Image>
    </mx:Application>

further in the "Hslider/Change" attribute it should be

"myImg.rotation=event.currentTarget.valueOf()" or 
"myImg.rotation=event.currentTarget.value"

Thanks in advance?


Thanks for the code.

This might be a copy/paste issue, but the code snippet you sent has one major problem:

The Image name is myImg, whereas it's referred to as myimg throughout the snippet. Let us know if that's a copy typo, or an actual bug.


The name= for your Image should be id=. When you refer to the component within the rest of the application, you do so via its ID which wasn't set.

<mx:Image id="myImg" source...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜