I have a fla file with movieClips representing state counties. I have it so if you click
on a county it will trace that countie’s name. Problem is I also want to trace it’s current
scale but I get the following error instead:
County selected is Umatilla
ReferenceError: Error #1069: Property scaleX not found on String and there is no default value.
at County/selectedCounty()
Here is the code:
// main county
package
{
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.Font;
import flash.display.Sprite;
import flash.utils.;
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.Event;
public class County extends MovieClip // what extends means is that in addition to all the below properties and methods you're also
// adding the methods of movieclips
// County adds the properties of movieclips plus a mouseclick listener and a return of the name of the selected county?
{
// this event listener had to be within its own function to work
// this is a constructor
// this is a method too
// this is a constructor because its named after the class
public function County()
{
addEventListener(MouseEvent.CLICK , selectedCounty); // if the mouuse is clicked it calls the next function below which returns the name of the
// selected movieclip county.
}
// this is also a method
private function selectedCounty(event:MouseEvent):void
{
trace("County selected is " + this.Name()); // this calls upon the next function which gets the qualified class name of the movieclip
var currentCounty = this.Name();
trace (currentCounty.scaleX);
}
// another method of course
// this function returns name of the county
public function Name()
{
return getQualifiedClassName(this); // puts the countie's name in the Name variable?
}
}
}
// you can put functions and call such functions here as well