Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Access Of Undefined Property B_Btn.



I am beginer to doing this and i watched some tutorials but i can't make it wright.
stop();

import flash.events.MouseEvent;
var getTutvid:URLRequest = new URLRequest("http://www.google.com");
b_Btn.addEventListener(MouseEvent.CLICK,bClick);

function bClick(event:MouseEvent):void{
navigateToURL(getTutvid);
}

and here is the sample from the button
http://w15.easy-share.com/1702757335.html

sry for my poor english.Any help is welcome.Tnx



ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 12-09-2008, 02:26 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Access Of Undefined Property...
Hello - I'm trying to use a variable created in the "earthPress" function down below in the "earthTurn" function, but I get 1120: Access of undefined property angleStart. How would I do this?

PHP Code:




//
earth.addEventListener(MouseEvent.MOUSE_DOWN, earthPress);
stage.addEventListener(MouseEvent.MOUSE_UP, earthRelease);
//
function earthPress(e:MouseEvent) {
    var pointX_Start = mouseX;
    var pointY_Start = mouseY;
    var earthX_Start = earth.x;
    var earthY_Start = earth.y;
    var dX_Start = pointX_Start-earthX_Start;
    var dY_Start = pointY_Start-earthY_Start;
    var radians_Start = Math.atan2(dY_Start, dX_Start);
    var angleStart = radians_Start*180/Math.PI; // <------------------
    addEventListener(Event.ENTER_FRAME, earthTurn);
}
//
function earthTurn(e:Event) {
    var pointX = mouseX;
    var pointY = mouseY;
    var earthX = earth.x;
    var earthY = earth.y;
    var dX = pointX-earthX;
    var dY = pointY-earthY;
    var radians = Math.atan2(dY, dX);
    var angle = radians*180/Math.PI;
    earth.rotation = angle-angleStart; // <------------------

}
//
function earthRelease(e:MouseEvent) {
    removeEventListener(Event.ENTER_FRAME, earthTurn);
}

[CS3] Access Of Undefined Property
i created a symbol with the instance name of square. i double clicked the instance and then went to actions and did the following.

var square:MovieClip
square.height = 10

i got the error access of undefined property. but if i put that same code at scene 1 then there is no error. it seems that there is only an error when i double click the instance to leave scene 1. why is this an error and can i add something to the code above to stop the error?

Access Of Undefined Property...
Hi, I am trying to create a xml nav menu in AS3. Everything was great until I received a 1120 error: Access of undefined property page. I know what the error stands for, but I still can't find a way to resolve it. My code is below.
In my fla I have a movieclip named "page" and this line: var am:ASMenu = new ASMenu('menu.xml',this,5,40);
Thanks.

ps: I am new to AS, so please be gentil.


Code:
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.utils.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import fl.transitions.Tween;
import flash.display.Sprite;
import flash.filters.BitmapFilterQuality;
import flash.filters.BlurFilter;
import flash.events.DataEvent;
import flash.net.URLRequest;



public class ASMenu extends MovieClip {
private var actions:Object;
private var mc:DisplayObjectContainer;
private var X:int;
private var Y:int;

private var button1:String;
private var button2:String;
private var ct:ColorTransform;
private var upColor:uint;
private var overColor:uint;

private var container:Sprite;
private var subContainer:Sprite;
private var inactive:MovieClip;
private var tm:Timer;
private var tw:Tween;

private var ifCloseAll:Boolean;
//This loader is used to load the external swf files
private var loader:Loader;

//URLRequest stores the path to the file to be loaded
private var urlRequest:URLRequest;

//This array holds all the tweens, so they
//don't get garbage collected
private var tweens:Array = new Array();

//Stores the current page we are displaying
public var currentPage:MovieClip = null;

//Stores the next page that we are going to display
public var nextPage:MovieClip = null;


public function ASMenu(path:String,mc:DisplayObjectContainer,X:int,Y:int):void {
actions = new Object();
actions.doURL = function(vars):URLRequest {
var ur:URLVariables = new URLVariables(vars);
var requ:URLRequest = new URLRequest(ur.path);
delete(ur.path);
if(ur.toString().length != 0) requ.data = ur;
return requ;
}

actions.doRef = function(path):* {
var arr:Array = path.split('.');
var ref:*;
for(var i:uint = 0; i < arr.length; i++) ref = (!ref)?mc[arr[i]] :ref[arr[i]];
return ref;
}

actions.gotoURL = function(vars) {
var requ:URLRequest = actions.doURL(vars);
navigateToURL(requ);
}

actions.gotoFrame = function(vars) {
var ur:URLVariables = new URLVariables(vars);
var ref:MovieClip = actions.doRef(ur.path);

var conv:uint = uint(ur.frame);
var frame:* = (conv != 0)?conv :ur.frame;

(ur.action == 'gotoAndPlay')?ref.gotoAndPlay(frame) :ref.gotoAndStop(frame);
}

actions.loadMenu = function(vars) {
removeAllChildren(container);
var requ:URLRequest = actions.doURL(vars);
loadXML(requ);
}

actions.loadSWF = function(vars) {
var ur:URLVariables = new URLVariables(vars);
var requ:URLRequest = new URLRequest(ur.path);
trace(ur.path);
var loader:Loader = new Loader();
loader.load(requ);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, fileLoaded);
}

actions.printMessage = function(vars) {
var ur:URLVariables = new URLVariables(vars);
var ref:TextField = actions.doRef(ur.path);
ref.htmlText = ur.msg;
}

this.mc = mc;
this.X = X;
this.Y = Y;
loadXML(new URLRequest(path));
}

public function loadXML(requ:URLRequest):void {
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(requ);
xmlLoader.addEventListener(IOErrorEvent.IO_ERROR,IOErrorHandler);
xmlLoader.addEventListener(Event.COMPLETE,completeHandler);
}

private function IOErrorHandler(e:IOErrorEvent):void {
trace('Errore durante il caricamento del file XML: ' + e.text);
}

private function completeHandler(e:Event):void {
try {
var xml:XML = new XML(e.target.data);
button1 = xml.@button1;
button2 = xml.@button2;
ct = new ColorTransform();
overColor = uint(xml.@overColor);
upColor = uint(xml.@upColor);
generateMainMenu(xml.children());
}
catch(e:Error) {
trace('Errore durante la lettura del file XML: ' + e.message);
}
}

private function generateMainMenu(nodes:XMLList):void {
inactive = null;
container = new Sprite();
mc.addChild(container);
subContainer = new Sprite();
container.addChild(subContainer);

container.stage.addEventListener(MouseEvent.CLICK,function() {
if(subContainer.numChildren > 0 && ifCloseAll) removeAllChildren(subContainer);
});
var menuX:uint = X;

tm = new Timer(250,nodes.length());
tm.addEventListener(TimerEvent.TIMER,function() {
var node:XML = nodes[tm.currentCount - 1];
var btn:MovieClip = getReference(button1);
btn.txt.text = node.@name;
btn.x = menuX;
btn.container = subContainer;
btn.action = node.@action;
btn.vars = node.@vars;
container.addChild(btn);
tw = new Tween(btn,'y',Elastic.easeOut,(Y + 30),Y,1,true);
tw = new Tween(btn,'alpha',Strong.easeIn,0,1,10,false);
btn.addEventListener(MouseEvent.CLICK,onClick);
btn.addEventListener(MouseEvent.ROLL_OVER,onMouseRoll);
btn.addEventListener(MouseEvent.ROLL_OUT,onMouseRoll);
btn.addEventListener(MouseEvent.CLICK,doInactive);
if(tm.currentCount == 1) inactive = btn;
if(node.@current == 'true') inactive = btn;
if(node.name() == 'menu') {
btn.nodes = node.children();
btn.X = btn.x;
btn.Y = Y + btn.height + 5;
btn.addEventListener(MouseEvent.CLICK,generateSubMenu);
}
menuX += btn.width + 5;
});
tm.addEventListener(TimerEvent.TIMER_COMPLETE,function() {
tw.addEventListener(TweenEvent.MOTION_FINISH,function() {
ct.color = overColor;
inactive.txt.transform.colorTransform = ct;
//tw = new Tween(inactive,'y',Strong.easeOut,Y,(Y + 5),10,false);
executeAction(inactive.action,inactive.vars);
trace(inactive.action,inactive.vars);
doInactive(new MouseEvent('click'));
});
});
tm.start();
}

