Creating ClassPath
hi
i designed space invader game can played keyboard.
now want able play same game using d-pad of wiimote. understand need import classes of wiiflash achieve aim.
i have downloaded wiiflash api , saved on same folder .as classes , .fla class. (but copied thee org.wiiflash.* folders). have written codes connect wiimote. tried run as3 not assess classes
org.wiiflash.wiimote;
org.wiiflash.events.*;
though i've imported them.
i have created class path (edit-preferences actionscript- actionscript 3.0- selected folder classes reside - save)
i dont know do. here code have :
package
{
import flash.events.*;
import org.wiiflash.wiimote;
import org.wiiflash.events.*;
public class spacegame extends movieclip
{
public var wiimote:wiimote;
private function initializegame()
{
createwiimoteconnection();
}
public function createwiimoteconnection()
{
wiimote = new wiimote();
wiimote.addeventlistener(event.connect, onwiimoteconnect);
wiimote.connect();
}
}
}
and here error messegae got
n:\chigbo\spacegame\spg2playerdpad_1.4\spacegame.as, line 241 1061: call possibly undefined method connect through reference static type org.wiiflash:wiimote.
it's telling it's possibly static type, not can't find it.
change "c" in connect lowercase.
wiimote.connect();
from page:
http://code.google.com/p/wiiflash/
you can see it's lowercase (case sensitivity matters).
More discussions in ActionScript 3
adobe
Comments
Post a Comment