Search the web
Sign In
New User? Sign Up
FlashLite · FlashLiteDev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
"Adobe Device Central CS4 has stopped working" issue   Message List  
Reply | Forward Message #8397 of 8452 |
Re: [FlashLite] Really inaccurate accelerometer data.. any ideas

Running the code without the game portion removes the speed problem?  If so, what is the game doing that slows it down?  Have any code you post?

On Mon, Jul 13, 2009 at 11:22 PM, Dan Milward <dan@...> wrote:


Hi Guys,

The following email from my work mate Vlad needs your help. He still
can't send to the yahoo group. Seemingly because he still hasn't been
approved. Please help us!!

Best,
Dan

---------

Hi there,
I am currently working on a mobile game for the 5800 nokia music
express, its a platform game and I'm trying to in corporate the use of
the accelerometer for the use of movement (eg tilt left to move left and
tilt right to move right)

But I keep getting really massive delays and lots of noise during tests
on the phone.

I have read the wiki pages on flash lite and accelerometer and have
followed there advice but even downloading the chart.swf file and
testing on the phone (the source code with no changes) generates delays.

Here is the source code I'm usng, it is the most reliable one I have
been able to find:

Source Code:

import com.nokia.lib.Service;

var sensors = new Service("Service.Sensor", "ISensor");

// Define input parameters for picking Rotation sensor
var inParam = {SearchCriterion:"Rotation"};

// Define result value
var outParams = sensors.FindSensorChannel(inParam);

// Define channel info (rotation)
var channelInfo = outParams.ReturnValue;

// Define valid values for channel info
var channelId = channelInfo[0].ChannelId;
var contextType = channelInfo[0].ContextType;
var quantity = channelInfo[0].Quantity;
var channelType = channelInfo[0].ChannelType;
var location = channelInfo[0].Location;
var vendorId = channelInfo[0].VendorId;
var dataItemSize = channelInfo[0].DataItemSize;
var channelDataTypeId = channelInfo[0].ChannelDataTypeId;
var channelInfo = {
ChannelId:channelId, ContextType:contextType, Quantity:quantity,
ChannelType:channelType, Location:location, VendorId:vendorId,
DataItemSize:dataItemSize, ChannelDataTypeId:channelDataTypeId
};

// Define input parameters for listening rotation channel data
var inParams = {ListeningType:"ChannelData", ChannelInfoMap:channelInfo};

// The RegisterForNotification method registers the user to receive data
from
// one sensor channel asynchronously
sensors.RegisterForNotification(inParams, callBack);

// Because this is an asynchronous method, you need to define the
callback function
// Callback function includes all the channel data
function callBack(transactionID:String, eventID:String, outParam:Object) {

var channelData = outParam.ReturnValue;
var xRot = channelData.XRotation;
var yRot = channelData.YRotation;
var zRot = channelData.ZRotation;
//text_txt.text = "x: "+xRot+"ry: "+yRot+"rz: "+zRot;

if(xRot < 90)
{
left_down = false;
right_down = true;
}
else if(xRot > 105)
{
left_down = true;
right_down = false;

}

else if (xRot == -1 || xRot == 90)
{
right_down = false;
left_down = false;
}
else
{
right_down = false;
left_down = false;
}

};

does any one know how to make the movement more stable, as at the moment
it is almost impossible to make the character stand still and perhaps
increase the response time to real time.

I'm running this at 20fps (reaching 100fps for this game would be
impossible) but running this code without the game and just printing the
x, y and z values to a text box seems to give very quick response time.

Any help or advice would be really appreciated,

Thanks to all in advance

Vlad




Tue Jul 14, 2009 3:28 am

jesse.warden@...
Send Email Send Email

Forward
Message #8397 of 8452 |
Expand Messages Author Sort by Date

1. Have you experienced this bug? "Adobe Device Central CS4 has stopped working" error: http://www.flickr.com/photos/scottjanousek/3615315457/ I posted about...
Scott Janousek
scottjanousek
Offline Send Email
Jul 9, 2009
2:25 pm

Yep, I can confirm that I have had this bug probably around 6-7 times now, and have either had to un-install/re-install Device Central or the stated ...
Dale Rankine
dale.rankine
Offline Send Email
Jul 9, 2009
8:55 pm

I have had the same issue. I have CS4 Master Collection and the Technical Suite. I am on Windows Vista with the latest updates. It's confusing which program is...
bobby_world
Offline Send Email
Jul 10, 2009
5:13 pm

Hi Guys, The following email from my work mate Vlad needs your help. He still can't send to the yahoo group. Seemingly because he still hasn't been approved....
Dan Milward
d_milward
Offline Send Email
Jul 14, 2009
3:22 am

Running the code without the game portion removes the speed problem? If so, what is the game doing that slows it down? Have any code you post?...
Jesse Warden
jesse.warden@...
Send Email
Jul 14, 2009
3:29 am

Up to a point yes. It does work better but even then the accelerometer code still jams up - i.e. you'll be tilting and there will be no change in the numbers. ...
Dan Milward
d_milward
Offline Send Email
Jul 14, 2009
3:34 am

1. Are you using v1 or v2? S60 Platform Services v2 hasn't been pushed to devices yet, but I it's available on FN for download: ...
Scott Janousek
scottjanousek
Offline Send Email
Jul 14, 2009
4:01 am

nevermind, it's js only, I think. Much too late to be posting help. :)...
Scott Janousek
scottjanousek
Offline Send Email
Jul 14, 2009
4:10 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help