geplaatst door: Timmy
Hallo allen,

Is het mogelijk om op een instance
te klikken met het effect dat all het
andere wat op een "bureaublad" ligt
te blurren?

Dit kan helaas niet quick en dirty met
bv. photoshop. De objecten op het
bureaublad zijn drag and drop.

flash as2 alles blur behalve 1 instance
18 mei 2009 - 15:31    reactie #1
geplaatst door: Timmy
Ik heb al een oplossing gevonden. Al werkt deze niet zo fijn.
Ik maak gebruik van mc_tween2

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");
}

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)

flash as2 alles blur behalve 1 instance
18 mei 2009 - 16:25    reactie #2
geplaatst door: AndreRelink
Je kan alle childs opvragen.



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
    }
 }
}

Kan je hier wat mee?

Succes André

(Bewerkt door AndreRelink om 16:41, 18-05-2009)

flash as2 alles blur behalve 1 instance
18 mei 2009 - 16:43    reactie #3
geplaatst door: Timmy
dubbele onzin... srry

(Bewerkt door Timmy om 16:51, 18-05-2009)

flash as2 alles blur behalve 1 instance
18 mei 2009 - 16:51    reactie #4
geplaatst door: Timmy
ow wacht eens.

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() {...}
      }

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); }
      }

flash as2 alles blur behalve 1 instance
18 mei 2009 - 17:07    reactie #5
geplaatst door: AndreRelink
Hoezo dubbele onzin?

Maar goed, de combinatie van functies geeft je de juiste oplossing?

flash as2 alles blur behalve 1 instance
18 mei 2009 - 17:22    reactie #6
geplaatst door: Timmy
dat van "bubbele onzin" was een bubble post van mij.
daarom even weg gehaald.

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);
myChild pakt het niet.


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 functie
trace("if");
myChild.blurTo(10, 2, 1);
   }
else {
//just to test
trace("else");
}
}
}

(Bewerkt door Timmy om 17:45, 18-05-2009)

flash as2 alles blur behalve 1 instance
18 mei 2009 - 18:30    reactie #7
geplaatst door: Timmy
kan het zijn dat de twee array's met elkaar in gevecht gaan?

en moet ik wel myChild geven bij:
myChild.blurTo(10, 2, 1);

flash as2 alles blur behalve 1 instance
18 mei 2009 - 19:46    reactie #8
geplaatst door: AndreRelink
misschien is dit makkelijker.

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);

}


André

flash as2 alles blur behalve 1 instance
18 mei 2009 - 20:24    reactie #9
geplaatst door: Timmy
Ik denk dat we op de juiste weg zitten.
Alleen nu doet hij wel alles ipv. alles-1.

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);
     
           }
     }
[url]
flash as2 alles blur behalve 1 instance
18 mei 2009 - 21:17    reactie #10
geplaatst door: AndreRelink
Helaas fla bestand kan niet worden geopend door Flash.
Misschien even zippen?
flash as2 alles blur behalve 1 instance
18 mei 2009 - 22:10    reactie #11
geplaatst door: Timmy
ow,
http://timromkes.nl/download/test02.fla.zip
ook voor de zekerheid even als CS3 opgeslagen...
flash as2 alles blur behalve 1 instance
19 mei 2009 - 14:33    reactie #12
geplaatst door: Timmy
Verder niemand?