PDA

View Full Version : Easy Flash Deeplinking with tweening



nortago
October 29th, 2007, 01:27 AM
Hi Guys, I've been using this forum for ages now, and I've been meaning to contribute something here, but aside from not having time I usually feel pretty lame compared to some of the geniuses on here! :P Anyway I've finally found something I thought people might find useful, as I know when I was trying to figure out how to impliment it in a client project I'd have loved to have found something like this... Anyhow, enough talking! It's basically just an easy way to incoorperate deeplinking into flash projects if you're using tweens to move your pages around, it's based on Ex Animo's statemanager and uses the Fuse tween engine to tween things...

Hope it helps anyone !

Liam

Try it out here (http://liamr.com/labs/deeplinking_tween/tween.html)
Download it here (http://liamr.com/labs/deeplinking_tween/deeplinking_tween.zip)

:pir:

UPDATED:

Now It uses SwfAddress 2 to power the deeplinking - I've not had a good look at the new features, but it's updated to what the old one could do.

Preview (http://www.liamr.com/labs/source/deeplinking_tween_swfaddress2)

Source (http://www.liamr.com/labs/source/deeplinking_tween_swfaddress2/deeplinking_tween_swfaddress2.zip)

mprzybylski
October 29th, 2007, 01:46 PM
You should include the class StateManager in your download.

Also, I have Fuse set in my classpaths but for those that dont maybe include it in your d/l as well so that they can just d/l your file and run it.

FlawlessDog
October 29th, 2007, 02:46 PM
don't suppose you got a version that is flash8, do you? ;)

Digitalosophy
October 29th, 2007, 03:48 PM
Very nice thanks for sharing :)

nortago
October 29th, 2007, 04:14 PM
Thanks for the feedback guys...

mprzybylski - I completely forgot! I had originally intended to... my bad - Consider it fixed!

FlawlessDog - Sorted :) I've included a flash 8 version in the new download.

Digitalosophy - It's quite alright! - I owe a lot of my flash knowledge to the people on this forum! The least I can do is to give back a little...

Just a note - I've also worked out how to impliment a dynamic version - i.e. it takes articles stored in a database (mysql) and imports them into a flash file via php / xml - but because it's all dynamic it means the page linking changes with what's in your database - A perfect flash news system if you will! I'm working on something a little smoother just now, but I aim to upload that too if anybodies interested ?

Liam

dail
October 29th, 2007, 06:15 PM
Very nice.

Defo interested in having a look at your mysql approach!

nortago
October 29th, 2007, 08:27 PM
Dail - Not a problem ! - I'll get something nice on the go before I post anything, plus I'll have to sort out all the mysql stuff too...
p.s. Love the artwork on noponies!

Liam

vega
November 3rd, 2007, 08:35 PM
Nice one! It will come really in handy on something I am working on right now.

Thanks a lot for sharing man. :)

Emkay
November 4th, 2007, 12:14 AM
i am tempted to make passionate love with you :)

FlawlessDog
November 5th, 2007, 01:02 PM
---
FlawlessDog - Sorted :) I've included a flash 8 version in the new download.
---

Liam

Opps...thought I had come back and thanked you for that.

errr...

Thanks :thumb:

This is really a subject I have an interested in, after the work I did with my own site, and the Carmex (http://www.carma-labs.com/) site.
I did a slightly customized version of the old Robert Penner (http://www.robertpenner.com/experiments/backbutton/backbutton.html) example, for these projects.
It works well enough aside from a few javascript errors in some browsers that have it turned on. Alas, it doesn't have the deep linking of your example, but it does register page Title in the History(an important point in my view)

vini
November 5th, 2007, 02:26 PM
Hey thanks for sharingC:-)

nortago
November 6th, 2007, 12:02 AM
i am tempted to make passionate love with you

:)

I'm really glad everyone is appreciating the files :) - I'll try and get the dynamic one up asap - Oh, and I've also just finished a version using SWFaddress as an alternative - I'll post that soon...

Love Liam ;)

