Skip to main content
Inspiring
March 15, 2007
Question

DropShadow problem

  • March 15, 2007
  • 9 replies
  • 333 views
Hi

I have a serious problem... i have this code:

var dropShadow:DropShadowFilter = new DropShadowFilter(actiune.distanta, actiune.unghi, actiune.culoare_umbra, 50, actiune.blur, actiune.blur, actiune.cantitate, 3, Inte, Taie, Ascunde);

the problem is with the last tree variables: if the variables are all false the DropShadowFilter puts them true, if one is true it remains true


for example:

Inte=false
Taie=false
Ascunde=false

i have to send them to component like this :

var dropShadow:DropShadowFilter = new DropShadowFilter(actiune.distanta, actiune.unghi, actiune.culoare_umbra, 50, actiune.blur, actiune.blur, actiune.cantitate, 3, !Inte, !Taie, !Ascunde);

and it's working fine....

hope you'll understand ...
please help
This topic has been closed for replies.

9 replies

March 15, 2007
I think it is the way that 'actiune.interioara' is being set. Are you able to show how this value is being initialised?

Does this work too? : if(actiune.interioara=="true")

You can check the type of actiune.interioara by doing this:
trace(typeof(actiune.interioara)); // should trace Boolean if it is (I'm guessign it will trace String)
Inspiring
March 15, 2007
i am shore... i have checked it before an after 100 times

i solved the problem bu converting in to string if(String(actiune.interioara)=="true")

But i still don't understand why as boolean won't work
March 15, 2007
How are you setting 'actiune.interioara'? What is the code for this part?

Are you sure you are getting the same result with 'var test:Boolean=Boolean(actiune.interioara)'
The reason I ask is that if you are casting the value to a Boolean, then the trace and if would show the same value (true:yes and false:no)
Inspiring
March 15, 2007
it's not a class its just an object
I tried do define another variable an got the same result

var test:Boolean=actiune.interioara
trace(test) //output is ok
//but on if statement is not ok
if(test){
trace("yes")
else{
trace("no")
}
//output if test=false: yes
//output if test=true: yes


i even tried var test:Boolean=Boolean(actiune.interioara)
to make shore that actiune.interioara is boolean
March 15, 2007
I was wondering if actiune is a custom class (with a .as file?). It could be a datatype issue?

Not that the string value "false" is boolean true.

Inspiring
March 15, 2007
var dropSh:DropShadowFilter = new DropShadowFilter(actiune.distanta, actiune.unghi, actiune.culoare_umbra, 50, actiune.blur, actiune.blur, actiune.cantitate, 3, !Inte, !Taie, !Ascunde);

dropSh is the DropShadowFilter and actiune is an object
March 15, 2007
What are dropSh and actiune?

Inspiring
March 15, 2007

//EXAMPLE CODE
dropSh.inner = actiune.interioara;
dropSh.knockout = actiune.taie;
dropSh.hideObject = actiune.ascunde;

trace(actiune.interioara);
trace(actiune.taie);
trace(actiune.ascunde);
trace("************");
trace(dropSh.inner);
trace(dropSh.knockout);
trace(dropSh.hideObject);

//OUTPUT1
false
false
false
************
true
true
true
//OUTPUT2
false
true
false
************
true
true
true


How can this bee ???? How can i fix this bug ? What am i doing wrong ?
Inspiring
March 15, 2007
Please help