irowake
%Europe/Berlin %835 %2008, 21:02
Goedeavond,
Ik laad met actionscript een aantal png-images in. Hierop gebruik ik dezelfde images als masker zodat ik alleen maar over de niet-transparante delen kan gaan. Als ik hierover ga, worden de afbeeldingen geschaald tot 100%. Het lukt me echter niet om het masker erop te zetten.
Ik heb ook cacheAsBitmap op true gezet, maar dit lijkt geen effect te hebben. Wat doe ik verkeerd?
Hieronder mijn code:
myProduct_mc = _root.myProducts_mc.myImages_mc.createEmptyMovieCl ip("myProduct" + i, _root.myProducts_mc.myImages_mc.getNextHighestDept h());
myMask_mc = myProduct_mc.createEmptyMovieClip("myMask_mc", myProduct_mc.getNextHighestDepth());
myProduct_mc.num = i;
myProduct_mc._x = productChildNode.attributes.xpos;
myProduct_mc._y = productChildNode.attributes.ypos;
myImage = myProduct_mc.createEmptyMovieClip("myImage", myProduct_mc.getNextHighestDepth());
myMask = myMask_mc.createEmptyMovieClip("myMask", myMask_mc.getNextHighestDepth());
loadMovie("http://users.telenet.be/irowake/" + _root.gallery_path + productChildNode.attributes.url,myProduct_mc.myIma ge);
loadMovie("http://users.telenet.be/irowake/" + _root.gallery_path + productChildNode.attributes.url,myMask_mc.myMask);
myMask._xscale=94;
myMask._yscale=94;
myImage._xscale=94;
myImage._yscale=94;
myImage.cacheAsBitmap=true;
myMask.cacheAsBitmap=true;
myImage.setMask(myMask);
_root.myProducts_mc.myImages_mc["myProduct" + i].onRelease = function()
{
}
_root.myProducts_mc.myImages_mc["myProduct" + i].onRollOver = function()
{
_root.myProducts_mc.myImages_mc["myProduct" + this.num].myImage._xscale=100;
_root.myProducts_mc.myImages_mc["myProduct" + this.num].myImage._yscale=100;
_root.myProducts_mc.myImages_mc["myProduct" + this.num].myMask_mc.myMask._xscale=100;
_root.myProducts_mc.myImages_mc["myProduct" + this.num].myMask_mc.myMask._yscale=100;
}
_root.myProducts_mc.myImages_mc["myProduct" + i].onRollOut = function()
{
_root.myProducts_mc.myImages_mc["myProduct" + this.num].myImage._xscale=94;
_root.myProducts_mc.myImages_mc["myProduct" + this.num].myImage._yscale=94;
_root.myProducts_mc.myImages_mc["myProduct" + this.num].myMask_mc.myMask._xscale=94;
_root.myProducts_mc.myImages_mc["myProduct" + this.num].myMask_mc.myMask._yscale=94;
}
Ik laad met actionscript een aantal png-images in. Hierop gebruik ik dezelfde images als masker zodat ik alleen maar over de niet-transparante delen kan gaan. Als ik hierover ga, worden de afbeeldingen geschaald tot 100%. Het lukt me echter niet om het masker erop te zetten.
Ik heb ook cacheAsBitmap op true gezet, maar dit lijkt geen effect te hebben. Wat doe ik verkeerd?
Hieronder mijn code:
myProduct_mc = _root.myProducts_mc.myImages_mc.createEmptyMovieCl ip("myProduct" + i, _root.myProducts_mc.myImages_mc.getNextHighestDept h());
myMask_mc = myProduct_mc.createEmptyMovieClip("myMask_mc", myProduct_mc.getNextHighestDepth());
myProduct_mc.num = i;
myProduct_mc._x = productChildNode.attributes.xpos;
myProduct_mc._y = productChildNode.attributes.ypos;
myImage = myProduct_mc.createEmptyMovieClip("myImage", myProduct_mc.getNextHighestDepth());
myMask = myMask_mc.createEmptyMovieClip("myMask", myMask_mc.getNextHighestDepth());
loadMovie("http://users.telenet.be/irowake/" + _root.gallery_path + productChildNode.attributes.url,myProduct_mc.myIma ge);
loadMovie("http://users.telenet.be/irowake/" + _root.gallery_path + productChildNode.attributes.url,myMask_mc.myMask);
myMask._xscale=94;
myMask._yscale=94;
myImage._xscale=94;
myImage._yscale=94;
myImage.cacheAsBitmap=true;
myMask.cacheAsBitmap=true;
myImage.setMask(myMask);
_root.myProducts_mc.myImages_mc["myProduct" + i].onRelease = function()
{
}
_root.myProducts_mc.myImages_mc["myProduct" + i].onRollOver = function()
{
_root.myProducts_mc.myImages_mc["myProduct" + this.num].myImage._xscale=100;
_root.myProducts_mc.myImages_mc["myProduct" + this.num].myImage._yscale=100;
_root.myProducts_mc.myImages_mc["myProduct" + this.num].myMask_mc.myMask._xscale=100;
_root.myProducts_mc.myImages_mc["myProduct" + this.num].myMask_mc.myMask._yscale=100;
}
_root.myProducts_mc.myImages_mc["myProduct" + i].onRollOut = function()
{
_root.myProducts_mc.myImages_mc["myProduct" + this.num].myImage._xscale=94;
_root.myProducts_mc.myImages_mc["myProduct" + this.num].myImage._yscale=94;
_root.myProducts_mc.myImages_mc["myProduct" + this.num].myMask_mc.myMask._xscale=94;
_root.myProducts_mc.myImages_mc["myProduct" + this.num].myMask_mc.myMask._yscale=94;
}