Skip to main content
Inspiring
April 9, 2007
Question

how to setup a Desaturation Tween

  • April 9, 2007
  • 48 replies
  • 4046 views
Hi just a quick question, i have a function to swap depths and tween the _alpha property of some movie clips, ---=> Thanx kglad <=--- but i was wondering if theres a way to change the color property without filters??
im especially interested in the Saturation / De-Saturation for this idea i have.

or do i need to use import flash.filters to do this?

if this is the only way, i dont think it will be worth it, unless creating a function for it is simple.

Thanx in advance.
This topic has been closed for replies.

48 replies

kglad
Community Expert
Community Expert
April 12, 2007
no, i don't remember. but i can tell you the most common reason for transition failures when loading pics: transitions should NOT start until loading is complete. ie, you'll need preloader code or the onLoadInit() method of the moviecliploader class listener.
SketchstaAuthor
Inspiring
April 12, 2007
ohh yeah i didnt mean there was something in your code that was making the pics pixelated.
I was referring to your code in the sense that it resizes the movieClip where i add pictures, and that ( the scaling ) is making them pixelated.
Which is why i said i might just pre-set the width and height of the attached clips, and make thumbs the same size.

and yeah, for positioning and sizing, thats what i mean when i said its like playing Mix 'n' Match. I keep changing variables everywhere until i got it right =P

i think im almost ready to try and import some pics with XML.
i'll upload it for you to see if you want when im done.

I'm looking for a Topic that was on here a while ago, about setting transitions for dynamically loaded pics.. I dont supose you remember seeing it? =)
kglad
Community Expert
Community Expert
April 12, 2007
that's not a problem with the code. that's the way it is with all bitmap graphics. as you scale them up, they look pixelated.

the solution is to start with an image that looks good at its largest displayed size. then when it's downsized, it will still look good.

using this._lockroot=true, applies to _root references but not to anything else.

for positioning, sizing and angling the basic carousel just use the centreX, centreY, radiusX and radiusY variables.
SketchstaAuthor
Inspiring
April 12, 2007
see how your code resizes each clip thats attached? this makes any image i put in there look really pixelated.

is there any way to make the pic look nice and sharp while it's scaled down like that?

If not, i may have to give up the freedom of being able to resize each movieClip, and have pre-set width and height.. just for this project tho.

it's having afew issues because the swf im having this code in, is smaller than the main swf that loads it.. so the math equations are abit off.
i've used _lockroot, but i dont think that applies to math??

The only thing thats keeping me alive is being able to easily change values of certain variables... ( I love this Ultra big function =P )

Right now, it's like playing " mix 'n' Match " cuz i still dont know enough to alter the code...only change variables =)
SketchstaAuthor
Inspiring
April 12, 2007
yeah the array will make it abit tougher, but after the last code i re-typed i think i should be able to re-type this one too.

believe it or not, i make it a point NOT to copy n paste any code i write, because the more i type code, the more practice i get and it eventually sticks to me. =)
so i dont mind the extra typing.


so far with this "Wonder of AS " i have been messing around with the variables, and read through it trying to keep up, not too much luck there tho.. but i did figure out to draw a rectangle on stage to accompany the last few lines of code.

yes your comments hinted as much...but me being the newbie that i seem to be, i just thought you were reffering to the actual stage. =P

Im done playing round with it, now im gonna make a copy and start re-typing it, maybe then i can work my way up to even include thumbs through a XML file.

one question though... can i say something like..

the biggest _scale object, move to highest depth?

is it possible to have something like..

this.swapDepths(_yscale+100);

the way im thinking there is, which ever of the attachedMovies are the tallest will be at that depth plus 100, just to make sure. =)

maybe im way off on that one... but atleast im trying rite? =)
kglad
Community Expert
Community Expert
April 12, 2007
just after the assignment of d in the spinF() function you can add:

kglad
Community Expert
Community Expert
April 12, 2007
and i used array notation again to save typing so that's going to make it tougher for you to understand. it's just so much more convenient that typing everything out on its own line.

in the initialization parameters you can customize all those numbers. what they do is clear from the variable names. maxA and minA are explained with the commented lines above them and contain the max and min values for those three properties listed in the propertiesA.
SketchstaAuthor
Inspiring
April 12, 2007
HOLY CRAP.... How did you do that???

sooo much maths in there... im scared just reading it. =P

You're God's Gift to Actionscript......Honestly dude...is there anything you dont know how to do??

I feel like i should pay you for all this code you give me..

I've read abit about attatchMovie, and adding a incremented number to the instance name, so i know that part of your code..

but the rest......

s#it...i gotta finish up these 3 pages, and get to studying hardcore on this 3D wonder of actionscript....

ohh man you shouldnt have shown me this.... im desperate to learn this now... =P
SketchstaAuthor
Inspiring
April 12, 2007
hmm, well i dont really understand the prototype() just yet, nor arrays. So i have quite abit of learning to do. =)
i hope you have the patience to put up with me every now and then, until i learn =P

anyway, the color functions you gave me have to wait abit, i just got a call from my boss, he said the clients for a site i did want 3 pages changed, AND they want a Pic Gallery added...and to make things worse, they wat the gallery to be like a Carousell view with the thumbs...... *shakes head*

this should be fun... and i have to get this ready by tomorrow evening. =(
French people are verry demanding... grrrr !!!

but after this, i'll get back to you about this prototype() business...I think if i learn this, it will be a really big leap in the sense of getting things to animate like i want...no matter how weird the idea may be. =P
kglad
Community Expert
Community Expert
April 12, 2007
here's code for a carousel. give a movieclip a linkage id of obj:

kglad
Community Expert
Community Expert
April 12, 2007
no, when prototype is used it's adding a new method to some class. in this case it's adding the colorFadeF() property to all movieclips.

movieclips come standard with a nice selection of predefined methods (and properties). but those methods and properties can be expanded to suite user's needs.

using the prototype is the old-school way of adding methods. using class definitions is the new-school way. but that's much harder to communicate to someone and have them get it working properly and much harder for them to understand. so, i still use prototypes to help people on this forum.

recently i've tried passing some class extensions but i don't think anyone's been able to implement them correctly so i don't think i've helped anyone with those.
SketchstaAuthor
Inspiring
April 12, 2007
ohhhhh... yeah now it works. =)

did you put it that way just to test me??? see just how dumb i am?? =P

prototype??
does that mean that you are creating a function that Flash doesnt know, but if it follows the code you specify, you get the result you are hoping for??

maaan.... you know Flash better than Flash knows it's self... I bet all the people who Developed Flash and Actionscript would come to you for guidence.

I need to pick up my game if i ever hope to know even a fraction of what you know..