private function generateSubMenu(e:MouseEvent):void {
if(e.target.container.numChildren > 0) removeAllChildren(e.target.container as Sprite)
var subMenu:Sprite = new Sprite();
e.target.container.addChild(subMenu);

var Y:int = e.target.Y;
for(var i:uint = 0; i < e.target.nodes.length(); i++) {
var node:XML = e.target.nodes[i];
var btn:MovieClip = getReference(button2);
btn.txt.text = node.@name;
btn.x = e.target.X;
btn.y = Y;
btn.container = subMenu;
btn.action = node.@action;
btn.vars = node.@vars;
e.target.container.addChild(btn);
tw = new Tween(e.target.container,'alpha',None.easeIn,0,1,10,false);
btn.addEventListener(MouseEvent.ROLL_OVER,onMouseRollSub);
btn.addEventListener(MouseEvent.ROLL_OUT,onMouseRollSub);
btn.addEventListener(MouseEvent.CLICK,onClick);
if(node.name() == 'menu') {
btn.nodes = node.children();
btn.X = btn.x + btn.width - 1;
btn.Y = btn.y;
btn.addEventListener(MouseEvent.ROLL_OVER,generateSubMenu);
}
Y += btn.height;
}
}

private function getReference(buttonName:String):MovieClip {
var button:Class = getDefinitionByName(buttonName) as Class;
var btn:MovieClip = new button() as MovieClip;
btn.buttonMode = true;
btn.mouseChildren = false;
return btn;
}

private function onMouseRoll(e:MouseEvent):void {
if(e.type == 'rollOut') {
ct.color = upColor;
//if(e.target.parent === container) tw = new Tween(e.target,'y',Strong.easeOut,(Y + 5),Y,10,false);
}
else if(e.type == 'rollOver') {
ct.color = overColor;
if(e.target.parent != container) removeAllChildren(e.target.container as Sprite);
}
e.target.txt.transform.colorTransform = ct;
ifCloseAll = true;
}

private function onMouseRollSub(e:MouseEvent):void {
if(e.type == 'rollOut') {
ct.color = overColor;
//if(e.target.parent === container) tw = new Tween(e.target,'y',Strong.easeOut,(Y + 5),Y,10,false);
}
else if(e.type == 'rollOver') {
ct.color = upColor;
if(e.target.parent != container) removeAllChildren(e.target.container as Sprite);
}
e.target.txt.transform.colorTransform = ct;
ifCloseAll = true;
}

private function onClick(e:MouseEvent):void {
if(e.target.action != '' && e.target.vars != '') {
executeAction(e.target.action,e.target.vars);
trace(e.target.action,e.target.vars);
}
if(subContainer.numChildren > 0) removeAllChildren(subContainer);
ifCloseAll = false;
}

private function executeAction(action,vars):void {
var currAction:String = action;
switch(currAction) {
case 'gotoURL':
actions.gotoURL(vars);
break;
case 'gotoFrame':
actions.gotoFrame(vars);
break;
case 'loadMenu':
actions.loadMenu(vars);
break;
case 'loadSWF':
actions.loadSWF(vars);
break;
case 'printMessage':
actions.printMessage(vars);
break;
}
}

private function removeAllChildren(menu:Sprite):void {
while(menu.numChildren != 0) menu.removeChildAt(menu.numChildren - 1);
}

private function doInactive(e:MouseEvent):void {
var btn:MovieClip;
if(!e.target) btn = inactive;
else {
btn = e.target as MovieClip;
doActive(inactive);
inactive = btn;
}
btn.removeEventListener(MouseEvent.ROLL_OVER,onMouseRoll);
btn.removeEventListener(MouseEvent.ROLL_OUT,onMouseRoll);
btn.removeEventListener(MouseEvent.CLICK,doInactive);
}

private function doActive(btn:MovieClip):void {
ct.color = upColor;
btn.txt.transform.colorTransform = ct;
//tw = new Tween(btn,'y',Strong.easeOut,(Y + 5),Y,10,false);
btn.addEventListener(MouseEvent.ROLL_OVER,onMouseRoll);
btn.addEventListener(MouseEvent.ROLL_OUT,onMouseRoll);
btn.addEventListener(MouseEvent.CLICK,doInactive);
}

//This function is called, when we have finished loading a content page
private function fileLoaded(e:Event):void {

//The loader contains the page we are going to display.
nextPage = e.target.content;
trace(e.target.content);

//Let's animate the current page away from the stage.
//First, we need to make sure there is a current page on the stage.
if(currentPage != null) {

//Tween the current page from left to the right
var tweenX:Tween = new Tween(currentPage, "x", Regular.easeOut,
currentPage.x, 700, 0.5, true);
tweenX.addEventListener(TweenEvent.MOTION_CHANGE, blurOn);
tweenX.addEventListener(TweenEvent.MOTION_FINISH, blurOff);

//Decrease the alpha to zero
var tweenAlpha:Tween = new Tween(currentPage, "alpha", Regular.easeOut,
1, 0, 0.5, true);

//Push the tweens into an array
tweens.push(tweenX);
tweens.push(tweenAlpha);

//currentPageGone will be called when the tween is finished
tweenX.addEventListener(TweenEvent.MOTION_FINISH, currentPageGone);
}

//There is no current page, so we can animate the next
//page to the stage. The animation is done in
//the showNextPage function.
else {
showNextPage();
}
}

//This function animates and displayes the next page
private function showNextPage():void {

//Tween the next page from left to the center
var tweenY:Tween = new Tween(nextPage, "y", Elastic.easeOut,
400, 0, 1, true);
//Tween the alpha to from 0 to 1
var tweenAlpha:Tween = new Tween(nextPage, "alpha", Regular.easeOut,
0, 1, 1, true);

//Push the tweens into an array
tweens.push(tweenY);
tweens.push(tweenAlpha);

//Add the next page to the stage
page.addChild(nextPage);

//Next page is now our current page
currentPage = nextPage;
}

//This function is called when the current page has been animated away
private function currentPageGone(e:Event):void {

//Remove the current page completely
page.removeChild(currentPage);

//Let's show the next page
showNextPage();
}

//Method to control blur
private function blurOn(event:TweenEvent):void{
var blur:BlurFilter = new BlurFilter()
blur.blurX = 20
blur.blurY = 5
blur.quality = BitmapFilterQuality.HIGH
nextPage.filters = [blur]
currentPage.filters = [blur]
}
//Method to control blur OFF
private function blurOff(event:TweenEvent):void{
var blur:BlurFilter = new BlurFilter()
blur.blurX = 0
blur.blurY = 0
blur.quality = BitmapFilterQuality.HIGH
nextPage.filters = [blur]
currentPage.filters = [blur]
}
}
}

