Control a timeline using acelerometers like in some Edge Animate DPS sampler that was around for years


(thejoepeach) #1

Hi there, maybe someone already ask this, but i wonder if achieve something like this is possible:

http://download.macromedia.com/pub/developer/dps/parallax-effect-sample-files.zip
-Obviously it works only on mobile -

In a nutshell if user rotate the device, the timeline displace itself responding to the acelerometer data, that can create some amazing effects on mobile, and since its pretty old i might wonder if its possible on Hype…

Hope anyone can guide me on this…


(Jonathan Deutsch) #2

Yeah, this is no problem with Hype. The example you sent already has the javascript code to get accelerometer data, it only takes a few small adjustments to change it from Edge’s API to Hype’s API.

I setup the timeline the same way (though only did it for 3s instead of 30s), and then added an On Scene Load handler to run javascript to run code that handles the device orientation events. The two changes needed to be:

sym.stop();

becomes:

hypeDocument.pauseTimelineNamed('Main Timeline');

and

sym.stop(position);

becomes:

hypeDocument.goToTimeInTimelineNamed(time, 'Main Timeline');

But as you’ll see in the document I added a little bit of code to convert the number to a percentage of the timeline and feed that value in.

You can check it out here:

DeviceOrientationParallax.hype.zip (874.5 KB)


(thejoepeach) #3

#Awesome thanks #LordHype i am going to play plenty with this sampler… it was something i look for quite some time and now i will be able to make it on Hype…


(thejoepeach) #4

Now, the results on this:

http://freefallmotion.com/clientes/freefallmotion/the_test_app/

The particular scene that use the parallax fx is here:

http://freefallmotion.com/clientes/freefallmotion/the_test_app/parallax_graviter.html

Obviusly, better view on a iPhone 6x and later… thanks for the help…


(Jonathan Deutsch) #5

Fantastic!