farveforløb og _root
1.Er det nogen der ved om det kan lade sig gøre at lave et farveforløb med bestemte farver i flash, ligesom det kan lade sig gøre i photoshop?2.Jeg har brugt denne kode til at lave en animation i en seperat swf-film. Når jeg så loader denne film ind i min main side, så virker animationen pludselig ikke mere. Det har selvfølgelige noget med _root funktionen at gøre, men kan ikke lige gennemskue hvad jeg skal ændre?
/*
||== Title: Alpha Graphic Fade ==||
||== Author: dan4885 (Dan Alu) ==||
||== Site: www.macromotive.com ==||
||== Date: 8/12/02 ==============||
*/
//Creates a new movie clip on the '_root'
//timeline which is named 'script_clip'
_root.createEmptyMovieClip("script_clip", 0);
_root.script_clip.onLoad = function() {
//Makes variable to store inertia.
mosx = 0;
//Makes variable to store inertia.
mosy = 0;
};
//Starts a movie clip loop that executes
//the code everytime the play head enters
//a frame and this only works in Flash MX
_root.script_clip.onEnterFrame = function() {
//Takes 'mosx' and subtracts by the _xmouse mouse position to yield the difference.
difx = mosx - _root._xmouse;
//Takes 'mosy' and subtracts by the _ymouse mouse position to yield the difference.
dify = mosy - _root._ymouse;
//Subtracts the total of the _xmouse position and 'mosx' and 8 determines the speed of the effect.
mosx -= difx / 8;
//Subtracts the total of the _ymouse position and 'mosy' and 8 determines the speed of the effect.
mosy -= dify / 8;
//Used to control the _alpha setting of 'graphic1' with dependency of the mouse position and inertia.
_root.graphic1._alpha = (mosx / 4) - (mosy / 4);
//Used to control the _alpha setting of 'graphic2' with dependency of the mouse position and inertia.
_root.graphic2._alpha = 100 - (mosx / 4) - (mosy / 4);
//Used to control the _alpha setting of 'graphic3' with dependency of the mouse position and inertia.
_root.graphic3._alpha = (mosy / 4) - 100 + (mosx / 4);
//Used to control the _alpha setting of 'graphic4' with dependency of the mouse position and inertia.
_root.graphic4._alpha = (mosy / 4) - (mosx / 4);
};