pete_zahut
November 7th, 2007, 05:31 AM
I'm trying to alter the Stagemanager class to AS3, but I don't know how to initialize the Stagemanager to the EventDispatcher because it is removed in AS3.

private static var _eventDispatcherInitializer = EventDispatcher.initialize(StateManager);

Does anyone know how to do the initialize?
And how is this different in comparison to SWFAddress?


Great work nortago!!!

pete_zahut
November 7th, 2007, 06:30 AM
D*mn, Easy Flash Deeplink isn't that easy (for me).

As said before I'm trying to port this to AS3 but it keeps throwing errors...

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.exanimo.managers::StateManager$/::_setup()
at com.exanimo.managers::StateManager$cinit()
at global$init()

vega
November 7th, 2007, 11:36 PM
I am trying to get this effect in one minor project I am working on right now but for some reason I just can't get it to work. I feel like a total dummy asking this but can someone please explain to me how does this part of the code works:



content.tween("_y", -240, 3, "easeOutElastic");


The reason I am asking is that everything else is working perfectly, all the functions are being called and being passed correct values but the tween is just not happening. I am assuming the first parameter is the property being tweened, the second is the initial value and the third is the final value. The problem is that tween is not happening with the values I input, it happens in a wrong way when I use the default value of 3 as the end parameter and happens really weirdly at 1/100th speed when I give the actual initial value.

(My content movieclip is 1000+ px tall and I have the different content windows stacked up inside just like in the example attached here)

Can someone please help me understand what I am doing wrong.


Thanks a lot.

pete_zahut
November 8th, 2007, 04:18 AM
Did you do the import statement, as in the example?

import com.mosesSupposes.fuse.*;
ZigoEngine.simpleSetup( Shortcuts, PennerEasing, Fuse );

vega
November 8th, 2007, 02:14 PM
Yeah I did. Actually I managed to make it tween the right way finally but still not too sure what all those parameters mean. Now it seems like the second one is the number of seconds it takes for the tween and the first one is the position the target movieclip is aiming for.

Will still welcome any better explanation than my crude guesswork.

Thanks.

mprzybylski
November 8th, 2007, 05:55 PM
vega, thats a Zigo tween that is part of Fuse.

the first parameter is the property to tween, the second is what you want it to tween to, the third is the time in seconds that the tween should happen over, and the fourth is the easing function to use to do the tween.

hope that helps.

vega
November 9th, 2007, 07:41 PM
Ah! I should have gone through the as files included in the zip before posting.

Thanks :)

minthu
November 24th, 2007, 02:43 AM
I think it is better use Tween and easing classes from Flash for this one.

import mx.transitions.Tween;
import mx.transitions.easing.*;

I tested a simple movement.
Flash Tween 2KB
FuseKit 33KB

nortago
November 24th, 2007, 12:17 PM
I think it is better use Tween and easing classes from Flash for this one.

import mx.transitions.Tween;
import mx.transitions.easing.*;

I tested a simple movement.
Flash Tween 2KB
FuseKit 33KB

Hey Minthu, You're probably right for a small example like this, not point bumping up the filesize with something as big and powerful as the Fuse engine.
I just used it because It was taken from a large project I'd been working on at the time.

Anyway, I think it's time to update this script with the new SwfAddress 2...

prg9
November 24th, 2007, 01:18 PM
FlawlessDog - Sorted, I've included a flash 8 version in the new download.




UPDATED:

Now It uses SwfAddress 2 to power the deeplinking - I've not had a good look at the new features, but it's updated to what the old one could do.

nortago

Sounds like a good update! But as FlawlessDog mentioned previously and your sorted out before, it would be nice to have a Flash 8 version also for this update.

;)

PS:


I think it is better use Tween and easing classes from Flash for this one.

TweenLite + TweenFilterLite (http://www.kirupa.com/forum/showthread.php?t=277424) might be good replacements for both the built in tween class and the FuseKit for a small footprint with many features tween class.

nortago
November 24th, 2007, 02:34 PM
Totally forgot! - Sorry - I'll just update that now - and I'll also get that TweenLite bunged in there too!

My Bad!

Liam