Access Of Undefined Property
I'm new to AS3 and have been trying to learn from the as3 language and components reference/livedocs. It is good for reference but isn't intuitive for learning from the ground up.

I am using mxmlc.exe from the flex3 free sdk to compile just a straight AS3 file. here is the file and the mxmlc.exe error messages. I can tell I am missing a very basic concept as to WHY it doesn't work. Can someone help me?


ActionScript Code:
package
{
    import flash.display.Sprite;
    import mx.controls.*;
   
   
   
    public class diceRoll
    {
       
        var textArea1:TextArea = new TextArea();
        textArea1.setSize(320, 50);
        textArea1.move(10, 10);
        addChild(textArea1);
    }

}

errors:

diceRoll.as(13): col: 3 Error: Access of undefined property textArea1.

textArea1.setSize(320, 50);
^

diceRoll.as(14): col: 3 Error: Access of undefined property textArea1.

textArea1.move(10, 10);
^

diceRoll.as(15): col: 3 Error: Call to a possibly undefined method addChild.

addChild(textArea1);
^
diceRoll.as(15): col: 12 Error: Access of undefined property textArea1.

addChild(textArea1);
^

Access Of Undefined Property
Hi,

I am a newbie to Actionscript and have been trying to do some stuff by searching examples on net. Problem is all examples are in different versions of AS and I am not really able to learn from one example and put into another. For example below is the code snippet from my attempt to convert an AS1/2 code to AS3. I am getting an error saying "Access of undefined property points" in the last line of this code snippet.

Please tell me what is wrong with me.

Also, please excuse if it is very dumb question. I couldn't find forum for newbies here.

Thanks,
Mukesh




