salve.
vorrei creare uno sfondo con diversi livelli che si muovono con il movimento del mouse; posto il codice
frame 1
startDrag("drag", true);
frame 2
xposition = getProperty("menu", _x);
setProperty("menu", _x, xposition + getProperty("drag", _x) / 8 * -1);
yposition = getProperty("menu", _y);
setProperty("menu", _y, yposition + getProperty("drag", _y) / 8 * -1);
if (getProperty("menu", _x) < -640)
{
setProperty("menu", _x, "320");
} // end if
if (getProperty("menu", _x) > 320)
{
setProperty("menu", _x, -640);
} // end if
if (getProperty("menu", _y) < -640)
{
setProperty("menu", _y, "320");
} // end if
if (getProperty("menu", _y) > 320)
{
setProperty("menu", _y, -640);
} // end if
xposition = getProperty("front", _x);
setProperty("front", _x, xposition + getProperty("drag", _x) / 15 * -1);
yposition = getProperty("front", _y);
setProperty("front", _y, yposition + getProperty("drag", _y) / 15 * -1);
if (getProperty("front", _x) < -640)
{
setProperty("front", _x, "320");
} // end if
if (getProperty("front", _x) > 320)
{
setProperty("front", _x, -640);
} // end if
if (getProperty("front", _y) < -640)
{
setProperty("front", _y, "320");
} // end if
if (getProperty("front", _y) > 320)
{
setProperty("front", _y, -640);
} // end if
xposition = getProperty("mid", _x);
setProperty("mid", _x, xposition + getProperty("drag", _x) / 30 * -1);
yposition = getProperty("mid", _y);
setProperty("mid", _y, yposition + getProperty("drag", _y) / 30 * -1);
if (getProperty("mid", _x) < -320)
{
setProperty("mid", _x, "160");
} // end if
if (getProperty("mid", _x) > 160)
{
setProperty("mid", _x, -320);
} // end if
if (getProperty("mid", _y) < -320)
{
setProperty("mid", _y, "160");
} // end if
if (getProperty("mid", _y) > 160)
{
setProperty("mid", _y, -320);
} // end if
xposition = getProperty("back", _x);
setProperty("back", _x, xposition + getProperty("drag", _x) / 50 * -1);
yposition = getProperty("back", _y);
setProperty("back", _y, yposition + getProperty("drag", _y) / 50 * -1);
if (getProperty("back", _x) < -320)
{
setProperty("back", _x, "160");
} // end if
...e così via
frame 3
gotoAndPlay(_currentframe - 1);
Il risultato dovrebbe essere che i vari movie su livelli divesi si muovono con un'accellerazione diversa.
Ma non funge.
Cosa sbaglio? oppure qualcuno mi suggerisce un altro modo per raggiungere avere lo stesso effetto?
Grazie

Rispondi quotando