PDA

View Full Version : Click Event Error


bcedergren
07-25-2008, 03:10 PM
When I click on an swf I get this error. Error #1069: Property click not found on mx.controls.Button and there is no default value. I never got this before and today it just started happening, without the button changing. The function of the button still works, I just get the error.

senocular
07-25-2008, 03:12 PM
as the error indicates, it looks like you're trying to use the click property off a button instance. Look for where you see 'click' in your code and make sure it's used correctly. Usually the error will give you a hit to where this is occuring to if not explicitly give you the exact location)

bcedergren
07-25-2008, 03:21 PM
Here is my code, it looks like I am using it correctly.

click="clickHandler(event)"

[Bindable]
public var loadNumber:String;
private function clickHandler(event:MouseEvent):void
{
loadNumber = event.currentTarget.name;
var eventObj:RecommendEvent = new RecommendEvent(loadNumber, "recommendSelected");
dispatchEvent(eventObj);

parentApplication.currentState = 'ballistics';
}

senocular
07-25-2008, 03:52 PM
click="clickHandler(event)" seems misplaced. Where is that in context?

bcedergren
07-25-2008, 04:03 PM
<mx:SWFLoader id="boxOneButtonSWF" source="assets/swf/ballistics-button.swf" name="{select_recommendations.lastResult.Load[0].LoadNumber}" x="16" y="380" click="clickHandler(event)" buttonMode="true" visible="false"/>

senocular
07-25-2008, 04:23 PM
I don't see anything there; maybe the error is somewhere else in your code

bcedergren
07-25-2008, 04:29 PM
I found where the error was coming from.

In the Application I had this code:
<mx:SetProperty target="{resetButton}" name="visible" value="true"/>-->
<mx:SetProperty target="{resetButton}" name="click" value="resetAppBallistics()"/>

Apparently click is not a valid name property for the button.