public class ImageGrid extends MovieClip {
public var points:Array;

onLoad = function () {

var gw:Number = 4 // grid width (points in grid)
var gh:Number = 4 // grid height
var sx:Number = 40 // x spacing (distance between points)
var sy:Number = 40 // y spacing
var range:Number = 80 // representative of how close mouse effects points
var accel:Number = .4 // elasticicty acceleration
var fric:Number = .55 // elasticicty friction
var imgIndex:Number = 1;
var depth:Number = 0;

// sections:
var sections:Array = ["cheese wheel","bird claw","movie show","cd polisher","g.i. snow","line lunge","street sign","love turtle","endless hole","grease stain"]


// function to draw line
MovieClip.prototype.DrawLine = function(p1,p2){
this.x = p1.x; this.scaleX = p2.x - p1.x;
this.y = p1.y; this.scaleY = p2.y - p1.y;
}

// Generate Points on the grid/attach buttons
points = new Array();

Access Of Undefined Property
Code:
public var x_pos, y_pos, width_n, height_n: int;
public var x_speed, y_speed: int;

x_speed = 0;
y_speed = 0;
x_pos = y_pos = width_n = height_n = 0;
It's giving me an error for the last three lines, saying "1120: Access of undefined property [name]"

I don't understand this error as I declared the variables right above. This is inside a class I'm building.

Thanks for any help .

Access Of Undefined Property
Hey guys,

still pretty new to AS3 so go easy on me

I was wondering how do you change the properties of a movie clip from a class that isn't the Document Class.

say I have text_mc on the stage and I want to change it's alpha to 0
If I do text_mc.alpha = 0; inside of the Document Class it works fine but if I do it in another class I get this error
1120: Access of undefined property text_mc

any ideas how to fix this?

Access Of Undefined Property?
To all the Pro's out there please help if you can.

I am getting an error "Access of undefined property"

The code returning the error is
var fileTypes:FileFilter=new FileFilter(file_Filter1,file_Filter2)
It does not want to expect my 2 vars file_Filter1 and file_Filter2

I have confirmed the both var file_Filter1 and file_Filter2 is correct, when you trace them you will get the following result
trace(file_Filter1) //result of trace // FileTypes (*.jpg, *.psd, *.pdf,)
trace(file_Filter2) //result of trace // *.jpg; *.psd; *.pdf

Here is what I dont get this returns the error
var fileTypes:FileFilter=new FileFilter(file_Filter1,file_Filter2)
and this does not
var fileTypes:FileFilter=new FileFilter(FileTypes (*.jpg, *.psd, *.pdf,),*.jpg; *.psd; *.pdf

Can anyone explain why I can use the vars to do the work, this is critical in this project, you might have notice I am getting the file extentions from the xml doc.

Any help would be great


Code:
var gallery_xml:XML
//var xmlReq:URLRequest = new URLRequest("../xmlExt.php");
var xmlReq:URLRequest = new URLRequest("../xmlExt.xml");

var xmlLoader:URLLoader = new URLLoader();

xmlLoader.load(xmlReq);
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);

function xmlLoaded(event:Event):void{

var myExtXml:XML = new XML(xmlLoader.data);

var myExt:XMLList = myExtXml.item.(@id == "ext");

var fTypes = "";
var f_Types = "";
for(var i:int = 0; i< myExt.length(); i++){
fTypes += '*'+myExt[i].label + ', ';
f_Types += '*'+myExt[i].label + '; ';
};
var file_Filter1 = "FileTypes ("+fTypes+")";
var file_Filter2 = f_Types;
trace(file_Filter1)
trace(file_Filter2)
};
//var fileTypes:FileFilter=new FileFilter("FileTypes (*.jpg, *.psd, )","*.jpg; *.psd; ");

var fileTypes:FileFilter=new FileFilter(file_Filter1,file_Filter2)

// Add both filter types to an array
var allTypes:Array=new Array(fileTypes);


// Set the FileReference name
var fileRef:FileReference = new FileReference();

// Add event listeners for your 2 buttons
browse_btn.addEventListener(MouseEvent.CLICK, browseBox);

// Function that fires off when the user presses "browse for a file"
function browseBox(event:MouseEvent):void {
fileRef.browse(allTypes);
}

Access Of An Undefined Property Error
I keep getting 66 errors of "1120: Access of undefined property" for like different properties/variables i am using in a class.

I am not sure why i am getting them. I am importing my class correctly cause if i comment out everything and just put a trace statement in the constructor it traces out fine.

I have attached the flash file and the classes in a zip file.

can someone explain my problem and help me fix it? I have searched all over and can't figure out why im getting this error.

1120: Access Of Undefined Property
okay, this is probably a very silly question but i cant work out what im doing wrong.

my lecturer made a website and i was using the menu action script for mine obviously changing the names for the buttons to corrospond to my site. yet im getting the error '1120: Access of undefined property error'. my code is:

package {
import flash.events.*;
import flash.display.*;

public class Mainmenu extends MovieClip {

public function Mainmenu() {
// Event Setup.
Gallery_home_btn.addEventListener(MouseEvent.CLICK ,navigationClicked);
Biography_home_btn.addEventListener(MouseEvent.CLI CK,navigationClicked);
Credits_home_btn.addEventListener(MouseEvent.CLICK ,navigationClicked);
Contacts_home_btn.addEventListener(MouseEvent.CLIC K,navigationClicked);

}

// Event Handlers.
private function navigationClicked(Event:MouseEvent):void {
var frmLabel:String='';
switch (Event.target) {
case Gallery_home_btn:
frmLabel="Gallery_frm";
break;
case Biography_home_btn:
frmLabel="Biography_frm";
break;
case Credits_home_btn:
frmLabel="Credits_frm";
break;
case Contacts_home_btn:
frmLabel="Contact_frm";
break;

}
//portfolio(root).gotoFrame(frmLabel);
MovieClip(root).gotoFrame(frmLabel);
}
}
}

can you please explain to me why i am getting that error.

thanks in advance

Access Of Undefined Property Instance1
if i create a new sprite/ or a movieclip and then add it to the stage:

var someName:Sprite = new Sprite();
addChild(someName);

that sprite/moviclip is going to have some instance name like "instance1"

i can see that with trace:
trace(someName.name);

but if i then say:
instance1.x = 100;

i wil get an error: "Access of undefined property instance1"

i know i can say:
someName.x = 100;

but why cant i get to it through its instance name, or can i somehow?
and what is the point of that instance name then?

the reason i am asking is if i have multiple sprites with the same name, but different instance names how could i get to each of them in that case?

Access Of Undefined Property From A Class
PHP Code:




package {
    import flash.display.MovieClip;
    import flash.events.Event;

    public class DumbClass extends MovieClip {
    
        var dumbXS:Number = 0;
        var dumbYS:Number = 0;
        var dumbACC:Number = 0.6;
        var dumbDEC:Number = 0.92;
        
        public function DumbClass() {
            this.addEventListener(Event.ENTER_FRAME, DumbMove);
        }

        public function DumbMove(evt:Event):void {
            //Increases Speed
            this.x += dumbXS;
            this.y += dumbYS;
            //Reference to a MovieClip on stage called "user".
            if (user.y < this.y) {
                dumbYS -= dumbACC;
            }
            //Reference to a MovieClip on stage called "user".
            if (user.y > this.y) {
                dumbYS += dumbACC;
            }
            //Reference to a MovieClip on stage called "user".
            if (user.x < this.x) {
                dumbXS -= dumbACC;
            }
            //Reference to a MovieClip on stage called "user".
            if (user.x > this.x) {
                dumbXS += dumbACC;
            }
            ///Decrease Speed
            dumbYS *= dumbDEC;
            dumbXS *= dumbDEC;
        }
    }
}







I get an error that "user" is an undefined property even though its on the stage any ideas how I can fix this? :crying:

1120: Access Of Undefined Property
var ys:Yahoo = new Yahoo();
ys.search('beach', 'web');

Gives "1120: Access of undefined property ys". This doesn't make sense to me at all.

Access Of Undefined Property? Textfield?
I'm creating a text field in a class and keep getting the same "1120: Access of undefined property feedback." error. What am I doing wrong?


Code:
package
{
import flash.display.Sprite;
import flash.text.*;
import flash.display.*;
import flash.text.TextField;
import flash.text.TextFieldType;

public class test extends Sprite
{
public var feedback:TextField = new TextField();
feedback.multiline = true;
feedback.width = 600;
}
}

1120: Access Of Undefined Property (mc And Btn)
I have a problem here. I've made a very simple code, but I can't get it to work.

I have a movieclip containing 4 buttons (inside of the movieclip), they have all their own instance name. The movieclip is looping (as it should), but when I do a mouseover on one of the buttons I want the movieclip to stop, which it doesn't.

And of course I get this error:

Quote:




1120: Access of undefined property sette_btn.





Quote:




sette_btn.addEventListener(MouseEvent.MOUSE_OVER, sette);




Can someone help me?


Code:
sette_btn.addEventListener(MouseEvent.MOUSE_OVER, sette);
function sette(event:MouseEvent):void
{
snurr_mc.stop();
}

1120: Access Of Undefined Property
I have my constants in a class 'Constants' in an external file, "Constants.as". All constants such as SCREEN_WIDTH are public static constants.

I get the compiler error "1120: Access of undefined property Constants" for every line of code that refers to Constants.<variable name>. The odd thing is I've been using this syntax in other classes (and in earlier versions of this class), and those don't throw any errors. I'm so frustrated! Does anyone have any idea what might cause this error?

Code:
package {
import Main;
import Constants;
import Systems;

public class Camera {
private var mX:Number;
private var mY:Number;
private var mDX:Number;
private var mDY:Number;

private static const V_CAP:Number = 4;
private static var xMin:Number = 0 + Constants.SCREEN_WIDTH / 2;
...

Access Of Undefined Property Stroke
I'm trying to upgrade a project from AS2 to AS3 and I get an error will trying to make a scroll panel.

The error is happening on stroke because if I create a new Rectangle it works fine. Does anyone have any ideas what I'm doing wrong?


Code:
var b:Rectangle = stroke.getBounds(this);
thanks

HitTestObject -> Access Of Undefined Property...
Hi!

I'm making this game, where you would shoot a target who advancing against you. Well I just wanted to test that it actually works, so for everytime you click, a enemy comes up and at the same time you will fire a bullet from the pistol. But when i try to run a hitTestObject between the target and the bullet, I get a access of underfined property

The code:


Code:
Mouse.hide();
stage.addEventListener(Event.ENTER_FRAME, mus);
pistol.addEventListener(MouseEvent.CLICK, skyt);
stage.addEventListener(MouseEvent.CLICK, zhi);
function zhi(evt:MouseEvent) {
var zhiar = new (Bboy);
stage.addChild(zhiar);
zhiar.x = -50;
zhiar.y = 500 * Math.random();
zhiar.addEventListener(Event.ENTER_FRAME, forward);
function forward(evt:Event) {
zhiar.x += 1;
}
********if (zhiar.hitTestObject(kule)) {
********removeChild(zhiar)
********}
}
function mus(evt:Event) {
pistol.x = mouseX;
pistol.y = mouseY;
if (pistol.hitTestObject(wz)) {
stage.removeEventListener(Event.ENTER_FRAME, mus);
pistol.removeEventListener(MouseEvent.CLICK, skyt);
gotoAndStop(3);
}
}
function skyt(evt:MouseEvent) {
pistol.gotoAndPlay(2);
var kule:Sprite = new Sprite();
kule.graphics.beginFill(0x666666);
kule.graphics.drawCircle(pistol.x - 110,pistol.y - 60,5);
kule.graphics.endFill();
stage.addChild(kule);
addEventListener(Event.ENTER_FRAME, skudd);
function skudd(evt:Event) {
kule.x -= 20;
}
}
stop();
Never mind my bad programming skills.
I get a access of undefined property kule (@ ********)

Andak

1120: Access Of Undefined Property
Every time I run my File i get the Compile Error: "1120: Access of undefined property login_btn" i cant figure out why its not working.

See Code Attached







Attach Code

this.stop()

import flash.events.EventDispatcher;
import flash.display.MovieClip;

function gotoLogin(event:Event):void {
this.gotoAndPlay("Login");
}

login_btn.addEventListener(MouseEvent.CLICK,gotoLogin);

1120: Access Of Undefined Property
This happend many times. I just copy and paste examples from books to learn Flash, but when I complie it, there are always error messages saying variable or property undefined. Is there some setting I need to do to avoid this? The errors and the codes are below. Thank you so so so much and happy New Year!

Error:
1120: Access of undefined property of timeTxt
1120: Access of undefined property of callBtn


Codes:

var phpFile:String= "

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);*/
}





}



}
}

































Edited: 04/24/2008 at 08:51:06 AM by vivaretro

