Is het mogelijk om op een instance te klikken met het effect dat all het andere wat op een "bureaublad" ligtte blurren?
Dit kan helaas niet quick en dirty metbv. photoshop. De objecten op het bureaublad zijn drag and drop.
nu heb ik, per instance:
section02.onPress = function(){bg.blurTo(10, 2, 1);postit01.blurTo(10, 2, 1);postit02.blurTo(10, 2, 1);section01.blurTo(10, 2, 1);section03.blurTo(10, 2, 1);section04.blurTo(10, 2, 1);sticker01.blurTo(10, 2, 1);trace("blur");}section02.onRelease = function(){bg.blurTo(0, 2, 1);postit01.blurTo(0, 2, 1);postit02.blurTo(0, 2, 1);section01.blurTo(0, 2, 1);section03.blurTo(0, 2, 1);section04.blurTo(0, 2, 1);sticker01.blurTo(0, 2, 1);trace("no blur");}
trace("blur");}
section02.onRelease = function(){bg.blurTo(0, 2, 1);postit01.blurTo(0, 2, 1);postit02.blurTo(0, 2, 1);section01.blurTo(0, 2, 1);section03.blurTo(0, 2, 1);section04.blurTo(0, 2, 1);sticker01.blurTo(0, 2, 1);
trace("no blur");}
Dit is natuurlijk een beetje omslachtig.Gezien er meer dan 15 instances komen.
Kan ik hiervoor een array - (lees: min) this maken?
(Bewerkt door Timmy om 15:35, 18-05-2009)
(Bewerkt door Timmy om 15:37, 18-05-2009)
(Bewerkt door Timmy om 15:41, 18-05-2009)
section02.onPress = function() { for ( var i = 0; i < stage.numChilderen; i++) { var myChild = stage.getChildAt(i); if ( myChild._name != "instanceName") // sla instance over { // ga verder met je blur functie } }}
if ( myChild._name != "instanceName") // sla instance over {
// ga verder met je blur functie } }}
Kan je hier wat mee?
Succes André
(Bewerkt door AndreRelink om 16:41, 18-05-2009)
(Bewerkt door Timmy om 16:51, 18-05-2009)
ik heb dit al elders in mijn script:
var section_arr:Array = [section01, section02, section03, section04]; for(var i = 0; i < section_arr.length; i++){ actions(section_arr[i]); }function actions(Qual:MovieClip) { Qual.onPress = function() {...} Qual.onRelease = function() {...} }
function actions(Qual:MovieClip) { Qual.onPress = function() {...} Qual.onRelease = function() {...} }
Dus dan wordt het?
var section_arr:Array = [section01, section02, section03, section04]; for(var i = 0; i < section_arr.length; i++){ actions(section_arr[i]); }for ( var i = 0; i < stage.numChilderen; i++) {var myChild = stage.getChildAt(i);}function actions(Qual:MovieClip) { Qual.onPress = function() {myChild.blurTo(10, 2, 1); } Qual.onRelease = function() {myChild.blurTo(0, 2, 1); } }
for ( var i = 0; i < stage.numChilderen; i++) {var myChild = stage.getChildAt(i);}
function actions(Qual:MovieClip) { Qual.onPress = function() {myChild.blurTo(10, 2, 1); } Qual.onRelease = function() {myChild.blurTo(0, 2, 1); } }
Maar goed, de combinatie van functies geeft je de juiste oplossing?
Script: --update --Ok, so far, so good.ben even in een nieuwe document begonnen.nu krijg ik wel de juiste trace, trace "if".
Maar hoe spreek ik nu de array aan?
myChild.blurTo(10, 2, 1);
stop();var section_arr:Array = [section01, section02, section03, section04]; for(var i = 0; i < section_arr.length; i++){ actions(section_arr[i]); }for ( var i = 0; i < stage.numChilderen; i++) {var myChild = stage.getChildAt(i);}function actions(Qual:MovieClip) {Qual.onPress = function() {trace("click"); if ( myChild._name != "instanceName") // sla instance over {// ga verder met je blur functietrace("if");myChild.blurTo(10, 2, 1); }else {//just to testtrace("else");}}}
var section_arr:Array = [section01, section02, section03, section04]; for(var i = 0; i < section_arr.length; i++){ actions(section_arr[i]); }
function actions(Qual:MovieClip) {Qual.onPress = function() {trace("click");
if ( myChild._name != "instanceName") // sla instance over {// ga verder met je blur functietrace("if");myChild.blurTo(10, 2, 1); }else {//just to testtrace("else");}}}
(Bewerkt door Timmy om 17:45, 18-05-2009)
en moet ik wel myChild geven bij:myChild.blurTo(10, 2, 1);
Qual.onPress = function() { var section_arr:Array = [section01, section02]; for(var i = 0; i < section_arr.length; i++){ actions(section_arr[i]); } }function actions(e) { trace(e._name); e._x = e._x - 10; //test op movieClip regel verwijderen e.blurTo(10, 2, 1); }Qual.onRelease = function() { var section_arr:Array = [section01, section02]; for(var i = 0; i < section_arr.length; i++){ actions2(section_arr[i]); } }function actions2(e) { trace(e._name); e._x = e._x + 10; //test op movieClip regel verwijderen e.blurTo(0, 2, 1); }
var section_arr:Array = [section01, section02]; for(var i = 0; i < section_arr.length; i++){ actions(section_arr[i]); }
}
function actions(e) { trace(e._name); e._x = e._x - 10; //test op movieClip regel verwijderen e.blurTo(10, 2, 1); }
Qual.onRelease = function() {
var section_arr:Array = [section01, section02]; for(var i = 0; i < section_arr.length; i++){ actions2(section_arr[i]); }
function actions2(e) { trace(e._name); e._x = e._x + 10; //test op movieClip regel verwijderen e.blurTo(0, 2, 1); }
André
Ik zal even een zeer kale .fla toevoegen.Deze http://timromkes.nl/download/test02.fla
stop(); #include "mc_tween2.as" var section_arr:Array = [section01, section02, section03, section04]; for(var i = 0; i < section_arr.length; i++){ actions01(section_arr[i]); } function actions01(Qual:MovieClip) { Qual.onPress = function() { var section_arr:Array = [section01, section02, section03]; for(var i = 0; i < section_arr.length; i++){ actions02(section_arr[i]); } Qual.onRelease = function() { var section_arr:Array = [section01, section02, section03]; for(var i = 0; i < section_arr.length; i++){ actions03(section_arr[i]); } } } function actions02(e) { trace(e._name); e._x = e._x - 10; //test op movieClip regel verwijderen e.blurTo(10, 2, 1); } function actions03(e) { trace(e._name); e._x = e._x + 10; //test op movieClip regel verwijderen e.blurTo(0, 2, 1); } }