[WiiFlash] Argument Count Mismatch on WiFlash API

Merrill, Jason jason.merrill at bankofamerica.com
Wed Nov 14 10:53:49 PST 2007


>>Hm, I am not so sure where that is. In the documentation or 
>>on the google code page somewhere?
>>Well... You will have to import that class.

I did! that's why I'm confused  - that maybe the API has changed and I
have an old version, and can't get a new one because I cannot use SVN -
has to be the .zip.  

>>But I would suggest you reading an introduction about 
>>ActionScript 3 because those are very basic questions.

No see, I understand AS3 just fine, I just don't understand why the
error is that it cannot find the ButtonEvent class - even though I have
imported it from the WiiFlash API:

import org.wiiflash.*;

I have the ButtonEvent class imported.  Something I'm not seeing...

Jason Merrill
Bank of America  - GT&O L&LD
eTools/Multimedia Research & Development

 

>>-----Original Message-----
>>From: wiiflash-bounces at osflash.org 
>>[mailto:wiiflash-bounces at osflash.org] On Behalf Of joa e.
>>Sent: Wednesday, November 14, 2007 1:55 PM
>>To: wiiflash at osflash.org
>>Subject: Re: [WiiFlash] Argument Count Mismatch on WiFlash API
>>
>>Hm, I am not so sure where that is. In the documentation or 
>>on the google code page somewhere?
>>Well... You will have to import that class.
>>
>>But I would suggest you reading an introduction about 
>>ActionScript 3 because those are very basic questions.
>>
>>
>>Best,
>>
>>Joa
>>
>>
>>
>>Merrill, Jason schrieb:
>>>>> That is a simple one and .. phew ;) ... not releated to WiiFlash.
>>>>> If you attach a listener like wiimote.addEventListener the 
>>>>> listening function has to accept one parameter which is the 
>>>>> event being dispatched. So if you change your listener to:
>>>>>
>>>>> private function onWiimoteConnect(event: Event):void
>>>>>       
>>>
>>>
>>> Awesome, thanks. It works now.  Note that I took that 
>>example code from
>>> the WiiFlash help docs, so it would need to be updated if it is
>>> incorrect.  
>>>
>>> However, now I am getting this error:
>>>
>>> 	Access of undefined property ButtonEvent. 	WiiFlash2.mxml
>>> WiiFlash2 line 23	
>>>
>>> line 23 in my code is:
>>>
>>> 	_wiimote.addEventListener( ButtonEvent.A_RPRESS, onWiimoteAPress
>>> );
>>>
>>> Again, that is straight from the WiiFlash help docs.  Where does
>>> ButtonEvent come from?  I DO have the class imported from
>>> org.wiiflash.events.ButtonEvent  My entire Hello World script is:
>>>
>>> 			import mx.events.*		
>>> 			import org.wiiflash.*;
>>> 			private var _wiimote:Wiimote;
>>> 			
>>> 			private function loadWii():void
>>> 			{
>>> 				trace("loadWii run")
>>> 				_wiimote = new Wiimote();
>>> 	 			_wiimote.addEventListener(Event.CONNECT,
>>> onWiimoteConnect);
>>>
>>> 			}
>>> 			
>>> 			private function
>>> onWiimoteConnect(event:Event):void
>>> 			{
>>> 				trace("_wiimote.connected:
>>> "+_wiimote.connected)
>>> 				_wiimote.addEventListener(
>>> ButtonEvent.A_RPRESS, onWiimoteAPress );
>>> 			}
>>> 			
>>> 			private function onWiimoteAPress():void
>>> 			{
>>> 				trace("A pressed")
>>> 			}
>>>
>>> Any ideas?  I am wondering if my API is the wrong version...
>>>
>>> Jason Merrill
>>> Bank of America  - GT&O L&LD
>>> eTools/Multimedia Research & Development
>>>
>>>  
>>>
>>> _______________________________________________
>>> WiiFlash mailing list
>>> WiiFlash at osflash.org
>>> http://osflash.org/mailman/listinfo/wiiflash_osflash.org
>>>
>>> .
>>>
>>>   
>>
>>
>>_______________________________________________
>>WiiFlash mailing list
>>WiiFlash at osflash.org
>>http://osflash.org/mailman/listinfo/wiiflash_osflash.org
>>



More information about the WiiFlash mailing list