1120: Access Of Undefined Property
I have a flash movie that has a function buildScreen()

function buildScreen() {
var sky:MovieClip = new MovieClip();
// content gets added to sky
sky.x = 0;
addChild( sky );
}

The sky shows up and I see it on the screen - works great.


Then I add a function which I want to use to move the sky movieClip:

public function moveSky() {
trace(sky.x);
}


When I trace the position of the sky (sky.x) I get an 1120 error:

1120: Access of undefined property sky.

Why am I getting that error?

I actually want to translate the sky across the screen, but I was surprised when I couldn't access the movieClip's x value.

Access Of Undefined Property External_txt.
This is the code I've acumulated so far for my animated scrolled text, the only problem is that since I turned my dynamic text field into a movie clip, I'm getting 2 errors that I can't seem to fix (please excuse my newBness). 1120: Access of undefined property external_txt.

CS4 Flash Access Of Undefined Property ...
cs4 flash don't compile cs3 code.

I get 35 errors Access of undefined property and Attempted access of inaccessible property.
What difference in lang?
Where I can read about?





























Edited: 10/17/2008 at 01:13:47 PM by john07.ru

1120: Access Of Undefined Property
I get this message: 1120: Access of undefined property shutterL. If comment out the trace statement "shutterL" appears onstage. What I need to do?

Here is the code:







Attach Code

package Scripts
{
import flash.display.Sprite;
import flash.events.MouseEvent;

public class DocumentClass extends Sprite
{
private var container:Sprite;

public function DocumentClass():void
{
init();
initContent();
}

private function init():void
{
container = new Sprite();
container.x = 0;
container.y = 0;
addChild(container);
}

private function initContent():void
{
var shutterL:ShutterLeft = new ShutterLeft();
shutterL.x = 75;
shutterL.y = 75;
shutterL.buttonMode = true;
shutterL.addEventListener(MouseEvent.CLICK, onClick);
container.addChild(shutterL);
}

private function onClick(e:MouseEvent):void
{
trace(shutterL.x);
}
}
}

Access Of Undefined Property Error?
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.

from the following code:
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);

}

Access Of Possibly Undefined Property
In the document class of my flash file, a variable is declared called "firstSound". I'm trying to access this variable inside a movieclip sitting on the main timeline. However, I get an error when I try this:

trace(MovieClip(root).firstSound);

Error: 1119: Access of possibly undefined property firstSound through a reference with static type flash.display.DisplayObjectContainer.

Why am I getting this error?

Access Of Undefined Property Instance1
if i create a new sprite/ or a movieclip and then add it to the stage:

var someName:Sprite = new Sprite();
addChild(someName);

that sprite/moviclip is going to have some instance name like "instance1"

i can see that with trace:
trace(someName.name);

but if i then say:
instance1.x = 100;

i wil get an error: "Access of undefined property instance1"

i know i can say:
someName.x = 100;

but why cant i get to it through its instance name, or can i somehow?
and what is the point of that instance name then?

the reason i am asking is if i have multiple sprites with the same name, but different instance names how could i get to each of them in that case?

Access Of Undefined Property From A Class
PHP Code:



