Avatar billede clouise Nybegynder
22. juli 2004 - 19:38 Der er 5 kommentarer og
1 løsning

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);
};
Avatar billede mat Nybegynder
22. juli 2004 - 19:55 #1
2) Prøv med

/*
||== 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'
this.createEmptyMovieClip("script_clip", 0);
this.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
this.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.
    graphic1._alpha = (mosx / 4) - (mosy / 4);
    //Used to control the _alpha setting of 'graphic2' with dependency of the mouse position and inertia.
    graphic2._alpha = 100 - (mosx / 4) - (mosy / 4);
    //Used to control the _alpha setting of 'graphic3' with dependency of the mouse position and inertia.
    graphic3._alpha = (mosy / 4) - 100 + (mosx / 4);
    //Used to control the _alpha setting of 'graphic4' with dependency of the mouse position and inertia.
    graphic4._alpha = (mosy / 4) - (mosx / 4);
};


1) Mener du bare en gradient med flere farver?
Avatar billede clouise Nybegynder
22. juli 2004 - 19:55 #2
ja en gradien med to farver...
Avatar billede clouise Nybegynder
22. juli 2004 - 19:57 #3
så virker scriptet :)
Avatar billede mat Nybegynder
22. juli 2004 - 20:06 #4
Vælg window > color mixer (flash MX) og vælg en gradient ved spanden, så kommer der to små firkanter i hver ende af gradienten du kan ændre farve på (eller rykke). Så skal man vist vælge "add swatch" når man er færdig (den er vist i den lille foldeud menu i øverste højre hjørne af color mixer panelet).
Avatar billede clouise Nybegynder
22. juli 2004 - 20:06 #5
hvis du vil have points må du lige oprette et svar ;-)
Avatar billede mat Nybegynder
22. juli 2004 - 20:06 #6
svar dér :)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester