Question
Access of possibly undefined property
I'm sure this is just a rookie mistake, but I'm getting the
following error:
1119: Access of possibly undefined property scaleX through a reference with static type Function.
It comes from the zoomCounty function at the bottom of 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;
var countyEndSize:Number = 2.5;
var countyEndPositionX:Number = 650;
var countyEndPositionY:Number = 220;
var framesForZoomIn:Number = 10;
var framesForZoomout:Number = 10;
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();
}
// 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?
}
public function zoomCounty():void
{
{
var countyTweenZoomX:Tween = new Tween(selectedCounty, "scaleX", Regular.easeInOut, selectedCounty.scaleX , (selectedCounty.scaleX +countyEndSize), framesForZoomIn, false);
var countyTweenZoomY:Tween = new Tween(selectedCounty, "scaleY", Regular.easeInOut, selectedCounty.scaleY , (selectedCounty.scaleY +countyEndSize), framesForZoomIn, false);
var countyTweenPositionX:Tween = new Tween(selectedCounty, "x", Regular.easeInOut, selectedCounty.x , countyEndPositionX, framesForZoomIn, false);
var countyTweenPositionY:Tween = new Tween(selectedCounty, "y", Regular.easeInOut, selectedCounty.y , countyEndPositionY, framesForZoomIn, false);
/*var textTweenAlpha:Tween = new Tween(countyTextFieldBelo, "alpha", Regular.easeInOut, countyTextFieldBelo.alpha , 1, (framesForZoomIn +10), false);
addChild(countyTextFieldBelo);*/
}
}
}
}
1119: Access of possibly undefined property scaleX through a reference with static type Function.
It comes from the zoomCounty function at the bottom of 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;
var countyEndSize:Number = 2.5;
var countyEndPositionX:Number = 650;
var countyEndPositionY:Number = 220;
var framesForZoomIn:Number = 10;
var framesForZoomout:Number = 10;
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();
}
// 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?
}
public function zoomCounty():void
{
{
var countyTweenZoomX:Tween = new Tween(selectedCounty, "scaleX", Regular.easeInOut, selectedCounty.scaleX , (selectedCounty.scaleX +countyEndSize), framesForZoomIn, false);
var countyTweenZoomY:Tween = new Tween(selectedCounty, "scaleY", Regular.easeInOut, selectedCounty.scaleY , (selectedCounty.scaleY +countyEndSize), framesForZoomIn, false);
var countyTweenPositionX:Tween = new Tween(selectedCounty, "x", Regular.easeInOut, selectedCounty.x , countyEndPositionX, framesForZoomIn, false);
var countyTweenPositionY:Tween = new Tween(selectedCounty, "y", Regular.easeInOut, selectedCounty.y , countyEndPositionY, framesForZoomIn, false);
/*var textTweenAlpha:Tween = new Tween(countyTextFieldBelo, "alpha", Regular.easeInOut, countyTextFieldBelo.alpha , 1, (framesForZoomIn +10), false);
addChild(countyTextFieldBelo);*/
}
}
}
}