package {    import flash.display.MovieClip;    import flash.events.Event;    public class DumbClass extends MovieClip {            var dumbXS:Number = 0;        var dumbYS:Number = 0;        var dumbACC:Number = 0.6;        var dumbDEC:Number = 0.92;                public function DumbClass() {            this.addEventListener(Event.ENTER_FRAME, DumbMove);        }        public function DumbMove(evt:Event):void {            //Increases Speed            this.x += dumbXS;            this.y += dumbYS;            //Reference to a MovieClip on stage called "user".            if (user.y < this.y) {                dumbYS -= dumbACC;            }            //Reference to a MovieClip on stage called "user".            if (user.y > this.y) {                dumbYS += dumbACC;            }            //Reference to a MovieClip on stage called "user".            if (user.x < this.x) {                dumbXS -= dumbACC;            }            //Reference to a MovieClip on stage called "user".            if (user.x > this.x) {                dumbXS += dumbACC;            }            ///Decrease Speed            dumbYS *= dumbDEC;            dumbXS *= dumbDEC;        }    }} 




I get an error that "user" is an undefined property even though its on the stage any ideas how I can fix this?

1120: Access Of Undefined Property?
For some reason I keep getting these errors:



**Error** Scene 1, Layer 'actions', Frame 1, Line 82: 1120: Access of undefined property Tweener.
Tweener.addTween(barBg_mc, {alpha:1, time:3});

**Error** Scene 1, Layer 'actions', Frame 1, Line 87: 1120: Access of undefined property Tweener.
Tweener.addTween(barBg_mc, {alpha:0, time:3});

Total ActionScript Errors: 2, Reported Errors: 2



Here is my code


Code:
import caurina.transitions.*;

var conn:NetConnection = new NetConnection();
conn.connect(null);

var stream:NetStream = new NetStream(conn);
stream.play("/res_hi/2519-20019-2.mp4");
var metaListener:Object = new Object();
metaListener.onMetaData = theMeta;
stream.client = metaListener;

var st:SoundTransform = new SoundTransform();
stream.soundTransform = st;

var video:Video = new Video();
video.attachNetStream(stream);
video.width = 640;
video.height = 360;
video.x = 70;
video.y = 0;
video_mc.addChild(video);

barBg_mc.thumb_mc.mouseEnabled = false;
barBg_mc.thumb_mc.alpha = 0;
barBg_mc.track_mc.buttonMode = true;
barBg_mc.speaker_mc.buttonMode = true;
barBg_mc.toggle_mc.buttonMode = true;
bigPlay_mc.buttonMode = true;
barBg_mc.volScrubber_mc.volThumb_mc.buttonMode = true;

stage.addEventListener(Event.ENTER_FRAME, enterFrame);
stage.addEventListener(MouseEvent.MOUSE_OVER, getInterface);
stage.addEventListener(MouseEvent.MOUSE_OUT, removeInterface);
barBg_mc.speaker_mc.addEventListener(MouseEvent.CLICK, mute);
barBg_mc.speaker_mc.addEventListener(MouseEvent.MOUSE_OVER, rollOnSpeaker);
barBg_mc.speaker_mc.addEventListener(MouseEvent.MOUSE_OUT, rollOffSpeaker);
barBg_mc.toggle_mc.addEventListener(MouseEvent.CLICK, pause);
barBg_mc.toggle_mc.addEventListener(MouseEvent.MOUSE_OVER, rollOnToggle);
barBg_mc.toggle_mc.addEventListener(MouseEvent.MOUSE_OUT, rollOffToggle);
bigPlay_mc.addEventListener(MouseEvent.CLICK, pause);
barBg_mc.track_mc.addEventListener(MouseEvent.MOUSE_OVER, trackOver);
barBg_mc.track_mc.addEventListener(MouseEvent.MOUSE_OUT, trackOut);
barBg_mc.track_mc.addEventListener(MouseEvent.CLICK, goToSecond);
barBg_mc.track_mc.addEventListener(MouseEvent.MOUSE_DOWN, trackDown);
barBg_mc.track_mc.addEventListener(MouseEvent.MOUSE_UP, trackUp);
barBg_mc.volScrubber_mc.volThumb_mc.addEventListener(MouseEvent.MOUSE_DOWN, volDown);
stage.addEventListener(MouseEvent.MOUSE_UP, volUp);

var xOffset:Number;
var xMin:Number = 13;
var xMax:Number = 309;
var volOffset:Number;
var volxMin:Number = 0;
var volxMax:Number = barBg_mc.volScrubber_mc.volTrack_mc.width - 7;
var volPercent:Number;
var totalLength:uint;

function theMeta(data:Object):void
{
totalLength = data.duration;
}

function enterFrame(e:Event):void
{
var nowSecs:Number = Math.floor(stream.time);
var totalSecs:Number = Math.round(totalLength);
if(nowSecs > 0)
{
barBg_mc.timerText.text = videoTimeConvert(nowSecs) + " / " + videoTimeConvert(totalSecs);
var amountPlayed:Number = stream.time / totalLength;
var amountLoaded:Number = stream.bytesLoaded / stream.bytesTotal;
barBg_mc.playStatus_mc.x = 46;
barBg_mc.playStatus_mc.width = 294 * amountPlayed - 1;
barBg_mc.dlStatus_mc.x = 46;
barBg_mc.dlStatus_mc.width = 294 * amountLoaded + 3;
}
}

function getInterface(e:MouseEvent):void
{
if(mouseX > 70 && mouseX < 710 && mouseY > 0 && mouseY < 360)
Tweener.addTween(barBg_mc, {alpha:1, time:3});
}

function removeInterface(e:MouseEvent):void
{
Tweener.addTween(barBg_mc, {alpha:0, time:3});
}

function trackOver(e:MouseEvent):void
{
stage.addEventListener(MouseEvent.MOUSE_MOVE, startFollow);
xOffset = mouseX - barBg_mc.thumb_mc.x;
}

function trackOut(e:MouseEvent):void
{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, startFollow);
barBg_mc.thumb_mc.alpha = 0;
}

function startFollow(e:MouseEvent):void
{
barBg_mc.thumb_mc.alpha = 1;
barBg_mc.thumb_mc.x = barBg_mc.mouseX - (barBg_mc.thumb_mc.width / 2) + 2;
if(barBg_mc.thumb_mc.x <= xMin)
barBg_mc.thumb_mc.x = xMin;
if(barBg_mc.thumb_mc.x >= xMax)
barBg_mc.thumb_mc.x = xMax;
stage.addEventListener(Event.ENTER_FRAME, getTimeText);
e.updateAfterEvent();
}

function getTimeText(e:Event):void
{
var percentAcross:Number = (barBg_mc.thumb_mc.x - 12) / barBg_mc.track_mc.width;
barBg_mc.thumb_mc.trackTime_mc.text = videoTimeConvert(totalLength * percentAcross);
}

function goToSecond(e:MouseEvent):void
{
if(barBg_mc.track_mc.mouseX < barBg_mc.dlStatus_mc.width)
{
var percentAcross:Number = (barBg_mc.thumb_mc.x - 12) / barBg_mc.track_mc.width;
stream.seek(totalLength * percentAcross);
}
}

function trackDown(e:MouseEvent):void
{
stage.addEventListener(MouseEvent.MOUSE_MOVE, scrubTo);
xOffset = mouseX - barBg_mc.thumb_mc.x;
}

function trackUp(e:MouseEvent):void
{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, scrubTo);
}

function scrubTo(e:MouseEvent):void
{
if(barBg_mc.track_mc.mouseX < barBg_mc.dlStatus_mc.width)
{
var percentAcross:Number = (barBg_mc.thumb_mc.x - 12) / barBg_mc.track_mc.width;
stream.seek(totalLength * percentAcross);
}
}

function pause(e:MouseEvent):void
{
stream.togglePause();
if(barBg_mc.toggle_mc.currentFrame == 1)
{
bigPlay_mc.alpha = 1;
barBg_mc.toggle_mc.gotoAndStop(2);
}
else
{
bigPlay_mc.alpha = 0;
barBg_mc.toggle_mc.gotoAndStop(1);
}
}

function rollOnToggle(e:MouseEvent):void
{
barBg_mc.toggle_mc.alpha = .5;
}

function rollOffToggle(e:MouseEvent):void
{
barBg_mc.toggle_mc.alpha = 1;
}

function mute(e:MouseEvent):void
{
if(barBg_mc.speaker_mc.currentFrame == 1)
{
st.volume = 0;
stream.soundTransform = st;
barBg_mc.speaker_mc.gotoAndStop(2);
}
else
{
st.volume = volPercent;
stream.soundTransform = st;
barBg_mc.speaker_mc.gotoAndStop(1);
}
}

function rollOnSpeaker(e:MouseEvent):void
{
barBg_mc.speaker_mc.alpha = .5;
}

function rollOffSpeaker(e:MouseEvent):void
{
barBg_mc.speaker_mc.alpha = 1;
}

function volDown(e:MouseEvent):void
{
stage.addEventListener(MouseEvent.MOUSE_MOVE, volAdjust);
}

function volUp(e:MouseEvent):void
{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, volAdjust);
}

function volAdjust(e:MouseEvent):void
{
barBg_mc.volScrubber_mc.volThumb_mc.x = barBg_mc.volScrubber_mc.volTrack_mc.mouseX;
if(barBg_mc.volScrubber_mc.volThumb_mc.x <= volxMin)
barBg_mc.volScrubber_mc.volThumb_mc.x = volxMin;
if(barBg_mc.volScrubber_mc.volThumb_mc.x >= volxMax)
barBg_mc.volScrubber_mc.volThumb_mc.x = volxMax;
volPercent = barBg_mc.volScrubber_mc.volThumb_mc.x / volxMax;
if(barBg_mc.speaker_mc.currentFrame == 1)
st.volume = volPercent;
stream.soundTransform = st;
e.updateAfterEvent();
}

var displayHours:Boolean = true;

function videoTimeConvert(myTime):String
{
var tempNum = myTime;
var minutes = Math.floor(tempNum / 60);

if (displayHours)
{
var hours = Math.floor(minutes / 60);
}
var seconds = Math.round(tempNum - (minutes * 60));

if (seconds < 10)
{
seconds = "0" + seconds;
}
if (minutes < 10)
{
minutes = "0" + minutes;
}

if (displayHours)
{
if (hours < 10)
{
hours = "0" + hours;
}
}

var currentTimeConverted = hours + ":" + minutes + ":" + seconds;

return currentTimeConverted;
}

1120: Access Of Undefined Property
I have a question about defining movie clips and buttons. In AS2 - there was never any problem, because I put the associated actions right on the object. The problem I'm having with AS3 is that the button or movie clip has to be on the stage at the same time that I define it in actionscript.

So if I have a button that is on keyframe 15 - I cannot add a listener event to it on the first frame. Is there any way around this so I can keep all my button definitions in one place, regardless of where the actual buttons and movieclips are in the movie?

Access Of Undefined Property. Work.addEventListener
Hello Guys,

I am hoping someone can help me, as i have been trying to get this to work for the last four hours.

I am trying to create button that links to URL address with AS3.0 This is the code I am using:


Code:
work.addEventListener(MouseEvent.CLICK, callLink);
function callLink():void {
var url:String = "http://www.hologramdesigns.com";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, '_self');
} catch (e:Error) {
trace("Error occurred!");
}
}


However, I am retrieving this error on running.

1120: Access of undefined property work. work.addEventListener(MouseEvent.CLICK, callLink);

I have attached the .fla file if anyone can assist me with where I am going wrong it would be much appreciated.

[CS3] Access Of Undefined Property WareBtn Error?
Hi there,

