funkmasterta
October 7th, 2009, 12:51 AM
I've never encountered this before and I'm having a bloody time trying to figure out what's wrong!
I have 2 classes. This is the first class:
package
{
import flash.display.MovieClip;
public class myClass1 extends MovieClip
{
private var sTest:String;
private var myMC:MovieClip;
public function myClass1()
{
super();
sTest = "inside";
trace("Traced from private function: " + sTest);
myMC.width = 200;
}
public function change():void {
sTest = "outside";
trace("Traced from public function: " + sTest);
myMC.width = 10;
}
}
}
This is the second class:
package
{
import flash.display.MovieClip;
import myClass1;
public class myClass2 extends MovieClip
{
private var mc1:myClass1;
public function myClass2()
{
super();
mc1 = new myClass1();
mc1.change();
}
}
}
When I compile, I get this in the output panel:
Traced from private function: inside
Traced from public function: inside
And the myMC movie is still 200 wide?
Any ideas why the public function isn't assigning values to the variable and not able to change the property of the movieclip?
This is the strangest bug I've ever seen. Any ideas would be great! :pac:
I have 2 classes. This is the first class:
package
{
import flash.display.MovieClip;
public class myClass1 extends MovieClip
{
private var sTest:String;
private var myMC:MovieClip;
public function myClass1()
{
super();
sTest = "inside";
trace("Traced from private function: " + sTest);
myMC.width = 200;
}
public function change():void {
sTest = "outside";
trace("Traced from public function: " + sTest);
myMC.width = 10;
}
}
}
This is the second class:
package
{
import flash.display.MovieClip;
import myClass1;
public class myClass2 extends MovieClip
{
private var mc1:myClass1;
public function myClass2()
{
super();
mc1 = new myClass1();
mc1.change();
}
}
}
When I compile, I get this in the output panel:
Traced from private function: inside
Traced from public function: inside
And the myMC movie is still 200 wide?
Any ideas why the public function isn't assigning values to the variable and not able to change the property of the movieclip?
This is the strangest bug I've ever seen. Any ideas would be great! :pac: