[WiiFlash] Argument Count Mismatch on WiFlash API

joa e. j at je2050.de
Wed Nov 14 10:55:26 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.

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
>
> .
>
>   




More information about the WiiFlash mailing list