New to Flash and trying to figure out why I'm getting this error.

I have a movie clip called buttons on the stage and inside that I have two buttons that animate over time in and out. I'm guessing this error is because I have the actions in my main timeline and not in the buttons movie clip?! However when I put the actions in the movie clip I get this error:

Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at 2_test3_fla::buttons_4/2_test3_fla::frame2()
Here's my actionscript:



Code:
wareBtn.addEventListener(MouseEvent.CLICK, getMyUrlWare);

function getMyUrlWare(event: MouseEvent):void
{
var request:URLRequest = new URLRequest("http://www.blah.com/warehousing.html");
navigateToURL(request, "_self");
}



airBtn.addEventListener(MouseEvent.CLICK, getMyUrlAir);

function getMyUrlAir(event: MouseEvent):void
{
var request:URLRequest = new URLRequest("http://www.blah.com/air.html");
navigateToURL(request, "_self");
}
Oh and I have made sure all the buttons keyframes have the correct name e.g "wareBtn"

Any help would be much appreciated...

Thanks.
J

1120: Access Of Undefined Property ComboBoxCellLoader
I'm placing a combobox inside of a datagrid. I modified Actionscript 2.0 code to Actionscript 3.0 code. I've fixed all the syntax errors but now I get the following error:

1120: Access of undefined property ComboBoxCellLoader.


I'm having a hardtime figuring out what is missing.

Here is my code that calls ComboBoxCellLoader:


Code:
Some code here!
...
var sizeCol:DataGridColumn = new DataGridColumn("size");
sizeCol.cellRenderer = ComboBoxCellLoader;
sizeCol.headerText = "Size";
sizeCol.width = col2WidthLayout;
pList_dg.addColumn(sizeCol);
...

Some more code here!
now here is the code for ComboBoxCellLoader:


Code:
package {
import fl.core.UIComponent;
import fl.controls.ComboBox;
import fl.controls.DataGrid;
import flash.display.MovieClip;
import flash.events.Event;
import fl.controls.listClasses.CellRenderer;

class ComboBoxCellLoader extends UIComponent
{

private var combo : MovieClip;
private var owner;// The row that contains the cell.
private var listOwner : DataGrid;// The reference of the list type component that contains this cell.
private var getCellIndex : Function;// A function we receive from the parent list (in this case a DataGrid).
private var getDataLabel : Function;// A function we receive from the parent list (in this case a DataGrid).

/*private static var PREFERRED_HEIGHT_OFFSET = 4; */// The preferred offset height of the cell containing the ComboBox.
private static var PREFERRED_WIDTH = 75; // 100 The preferred width of the cell containing the Combobox.
private static var COMBOBOX_HEIGHT = 20;// The height of the ComboBox.
private static var COMBOBOX_WIDTH_OFFSET = 10; //10 Amount of space we will add between the ComboBox and its cell so it looks better.
private var startDepth:Number = 10;


// Array of label/data pairs that define the ComboBox data provider.
private static var COMBOBOX_DATA_PROVIDER : Array = [{label: "", data: 0},
{label: "Large", data: 1},
{label: "Small", data: 2}];
// Constructor: Should be empty.
public function ComboBoxCell()
{
}

//Creates a ComboBox object and sets listeners.
public function createChildren() : void
{
combo = createObject("ComboBox", "Combo", startDepth++);

// Assign the data provider.
combo.dataProvider = COMBOBOX_DATA_PROVIDER;


combo.addEventListener(ComboBoxEvent.change, changeEvent);
combo.addEventListener(ComboBoxEvent.open, openEvent);
}

public function size() : void
{
/* Set the size and location of the ComboBox.
Note: setSize() is already implemented by UIComponent
which this class extends. UI component in turn expects this class
to implement size(). */
combo.setSize(__width, COMBOBOX_HEIGHT);
combo.setStyle("fontSize",12);
combo.setStyle("fontFamily" , "Arial");


}

public function setValue(str:String, item:Object, sel:Boolean) : void
{
/* Sets the ComboBox to the correspoinding cell data from the list owner's data provider if the cell data matches
with any items available for the ComboBox. */

var drawCombo:Boolean = true;
if (item[getDataLabel()]!=undefined)
{
/* For each item's data in the ComboBox, verify if it matches
the assigned data for the cell this ComboBox is in.
Set the selectedIndex of the ComboBox to what matches. */
for(var i:Number = 0; i < combo.length; i++)
{
if( combo.getItemAt(i).data == item[getDataLabel()] )
{
combo.selectedIndex = i;
break;
}
if ( i == combo.length - 1 )
{
// There was no matching data, the ComboBox should not be shown.
drawCombo = false;
}
}
}
else
{
drawCombo = false; // There was no data, hide the ComboBox.
}

combo._visible = drawCombo;
}

public function onLoad()
{
}

public function openEvent()
{
/* Handler for the open event sent by the ComboBox when
it has been clicked and opened to show its selectable items.
Tell the Datagrid that the cell containing the ComboBox
should be considered selected so that in turn the DataGrid
updates the entire row in a selected visual state. */

listOwner.selectedIndex = getCellIndex().itemIndex;
}

public function changeEvent()
{
// Handler for the ComboBox change event.

// Set the listOwner's data to the currently selected item's data of the combo box.
listOwner.dataProvider.editField(getCellIndex().itemIndex, getDataLabel(), combo.selectedItem.data);
}

public function getPreferredHeight(Void) : Number
{
/* The cell is given a property, "owner",
that references the row. It’s always preferred
that the cell take up most of the row's height. */
return owner.__height;
}

}
}
Thanks for the help in advance!!!
Monica

1120: Access Of Undefined Property Movieclip_mc
Hello,

I have a function that creates a movieclip and places a SWF in it with addChild. Now i have a button that calls a function, this function should remove the movieclip i just created. I tried to remove the movieclip with removeChild, but when I use removeChild and I start the SWF he gives an error:

'1120: Access of undefined property loadgame_mc.'

Now this got me thinking, maybe i have to check if the movieclip exists first.. so i tried this piece of code:


Code:
if(loadgame_mc){
removeChild(loadgame_mc);
}
But then it generates the error twice.. So my question is:

Does some1 know how i can add and remove a movieclip without getting these errors

Greets,

Lukie

1120: Access Of Undefined Property Error
Hwo do you send a string from a class file to an already existing textfield on the main timeline/stage?

I keep getting:
1120: Access of undefined property main_txt.

1120 Access Of Undefined Property Event
Hi. I am extremely new to Flash CS3 and am having problems with scripting.
Using a lesson(10) from CIB as a template, I have copied the end result in hopes of creating my own modular script, while putting in my own animations in the layers, etc. The final swf on the CIB CD has a preloader animation that runs with the loaded % until the main movie has loaded and then plays.

When I try to run my version, the compiler errors shows:
1120 Access of undefined property event
var loadedPercent:int = event.bytesLoaded / event.bytesTotal *100;

