Welcome to Esato.com


Pages:
12  Next


K850i Accelerometer + Flash Lite 2.0


Click to view updated thread with images




Posted by LCARS-Expert
Every one who owns K850i noticed that wallpapers in Laster Precision and Crystal themes react depending on which side is the phone turned to.
I managed to extract those Flash files and obtain their ActionScript but, unfortunately, only partial.
It's missing how the animation gets accelometer data from the phone. If you test those animations on your computer you will notice they react on position of your cursor when it's above the animation. It interprets "that side up" for where the cursor is.
I guess will never answer what's the ActionScript for accessing the Accelometer.
If you have any ideas please post them!


Posted by zaxan
Could you possibley post the action script / swf / fla (depending on which of these you have) so I (and any others who are interested) can see what action script you have found so far and how this changes the view of the theme on the computer.

Cheers

Posted by LCARS-Expert
Of course!
Here is a RAR archive, it contains original flash wallpapers from theme files and directory where I converted them to FLA with Flash Decompiler.
Link
When publishing those FLA to SWF the result doesn't match the original SWF, as you will notice. That means the SWF wasn't converted back to FLA completely.

Posted by zaxan
Thanks for uploading those files, I've had a look at them. Some of the code in there is above my ability in action script and rather confusing although I do understand sections of the script which seem to read accelerometer data. I have found in the Precision_standby.swf.flp file there is accelerometer.as which contains the following code:


