This is an implementation of the ken Burns effect into SSP component, the code is not strict at all and should be put on timeline, if you need a class version, let me know.
Take care this code is for FLASH8 and actionscript 2.
All comments are welcome
1) Tweening and bitmap classes
[as]
#include “lmc_tween.as”
import flash.display.BitmapData;
[/as]
2) Static variables initialisation
[as]
// taille de la photo d’origine
ORIGINSCALE = 100;
// redimensionnement maximum
DESTINATIONSCALE = 110;
// Durée totale du tweening
TWEENDURATION = my_ssp.imagePause + my_ssp.imageFade * 2;
// durée du fade
FADEDURATION = my_ssp.imagePause * 1000;
[/as]
3) Object and SSp events and listener
[as]
myListener = new Object ();
myListener.imageData = _imageData;
my_ssp.addEventListener (”imageData”, myListener);
[/as]
4) function called by ssp lisneter each time a new photo is loaded
[as]
function _imageData (eventObject)
{
if (my_ssp.displayMode == ‘Auto’)
{
kenBurnsEffect ();
}
}
[/as]
5) The Ken Burns function
[as]
function kenBurnsEffect ()
{
loader1 = _root.my_ssp.sspro_mc.cont_mc.loader1_mc;
loader2 = _root.my_ssp.sspro_mc.cont_mc.loader2_mc;
//
if (my_ssp.thisLoader == loader1)
{
bitmapize (loader1);
with (loader1)
{
_xscale = ORIGINSCALE;
_yscale = ORIGINSCALE;
tween (['_xscale', '_yscale'], [DESTINATIONSCALE, DESTINATIONSCALE], TWEENDURATION, ‘linear’);
}
}
else if (my_ssp.thisLoader == loader2)
{
bitmapize (loader2);
with (loader2)
{
_xscale = DESTINATIONSCALE;
_yscale = DESTINATIONSCALE;
tween (['_xscale', '_yscale'], [ORIGINSCALE, ORIGINSCALE], TWEENDURATION, ‘linear’);
}
}
}
[/as]
6) function to convert ach loaded photo into a bitmap object, it avoid pixilisation when tweening
[as]
function bitmapize (imgContainer)
{
myBitmap = new BitmapData (imgContainer._width, imgContainer._height, true, 0×00FFFFFF);
myBitmap.draw (imgContainer);
imgContainer.attachBitmap (myBitmap, 1, “auto”, true);
}
[/as]
et voilà
**Error** Scene=Scene 1, layer=A, frame=1:Line 54: The class or interface ‘flash.display.BitmapData’ could not be loaded.
myBitmap = new BitmapData (imgContainer._width, imgContainer._height, true, 0×00FFFFFF);
Total ActionScript Errors: 1 Reported Errors: 1
this code is for FLASH 8 and actionscript 2
Thanks for the script, pic of fridge on it’s way!, but something aint right as it’s not working for me.
I have:
Installed lmc_tween.as
Restarted Flash
Opened file
created new layer above SSP component and pasted code
test file
The file works as it was before but there is no effect showing. I obviously missed something … but what!
Hello Kingofpunk,
I would like to use this effect on my projects too but as I read your code… how do you implement it? Where does it go in the movie? Thank you in advance.
Congrats for your work, really cool (y).
Ricardo Zea
Miami, FL
I’ve got the same problem as digilee, don’t know what i’m doing wrong.
Can anyone help me?
Greetz,
Maarten Verhoef
Amsterdam (The Netherlands)
Hello digilee,
You have to name the instance of your SSP component to “my_ssp” or change the instance name in the actions to whatever you have named your instance to.
I did all things correctly, I don’t get any error messages or anything (works fine), but… no KB effect. do you know if there are others with same prob , or could you send a fla that works. I would really like to use the effect…. thank you, inadvance
nevermind me, I was using ver. 1.09, upgraded to 1.4 of SSP works fine, now I know, and thank you
is it possible to load the pictures from a xml file ?
Ramon.
Bonjour,
Je vois que vous parlez français donc je me permet d’utiliser cette langue.
Concretement, comment insérer le code décrit ci-dessus dans flash pour installer l’effet KenBurns dans SSP ?
par avance, merci
Alex
bonjour,
cela ne fonctionne toujours pas chez moi
Alex
This tip do not run at me. why, I don’t know !!!
why not integrate ken burns effect directly into SSP ?
You could also check http://www.monoslideshow.com , it has a built in Ken Burns effect.
Grtz, J.
serait il possible d’ajouter un fla d’exemple ? pour les newbies c’est pas évident on sais pas sur quel objet on doit mettre l’actionscript (en tout cas pour moi)
I am getting the same ActionScript error message as Billy (08.26.06) and am using F8 and AS 2.0. Any assistance would be much appreciated.
Hey KingofPunk,
Your effect is nuts. Didn’t realise you mess around that much with the component.
I wish I had just the smoothing effect, what are those guys at Macromedia doing.. smoothing should be super standard. I got a couple of projects at the moment with fullscreen hires image scaling and when they get down sized to fit lower screen resolutions the pixelation is insane.
Any chance of tweaking your code so it just smoothes? There millions out there wondering how it’s done with dynamic content..
Thanks man, any help appreciated.
PS: I don’t have a fridge at the moment cause I’m homeless living in my office.. There is a fridge however in the kitchen we share with a few other offices. It’s a real horror show if that’s what you’re after.
Richard.
Hi! Would you be so kind as to share with us how the image smoothing works? This Ken Burns Effect is really great but I (and many other guys) only need the image smothing. SSP also rocks, but the lack of smoothing is a littlebit annoying. Thanks in advance.
p.s.: I use the 1.6.9 version of SSP
Can somebody please provide a link to the required MovieclipTween120.mxp download? I would like to try and follow the steps above, but it appears I need the MovieclipTween120.mxp extension in order to get this to work.
There are a number of links online for RapidShare, but they have all expired. If someone has the extension, can you please upload it to RapidShare and then post a link here, or on the SSP forums, here:
http://forums.slideshowpro.net/viewtopic.php?pid=3401
Thanks! Fridge pix and or video (since SSP now works with video) are in order
does this still work with later versions of slideshow pro. I am using 1.82 and i followed ALL steps. No KB! Thanks for your help and your code. Would love to get it working.