Yet, this is how the script was written in the lesson, and it will load and play correctly when I run it (even though it's output window says:
Error#2044:UnhandledError Event:. text = Error #2036:Load Never Completed.

In the mean time, my own version of the file, when run, will display my
preloader animation over and over, and the 0% loaded.

Thanks for "listening".
I will give you the entire script if you need it in order to help me.
Gratefully,
silverGrl

1120 Access Of Undefined Property MouseEvent
In a Fla file i have the following simple script


ActionScript Code:
var slides:Array = new Array("1",
                             "10",
                             "20"
                             )

pbtn.addEventListener(MouseEvent.CLICK, PrintMovie(slides));



stop();

right!? awesome! ok then why the F?! is flash spitting out the error:
1120 Access of undefined property MouseEvent sourcebtn.addEventListener(MouseEvent.CLICK, PrintMovie(slides));


I hate CS3!!!!

1120: Access Of Undefined Property Dragons_btn. In AS3
Hi I have tried to scale this up a little bit and did some actionscript 3 but I was wondering do you have a understanding of what this means please? Iam trying to link my buttons one works then when I tried to add more I get this error.


1120: Access of undefined property Dragons_btn.

[Actionscript Code:]
stop();
Home_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler1);
function mouseDownHandler1(event:MouseEvent):void {
navigateToURL(new URLRequest("home.swf"));
}
Dragons_btn.addEventListener(MouseEvent.MOUSE_DOWN , mouseDownHandler2);
function mouseDownHandler2(event:MouseEvent):void {
navigateToURL(new URLRequest(""));
}
[/Actionscript Code:]

Error 1120: Access Of Undefined Property
Hi-
I'm new to Flash and am trying to do a simple assignment. I need a button to control a movie clip. My button is called "btn" and movie clip is called "corn." This is my script so far....


btn.addEventListener(MouseEvent.ROLL_OVER, onOver);
function onOver(evt:MouseEvent):void {
corn.scaleX = 2;
}

and this is my error message: 1120: Access of undefined property corn.

Access Of Undefined Property. Work.addEventListener
Hello Guys,

I am new to Action Scripting 3.0 - and I am having difficulty getting a button to open a URL.

I have created an invisible button called work (hoping that it would) and this is the action scripting I have created.


ActionScript Code:
work.addEventListener(MouseEvent.CLICK, callLink);
function callLink():void {
  var url:String = "http://www.hologramdesigns.com";
  var request:URLRequest = new URLRequest(url);
  try {
    navigateToURL(request, '_self');
  } catch (e:Error) {
    trace("Error occurred!");
  }
}

When I run/publish this script flash reports back this error. 1120: Access of undefined property work. work.addEventListener(MouseEvent.CLICK, callLink);

I hope someone can help.

ERROR 1120: Access Of Undefined Property
As you can probably tell i am very new to actionscript! i have done a very basic bit of code and am trying to get a small navigation bar to work! JUST 1 BUTTON !

there are no errors when i type it in the actions pannel, however when it comes to publishing it, the error 1120 comes up!

1120: Access of undefined property master_mc.

1119: Access Of Possibly Undefined Property (HELP)
Hello All,
I have created a shape called canvas
var canvas:Shape = new Shape();

And in a method called 'init' I position the shape by assigning value to .x and .y of the shape.

function init():void {
canvas.x = drawingBoard.x;
canvas.y = drawingBoard.y;
addChild(canvas);
. <Some other code>
.
.</Some other code>
}

I am very very sure that shape has .x and .y properties, but I keep getting these errors

1119: Access of possibly undefined property x through a reference with static type Class.
1119: Access of possibly undefined property y through a reference with static type Class.

I have imported "flash.display.Shape;" , so that isn't the problem. Where am I wrong? PLEASE help me. I have been pondering over this for a real long time.

Thanks!

~Arvind

1120: Access Of Undefined Property OnMouseDown.
1120: Access of undefined property onMouseDown.

may i know what the kind of problem for my coding...


var phrase_string:String="To emerge as a killis training and education institute of international repute.";
var n:Number=phrase_string.length;
var i:Number=0;
stage.addEventListener('mouseDown', onMouseDown );

this.onEnterFrame=function(){
if (i<n){
display_txt.text+=phrase_string.substr(i,1);
i+=1;
}
}

1120: Access Of Undefined Property OLvidMC.
Actionscript 3.0 going over my head here. Need some help please. It's probably really simple.

I have a floorplan that I'm trying to make interactive with videos and dossiers and maybe some 360 virtual tours. Now I have the floorplan layed out and when someone clicks on a room I have it jumping to a frame with an movie clip and everything else embedded in there. Currently I've only gotten as far as open lab. I got it to jump to the right frame and play the movieclip but I can't get the buttons that come up after the video plays to work. They are supposed to play another video and jump back to the questions.

I get the above error for each question(button):
1120: Access of undefined property OLvidMC.
OLvidMC.OLq1.addEventListener(MouseEvent.CLICK,lau nchOLq1);

I added the OLvidMC because I thought it might need a reference but i get the error on the OLvidMC instead of the OLq1.

fla is here cuz it's 36kb too big to upload.. If anyone can help it's greatly appreciated.

1120:access Of Undefined Property Andia.
hi every body,
i am a new learner!!!
well to day i was doing the simple exercises of action script 3. but i am blocked!!!!!
i made a movie clip, named it andia, i brought it on the stage and named its instance andia too, then i opened action window and wrote:
andia.gotoAndStop(10);
but it gives me error:
1120:access of undefined property andia.
what does it mean? the movie clip and the istance both have name...!!!
andia

1120: Access Of Undefined Property TheUserAnswer
Heyz guys,

I am in page 4 of the tutorial, where I add the first question and then I've got to check the .fla file. When I do this, I get 4 errors in lines 39, 36, 49 and 55. The first 2 are about "1120: Access of undefined property choices" and the last 2 are about: "1120: Access of undefined property theUserAnswer".

Thinkinh that there must be probably some errors in the code I copied and pasted the code from the tutorial but I got the same errors. Then I c/p the whole code but still got the errors at the same lines!

I have deleted the content of "Document Class" box in the file's properties as the tutorial was writing.

Any ideas please??

1120: Access Of Undefined Property Error
okay, this is probably a very silly question but i cant work out what im doing wrong.

my lecturer made a website and i was using the menu action script for mine obviously changing the names for the buttons to corrospond to my site. yet im getting the error '1120: Access of undefined property error'. my code is:

package {
import flash.events.*;
import flash.display.*;

public class Mainmenu extends MovieClip {

public function Mainmenu() {
// Event Setup.
Gallery_home_btn.addEventListener(MouseEvent.CLICK ,navigationClicked);
Biography_home_btn.addEventListener(MouseEvent.CLI CK,navigationClicked);
Credits_home_btn.addEventListener(MouseEvent.CLICK ,navigationClicked);
Contacts_home_btn.addEventListener(MouseEvent.CLIC K,navigationClicked);

}

// Event Handlers.
private function navigationClicked(Event:MouseEvent):void {
var frmLabel:String='';
switch (Event.target) {
case Gallery_home_btn:
frmLabel="Gallery_frm";
break;
case Biography_home_btn:
frmLabel="Biography_frm";
break;
case Credits_home_btn:
frmLabel="Credits_frm";
break;
case Contacts_home_btn:
frmLabel="Contact_frm";
break;

}
//portfolio(root).gotoFrame(frmLabel);
MovieClip(root).gotoFrame(frmLabel);
}
}
}

can you please explain to me why i am getting that error.

thanks in advance

Access Of Undefined Property Error ... But, A Weird One.
So, I'm working on this website, and I've got 15 "popups" that come from buttons. When I try to debug this thing, it tells me that one of the 15 isn't defined, but it absolutely is, at least, in the same way that all the others are.

This is the error message:

1120: Access of undefined property ours_cd_popup_mc.

Copyright © 2005-08 www.BigResource.com, All rights reserved