_root.onEnterFrame = function ()
{
if (classes.AccelerometerManager.mMode == "phone")
{
loadVariables("accelerometer://data", _root);
this.accX = Number(this.accX);
this.accY = Number(this.accY);
this.accZ = Number(this.accZ);
var __reg3 = undefined;


This code seems to be reading an accelerometer variable and setting X, Y and Z possitions although more of the code after this uses code I can't really understand, but the above section would be my best guess for reading the accelerometer data .



[ This Message was edited by: zaxan on 2007-12-09 12:03 ]

Posted by melk
Good thing that you started this thread, I never noticed that the standby flash animation moves according to the phone's position. It's so useless, but also very cool.

Good luck cracking the code.

Posted by Duran
so soon we're getting the "accelerometer-ball-game" just like nokia's?;p

Posted by gregface

On 2007-12-09 13:54:05, Duran wrote:
so soon we're getting the "accelerometer-ball-game" just like nokia's?;p


The w910i already has this.

Posted by zaxan

On 2007-12-09 14:11:35, gregface wrote:

On 2007-12-09 13:54:05, Duran wrote:
so soon we're getting the "accelerometer-ball-game" just like nokia's?;p


The w910i already has this.



Yeah, called Marble Madness afaik (I thought the K850 had this aswell?), although I think that game would use java to read the accelerometer data rather than flash actionscript, so either way the data from the accelerometer has to be accessible by external applications / files - just I'm not totally sure how yet lol

[ This Message was edited by: zaxan on 2007-12-09 13:21 ]

Posted by LCARS-Expert
@zaxan, I was looking at that too... It seems that accelerometer returns a non-numeric value:

if (classes.AccelerometerManager.mMode == "phone")
{
loadVariables("accelerometer://data", _root);
this.accX = Number(this.accX);
this.accY = Number(this.accY);
this.accZ = Number(this.accZ);
var __reg3 = undefined;


That script would say something like "If animation is loaded on the phone load variables from accelometer accX, accY and accZ." If you set the phone to write them you'll get "NaN" in each field which would be Not a Number. That means the each "Number(this.accX)" returns NaN. Since "Number(expression)" converts the parameter expression to a number and returns a value... It gives NaN only "If expression is NaN, the return value is NaN."
This is next:

if (!isNaN(this.accX) && !isNaN(this.accY) && !isNaN(this.accZ))
{
__reg3 = Math.round(Math.atan2(this.accZ, this.accX) * 10000) / 10000 + 3.14159;
this.Alpha = isNaN(__reg3) ? this.Alpha : __reg3;
__reg3 = Math.round(Math.atan2(this.accZ, this.accY) * 10000) / 10000 + 3.14159;
this.Beta = isNaN(__reg3) ? this.Beta : __reg3;
__reg3 = Math.round(Math.atan2(this.accX, this.accY) * 10000) / 10000;
this.Gamma = isNaN(__reg3) ? this.Gamma : __reg3;
var __reg5 = 0 - Math.cos(this.Alpha);
var __reg4 = Math.cos(this.Beta);
classes.Application.mAccManager.updateComponents(__reg5, __reg4);
}

return;
}

So, the script checks "isNaN" which returns true if the variable (accX, accY and accZ) is not a number. Which in this case is true. Now it gets difficult. I don't understand this second part completely but I get that it generates a numeric value, an angle in radians to be exact.
Math.atan2(this.accZ, this.accX) "Computes and returns the angle of the point y/x in radians, when measured counterclockwise from a circle's x axis (where 0,0 represents the center of the circle). The return value is between positive pi and negative pi." Now I got "oh shit, its trigonometry" in my head.

__reg3 = Math.round(Math.atan2(this.accZ, this.accX) * 10000) / 10000 + 3.14159;

Now... If I get this correctly, the angle is multiplied by 10000 and then converted to a round number. That number is divided back by 10000 and pi is added to it. I can't get it in my head how does __reg3 number look like after that. And what is this:
this.Alpha = isNaN(__reg3) ? this.Alpha : __reg3;

Posted by LCARS-Expert
WOOHHOOOH!!! Just got numbers out of it!

http://www.trekker-reactor.isq-networks-server.com/forum/acc-data.zip

Unpack this and put it on your phone! You'll see it reacts on the side you turn it to.

Posted by zaxan
DUUUDE!! Great to see you've worked it out Now I'll just have to wait till I've got a k850 (or hopefully k860 if it's released anytime soon) to check it myself.

Nice one

Posted by Pakzal

On 2007-12-09 18:36:53, LCARS-Expert wrote:
WOOHHOOOH!!! Just got numbers out of it!

http://www.trekker-reactor.isq-networks-server.com/forum/acc-data.zip

Unpack this and put it on your phone! You'll see it reacts on the side you turn it to.


You can also see this, by going into the service menu

Posted by LCARS-Expert

On 2007-12-09 18:55:30, Pakzal wrote:

On 2007-12-09 18:36:53, LCARS-Expert wrote:
WOOHHOOOH!!! Just got numbers out of it!

http://www.trekker-reactor.isq-networks-server.com/forum/acc-data.zip

Unpack this and put it on your phone! You'll see it reacts on the side you turn it to.



You can also see this, by going into the service menu


Of course you can but you can't use the service menu in Flash.
Check this out:
http://www.trekker-reactor.isq-networks-server.com/forum/gravity.rar
Put it on your phone (if its K850i) and try turning and shaking it

Posted by LCARS-Expert
Everyone who don't have K850i and want to know what is this about, I made a video for you:
http://www.youtube.com/watch?v=YG0WiGQ5THc

Posted by NightBlade
Cool! I didn't know K850's accelerometre worked so smooth! Like the iPhone's!
Man, that means that someone could make cool accelerometre apps for SE phones like on the iPhone.
Far out, man!! (lol, ignore that)

[ This Message was edited by: NightBlade on 2007-12-09 20:47 ]

Posted by Stud
Whoa ! I just downloaded that thing man. itīs awesome. It works perfectly on mine. The arrow follows the direction I tilt the cell phone coorectly. I canīt wait to show that to my friends. lol

Posted by goldenface
@LCARS-Expert

Ha ha, just downloaded it and it works like a charm. I'll have some fun with this tomorrow.



I'll be watching this thread.


Posted by melk
It would be nice to have a theme with that arrow as a background.

eSeth managed to make a flash theme (very simple animation), and on his forum there is a tutorial on how to include flash files as theme backgrounds.


http://eseth.net/k850/download/index2.htm

- The last theme on the page has a flash animation.


Maybe someone with imagination and theme + flash knowledge could make something good.

Posted by Mizzle
Great stuff! I was trying to create a simple ball Java application that made use of the gravity sensor.

Check out this thread @ developer forum I created (some dude posted lots of details)

http://developer.sonyericsson[....]d.jspa?threadID=42098&tstart=0

Enjoy and I hope you'll create something good!

Posted by Alfaro
what we really want is flash themes to change the boring menu icons... Laser Precision is already old

Posted by deepy
grr wish i'd learnt actionscript and flash..this woulda been so much fun oh well..i'm a good programmer so i may have a play around with it. or just edit some of my old java games to take input from the sensor. fun fun.

Posted by LCARS-Expert
Now I'm in progress of simplifying the script and including the Y and Z axis (the arrow only uses X). When thats done I'll make a tutorial here how to use accelerometer data in Flash

Posted by zaxan

On 2007-12-10 14:03:36, LCARS-Expert wrote:
Now I'm in progress of simplifying the script and including the Y and Z axis (the arrow only uses X). When thats done I'll make a tutorial here how to use accelerometer data in Flash


Yeah, a tutorial would be helpful sice I can't rally find how to make the accelermometer data actually control anything else in the flash file

Posted by LCARS-Expert
At this moment I'm trying to find out how too.
If you want to see raw Accelerometer data you need 2 frame movie with this script in the first frame:
loadVariables("accelerometer://data", _root);
And 3 Dynamic Text fields on the stage vith Vars: accX, accY, and accZ.
It seems that each of the acc numbers goes approximately from -990 to 990. It does reach ą1000 if you shake the phone.

Edit: Don't know if it was obvious to anyone but now I found out what these numbers are. They show gravitational acceleration in cm/sē. Accuracy of the accelerometer is ą18.

[ This Message was edited by: LCARS-Expert on 2007-12-10 18:24 ]

Posted by LCARS-Expert
Almost forgot about this. This thread continues on tutorials, already made the 1st one:
How to make auto-rotate function in Flash Lite 2.0 (K850i)
There are more to come!

Posted by spybrowser
Great work!!

Watched some of the youtube videos, its cool. Just I am thinking how about something like a compass using accelerometer. I dont know if thats really possible or not.




Posted by LCARS-Expert

On 2007-12-22 20:36:38, spybrowser wrote:
Great work!!

Watched some of the youtube videos, its cool. Just I am thinking how about something like a compass using accelerometer. I dont know if thats really possible or not.


Unfortunately it isn't because accelerometer uses gravity, not the Earth's polarity.

Posted by spybrowser
Yes you are right.

I think there was a Java application available for the k750i. You need to point towards the current direction of sun, and based on time .. not sure how .. it shows the directions.



Posted by LCARS-Expert
Ah, thats normal way of orientating. You can do that with your wrist watch if its not digital. I learned that in primary school, can't remember how it goes anymore.

Posted by Loso
don't know why but it doesn't work for me,

i just get the numbers on my screen.

Posted by gseth
Based on the codes provided in this thread, the first "Shake It Theme". This one is a modified version of my Karima Adebibe theme.

Shake the phone to change the wallpaper. (Really Cool). Thanks to LCARS for the source files for editing.

Download Theme: www.rapidshare.com/files/80532326/karimaadebibe.zip.html

For k850i, w910i and w580i Phones Only.




[ This Message was edited by: gseth on 2008-01-01 18:29 ]

Posted by LCARS-Expert
Inspired on Nokia N95 - Moving Ball I made K850i - Moving Ball.
Available here:
http://www.trekker-reactor.net/projects

Posted by NightBlade
@LCARS:
Excellent, mate! if I had an accelerometer in me phone, I'd download it on the double!

BTW. You should increase the acceleration rate of the ball.

Posted by LCARS-Expert
On that video I held the phone more horizontal so it goes quite slow. The ball doesn't accelerate because it has no virtual mass. It goes faster if phone is tilted more, just that.

Posted by buntoo
Thanx mate
looks nice

Posted by iva_se
1. Dovern
2. darrengf (2nd replacement blue phone, with 4gb sandisk card )
3. kotsianis7
4. indup
5. Lembo (Replacement, o2 UK blue)
6. Spudywoodz
7. h901
8. Eva-m00
9. Freeloader(Rostropol)
10. bams
11. martuk ( Blue with 4Gb M2 )
12. Plankgatan...Velvet Blue....im the greatest
13. Pitzon
14. p!xarus (Velvet Blue)
15. robmac
16. Clarkent
17. TomasL
18. maRiozlp
19. luwi
20. azeter
21. tai020381
22. SpartanX
23. sahran (velvet blue with 4 GB micro SDHC)
24. Coxy (Velvet Blue)
25. fullforce (velvet blue)
26. Ricky D
27. ryanChg (Velvet Blue)
28. sir-sonyericsson-man (Velvet Blue with an 8 GB Micro SD)
29. ScorpZ (Velvet Blue +2GB MicroSD)
30. Knuttt
31. Babis (Blue)
32. Gaieez
33. yyzxmn
34. Ridahz (Blue K850i & 4Gb)
35. dualist (blue K850i & 2Gb M2)
36. ssjowowo (Velvet Blue + 2GB microSD)
37. AntonioX (Blue & 2Gb M2)
38. toralux
39. cmikilp
40. Sebby (Velvet Blue)
41. zootzoot (Velvet Blue) 2gb micro sd
42. rambalu80 (Velvet Blue)
43. ROBI1212
44. petemwah (Velvet Blue + 512MB M2)
45. M C STORM ( (Velvet Blue + 512MB M2)
46. Laetitya (LUMINOUS GREEN YAY!)
47. BATTMAN78 (Velvet Blue + 512MB M2)
48. daviep
49. Sooteee (Luminous Green + 2Gb MSD)
50. Darkwun (Luminous Green + 4GB SDHC)
51. SE-Naz (Velvet Blue + 2GB Micro SD 2nd Replacement... Much Better)
52. Bcub (Blue)
53. tidusdu87 (Velvet Blue + 512 Mē, 2gb Mē or mSD soon)
54. xironghostx (velvet blue and 4gb m2)
55. AntonisCy (Velvet Blue + 512 Mē)
56. >500 (luminous green, waiting to buy 4 or 8gb m2)
57. Scitza (velvet blue + 512 m2 - top phone)
58. Spikeyjac (Velvet blue + 512 m2,gettin the phone on tuesday )
59. mrwoll (Velvet Blue + 1gb Mē)
60. jockspice (VB and 2gig M2) on o2
61. CruSifiXken (Velvet Blue, 6 GB MicroSD)
62. Ivo NL (Velvet Blue, 2GB M2)
63. lexcute (Velvet Blue, 512M2, will buy 2GB SD/M2)
64. Exodemia (Velvet Blue, 512MB M2)
65. Marc_SE (Velvet Blue, 4GB M2)
67. k850 successor (Luminous green, 2GB micro SD)
68. masterv (Luminous Green, 512MB M2 + 1GB M2)
69. sasuke8 (Velvet Blue - ordered online - cming soon)
70. thegreatone(velvet blue+4gb M2)
71. Rifqi_Aziz (Luminous Green, 512MB M2, 1GB M2, 1GB MicroSD)
72. LCARS-Expert (Velvet Blue unbranded, 512MB M2)
73. Bhavv (Velvet blue, T-mobile, 512MB M2)
74. DJKarlos2006 (Velvet blue, O2, 512MB M2)
75. Impy78 (Velvet Blue, O2 Handset on T-mobile - bless you dad!- 1gb micro sd)
76. gazza73(velvet blue 1gb vodafone)
77.sandy4464(Luminous Green on T-Mobile, 512MB M2+1GB M2+6GB SDHC)
78.marinedisco(velvet blue 1gb Thai version unbranded)
79. Bryan84 (Velvet Blue, 2GB M2, Singapore)
80. TZWXSL(Velvet Blue, 512MB M2, Sg)
81. forka2k (Velvet Blue, 1 Gb M2, BG)
82. ICE (Luminous Green, 512MB M2+2GB M2+6GB SDHC
83. Ronaldeano (blue + 2gb m2 card)
84. GSeth (Velvet Blue + 4GB M2 Micro)
85 larry 68 (Velvet Blue, 512MB,M2)
86. thecoolsha (Velvet Blue, 6 GB microSD SDHC)
87. JiSm (Velvet Blue - Orange, 4GB M2, MBW-100 watch)
88. w999ismine(velvet blue o2) u have no idea how much i love this phone
89. kenmart(velvet blue)Sweden
90. wapchimp (blue-orange uk)
91. Downloader69 (Blue - not my prefered colour, but Voda don't do luminous green.. they're ar*eholes)
92. Loso (velvet blue +1gb M2)
93. A L 3 X [Unlocked, Unbranded/CPW Vanilla FW](Luminous Green + 1x 1GB m2, 1x 1GB MicroSD, and about 5 smaller M2's, HPM-70....Had to trail around a few shops to get this colour )
94. samok (Luminous Green + 2x512MB M2 + MBW-150 Executive)
95. coxon (velvet blue vodafone, 512mb)
96. Alfaro (luminous green) (not with the phone... but already ordered =) )
97. scottt (velvet blue + 2gb micro sd, should be here anyday )
98. mweb6161 blue one on orange arrives wednesday (lagging behind Scott as always)
99. glorfingal (Velvet Blue, HBH-G45, 1 x 1GB, 2 x 512MB, Orange UK)
100. marc_ashton (velvet Blue ) O2
101. TURBOY (VB)
102. croatia (luminous green) unbranded sim free plus microsd 2gb
103. linliz velvet blue(1GB)unbranded,lockfree
104. Avinash (luminous green, 512mb), unbranded
105. DJ Teknosys (Luminous Green, 4gb M2, unlocked/unbranded)
106.Holdit (Velvet Blue) Voda branded but unlocked...I'm not even using it. Waiting for new firmware
107. ~DC:UK~ (O2 037 generic firmware)
108. borg_ (Velvet Blue+4GB M2 Sandisk+Black HPM-70/Unbranded, Lockfree )
109. sudhakarvytla (Velvet Blue) unbranded, lockfree 2Gb Micro Sd
110. Insy (Velvet Blue) O2 + 1Gb M2
111. Krubach (Blue)
112.Vijeesh kumar.V (blue)
113. Shahrukh Ruhail aka $herry, Luminous Green *YAY* 2gb m2 micro...
114. Kirsty (Velvet Blue) O2 + 1Gb M2
115. Rich (englishman in Wales......) On Orange, in green, but it got problems, lil niggles I don't like, like.
116. Mulder7 (Velvet Blue) On O2, 1gb memory stick, no problems so far just annoying dirt/grease.
117. Stud ( Luminous Green )
118. Dragon546 (Velvet Blue)
119.Sobo(Velvet Blue)
120. Terminatorak (2nd O2 Velevet Blue)
121. tonymarcus
122. Manuel_max ( Luminous Green )
123. Mgoggles ( Luminous Green ) -PhonesourceUSA - Tmobile USA
124. blitz89 (Velvet Blue)
125. se_dude(Velvet blue unbranded)
126. n4d3r (Luminous Green) -
127. Shazee (Velvet Blue, 4GB M2 )
128. Deifie (Velvet Blue)
129. jantxa (Velvet Blue, 4Gb M2, Black HPM-70, Black MPS-60)
130. victorinch (Velvet Blue - unbranded, 4GB M2)
131. Duran (Velvet Blue, unbranded, 4GB MicroSD)
132. Fireo (Luminous Green) Unlocked, 2GB M2
133. gpanda (Luminous Green, 2GB M2, HPM-82, HBH-DS970)
134. chamcg(Velvet Blue-512mb M2)
135. lsuperyellow( blue, 2G m2)
134. franique (Luminous Green, 1GB M2)
136.milanpcx (Velvet Blue,1GB M2 Sony)
137. iwantin (Lum Green, 2GB Sandisk M2)
138. iva_se (Lum Green, 512mb M2)
139. aremaboy--INDONESIA---with 2GB SanDisk M2
140. curmurdar (Velvet Blue, 512MB M2)
141. kenoby (Velvet Blue, 4Gb SanDisk M2)
142. greg677 (Velvet Blue, 8GB M2)
143. peacemf (Velvet Blue, 2GB M2)
144. heara
145. George78 (Lum Green, 1GB M2)
146.M.Sivaram (Velvet Blue , 1 GB M2) INDIA
147. Vegetaleb (Velvet Blue, 1GB MicroSD + 512 M2)































































We need new accelerometer swf file


Please!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

[ This Message was edited by: iva_se on 2008-01-12 21:23 ]

Posted by LCARS-Expert
What kind of file? Raw acc data reading?

Posted by iva_se
http://www.a site.com/images/news/08/01/pypiwo00.jpg

This acc data are only n95 and this ony iPhone http://www.hottrix.com/software/

create swf file please...........

[ This Message was edited by: iva_se on 2008-01-12 22:19 ]

[ This Message was edited by: iva_se on 2008-01-12 22:21 ]

[ This Message was edited by: iva_se on 2008-01-12 22:22 ]

[ This Message was edited by: iva_se on 2008-01-12 22:23 ]

Posted by LCARS-Expert
Iva se, I really don't understand what you're saying. Nothing here is for Nokia N95 or iPhone.

Posted by Myuueren
@LCARS-Expert

So using these can we use k850i like a wiimote?

I mean controlling some interfaces with k850i.
For example computer's mouse.

Posted by Yanosh94
in french forum we have made a few creation
http://www.forummobiles.com/i[....]?showtopic=155914&st=0&start=0
http://yanosh94.4shared.com/

Thanks a lot LCARS
_________________
Hello everybody and sorry for my mistakes in english it's because in am just a little french student

[ This Message was edited by: Yanosh94 on 2008-01-13 11:14 ]

Posted by LCARS-Expert

On 2008-01-13 11:47:01, Myuueren wrote:
@LCARS-Expert

So using these can we use k850i like a wiimote?

I mean controlling some interfaces with k850i.
For example computer's mouse.


Nope, this flash animation only loads Accelerometer variables. Remote cotrol and all other output-type applications are reserved to Java.

@Yanosh94, great work. It seems that the shake-control wallpaper attracts a lot of attention. To me it doesn't seem so special.
I'll try to develop more shake-control wallpapers now when I seen how popular it is.

Posted by DCUK7
@ LCARS

I think the main reason people like the shake control wallpaper is down to the initial wow factor response you get from people.

I modified your shake control one earlier so I could have pictures of Lucy Pinder rotating as I shake and I showed a friend over our Xbox LIVE camera chat and was loving it!

I wonder, could you make one that has the shake control and the auto-rotate? I think that would make a pretty good looking wallpaper. The ability to shake the phone to change the paper and also rotating the image when the phone is on its side.

Posted by nocky
there are some cool iphone .swf files on the link iva se left http://www.hottrix.com/software/ that look like they work off accelerometer do you think these would work on k850i? i like the beer one thats cool, take a look at the link

Posted by funkadopest
@nocky
those iphone files are videos not swf
you can find them here http://www.torrentreactor.net[....]pagne.for.Apple.iPhone%2FTouch

Posted by naveensiva
ok can i put in flash games which i get ovedr he net .. say from flash games sites...

will it work or should i have to convert it to our resolution..??

help me ..

i even saw some games for my friendds nokia phone .. can we play them???

Posted by LCARS-Expert

On 2008-01-15 05:22:54, naveensiva wrote:
ok can i put in flash games which i get ovedr he net .. say from flash games sites...

will it work or should i have to convert it to our resolution..??

help me ..

i even saw some games for my friendds nokia phone .. can we play them???


K850i supports Flash Lite up to version 2.0. Games from flash-game sites can't be converted to work on the phone. There have to be games specially designed to work on it. Flash games from Nokia should work but when Nokia transfers falsh file via Bluetooth it packs it into a .nfl file (It's actually a ZIP file with renamed extension) which you should unpack with WinRAR, the SWF is inside.

Posted by iva_se
UP!!!

Posted by naveensiva
LCARS...

Ok is there a site to know what is new in flash game world for mobile..?


Another question...
Can anyone create a water like flash wallpaper..with accelometer function so that the way we move makes the ripple hit the outer edge of out screen and goes back..it will be fun...
Guys expecting more like these.
If i would have known about flash..i would have created something.

Suggest me some flash K850 compatible games.

Posted by iva_se
UP!!!


Pages:
12  Next
Click to view updated thread with images


© Esato.com - From the Esato mobile phone discussion forum