soundcraft
%Europe/Berlin %670 %2007, 17:04
Ik heb een stukje actionscript in een mc geplaatst maar nu werkt ie niet meer , als ik ik hem gewoon op een layer in me mainmovie zet wel:
Moet ik wat veranderen in m'n actionscript? ik hoorde iets van ergens .root voorzetten maar waar???
Dit is de code waar het om gaat:
function fillPicsArray(ok)
{
if (ok)
{
var _loc2 = 0;
do
{
pics.push(this["f" + _loc2]);
} while (this["f" + ++_loc2] != undefined)
loadPic();
}
else
{
trace ("problem with the script");
} // end else if
} // End of the function
function onLoadInit(pic)
{
pic._width = 150;
pic._height = 100;
pic._x = 151 + 166 * ipic;
pic._y = 316;
pic._alpha = 100;
pic.filters = [picShadow];
if (++ipic < pics.length)
{
loadPic();
} // end if
} // End of the function
function loadPic()
{
holder.createEmptyMovieClip("p" + ipic, ipic);
holder["p" + ipic]._alpha = 0;
mcl.loadClip("files/" + pics[ipic], holder["p" + ipic]);
} // End of the function
function tweenToLeft()
{
if (ifarleft + 3 < pics.length)
{
new mx.transitions.Tween(holder, "_x", mx.transitions.easing.Strong.easeOut, holder._x, holder._x - 166, 1, true);
++ifarleft;
} // end if
} // End of the function
function tweenToRight()
{
if (ifarleft > 0)
{
new mx.transitions.Tween(holder, "_x", mx.transitions.easing.Strong.easeOut, holder._x, holder._x + 166, 1, true);
--ifarleft;
} // end if
} // End of the function
function init()
{
lv.onLoad = fillPicsArray;
lv.load("readfromdir.php");
mcl = new MovieClipLoader();
mcl.addListener(this);
ipic = 0;
ifarleft = 0;
this.createEmptyMovieClip("holder", 1);
picShadow = new flash.filters.DropShadowFilter();
picShadow.blurY = 3;
picShadow.blurX = 3;
picShadow.inner = false;
picShadow.angle = 45;
picShadow.distance = 5;
picShadow.color = 0;
picShadow.alpha = 20;
right.onRelease = mx.utils.Delegate.create(this, tweenToLeft);
left.onRelease = mx.utils.Delegate.create(this, tweenToRight);
} // End of the function
var lv = new LoadVars();
var pics = [];
var mcl;
var ipic;
var picShadow;
var ifarleft;
init();
stop();
Moet ik wat veranderen in m'n actionscript? ik hoorde iets van ergens .root voorzetten maar waar???
Dit is de code waar het om gaat:
function fillPicsArray(ok)
{
if (ok)
{
var _loc2 = 0;
do
{
pics.push(this["f" + _loc2]);
} while (this["f" + ++_loc2] != undefined)
loadPic();
}
else
{
trace ("problem with the script");
} // end else if
} // End of the function
function onLoadInit(pic)
{
pic._width = 150;
pic._height = 100;
pic._x = 151 + 166 * ipic;
pic._y = 316;
pic._alpha = 100;
pic.filters = [picShadow];
if (++ipic < pics.length)
{
loadPic();
} // end if
} // End of the function
function loadPic()
{
holder.createEmptyMovieClip("p" + ipic, ipic);
holder["p" + ipic]._alpha = 0;
mcl.loadClip("files/" + pics[ipic], holder["p" + ipic]);
} // End of the function
function tweenToLeft()
{
if (ifarleft + 3 < pics.length)
{
new mx.transitions.Tween(holder, "_x", mx.transitions.easing.Strong.easeOut, holder._x, holder._x - 166, 1, true);
++ifarleft;
} // end if
} // End of the function
function tweenToRight()
{
if (ifarleft > 0)
{
new mx.transitions.Tween(holder, "_x", mx.transitions.easing.Strong.easeOut, holder._x, holder._x + 166, 1, true);
--ifarleft;
} // end if
} // End of the function
function init()
{
lv.onLoad = fillPicsArray;
lv.load("readfromdir.php");
mcl = new MovieClipLoader();
mcl.addListener(this);
ipic = 0;
ifarleft = 0;
this.createEmptyMovieClip("holder", 1);
picShadow = new flash.filters.DropShadowFilter();
picShadow.blurY = 3;
picShadow.blurX = 3;
picShadow.inner = false;
picShadow.angle = 45;
picShadow.distance = 5;
picShadow.color = 0;
picShadow.alpha = 20;
right.onRelease = mx.utils.Delegate.create(this, tweenToLeft);
left.onRelease = mx.utils.Delegate.create(this, tweenToRight);
} // End of the function
var lv = new LoadVars();
var pics = [];
var mcl;
var ipic;
var picShadow;
var ifarleft;
init();
stop();