You are not logged in.
Announcement
#1 08/07/09 8:01pm
- Bratchan
- Member
- Registered: 08/07/09
- Posts: 3
Help with Flash game
I'm new and I'm having a bit of trouble for trying to get the 'X' button to work for the psp for the character to throw a punch. I have tried the following code.
------------------
onClipEvent(mouseDown){
this.gotoAndPlay("punchL");
}
-------
and
--------------------
chara.onMouseDown = function()
{
punchL = true;
_root.chara.gotoAndPlay("punchL");
repeatTime = 0;
}
chara.onMouseUp = function()
{
punchL = false;
}
--------------------------
It works find on the PC in testing but when i put it on my PSP is won't work! Any help or suggestions would be great
--------
.fla file if you need it to browse through my code. All I'm trying to get done is for him to do his little punch on a PSP.
Offline
#2 09/07/09 12:12am
- g0ofygoober
- Hardcore Member
- Registered: 28/10/08
- Posts: 194
- Website
Re: Help with Flash game
use this code
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
mouseclicked = true;
};
mouseListener.onMouseUp = function() {
mouseclicked = false;
};
Mouse.addListener(mouseListener);
then you can just treat a mouse click like a normal key press but use the bool mouseclicked instead of key.isDown eg.
if (mouseclicked == true) {
//whatever happens when mouse is clicked
}
>>>> http://www.pspflashzone.com <<<<
Offline