[RESOLVED] AS3 and TweenMax
Hi,
Decided this week to bite the bullet and learn AS3 from AS2.
Basically what I have is 6 movieclips nested in a single mc.
-- main_holder --
-- panel_01 --
-- panel_02 --
-- panel_03 --
-- panel_04 --
........
Each of the panels loads an external movie. All this works fine.
All panels are visible on screen at once.
I have a separate menu. I have tried to write a script that will blur the panels that are not in use. So if a user clicks a button to view panel_01, all the other panels should blur.
Here is my code so far but it isn't working.
PHP Code:
//Blur others
var panelMcs:Array = new Array("main_holder.panel_01", "main_holder.panel_02", "main_holder.panel_03", "main_holder.panel_04", "main_holder.panel_05", "main_holder.panel_06");
function blurOthers(target) {
for (var i:Number=0;i<6;i++){
if (panelMcs[i] != target) {
var bMC:String = new String(panelMcs[i]);
TweenMax.to(bMC, 0.5, {blurFilter:{blurX:5, blurY:5}});
} else {
TweenMax.to(target,0.5, {blurFilter:{blurX:0, blurY:0}});
}
}
}
I am calling the function like so
PHP Code:
blurOthers(main_holder.panel_01);
I'm not sure if the bMC:String part is correct - the code is just my last attempt at getting it to work.
Not sure if this helps but this is the error message I'm getting when I click on a button
Code:
ReferenceError: Error #1069: Property filters not found on String and there is no default value.
at gs.plugins::FilterPlugin/initFilter()
at gs.plugins::BlurFilterPlugin/onInitTween()
at gs::TweenLite/initTweenVals()
at gs::TweenMax/initTweenVals()
at gs::TweenLite/activate()
at gs::TweenLite$/updateAll()
Hope all makes sense!
Thanks for the help
James