Undefined property?

I have a slideshow app that I want to go to certain frames when a thumbnails button  is clicked. I get this error
1119: Access of possibly undefined property targetPic through a reference with static type flash.display:SimpleButton.
here is my inexperienced actionscript
stop();
var numFrames:Number = 14;
tmb1_btn.targetPic = 1;
tmb2_btn.targetPic = 2;
right_btn.addEventListener(MouseEvent.CLICK, nextPic);
left_btn.addEventListener(MouseEvent.CLICK,  prevPic);
tmb1_btn.addEventListener(MouseEvent.CLICK,  picFrame);
function nextPic(e:MouseEvent):void
if (currentFrame < numFrames)
  nextFrame();
else
  gotoAndStop(1);
function prevPic(e:MouseEvent):void
if (currentFrame > 1)
  prevFrame();
else
  gotoAndStop(numFrames);
function picFrame(e:MouseEvent):void
   gotoAndStop(e.currentTarget.targetPic);
thanks for your time

the simple button class won't allow you to add new properties like targetPic.  use a movieclip button.

Similar Messages

  • I am getting an error while coding between CS5 and Flash CC specifically: Access of undefined property instrument_txt. I am using a book that is made for CS5. Is there a current book or resources for Actionscript 3.0 and Flash CC?

    Scene 1, Layer 'actions', Frame 1, Line 47, Column 2
    1120: Access of undefined property instrument_txt.
    this is my problem. any ideas. thanks

    I did try this and nothing happened, same error codes. The code works fine from CS5 and CS6 Flash versions. The animation runs well, the text displays where it should in the instrument_txt frame. It is when I try this in Flash CC that it creates the code error. here was an error that came up regarding text problems, something with FLT text converted to another text (I am not sure of the name of the text-type and the "FLT" I am not sure of either).
    thanks

  • Access of undefined property _btn (problems with all my buttons)

    I keep getting this error:
    Scene 1, Layer 'actionscript', Frame 1, Line 1
    1120: Access of undefined property tennis1_btn.
    Scene 1, Layer 'actionscript', Frame 1, Line 7
    1120: Access of undefined property tennis2_btn.
    Scene 1, Layer 'actionscript', Frame 1, Line 13
    1120: Access of undefined property tennis3_btn.
    Scene 1, Layer 'actionscript', Frame 1, Line 19
    1120: Access of undefined property tennis4_btn.
    Scene 1, Layer 'actionscript', Frame 1, Line 25
    1120: Access of undefined property tennis5_btn.
    Scene 1, Layer 'actionscript', Frame 1, Line 31
    1120: Access of undefined property tennis6_btn.
    Here is a screen print of my code
    I'll also paste below:
    tennis1_btn.addEventListener(MouseEvent.CLICK, gotennis1);
    function gotennis1(event:MouseEvent):void {
              var gotennis1url:URLRequest= new URLRequest ("juniortennis.php");
              navigateToURL(gotennis1url,"_parent");
    tennis2_btn.addEventListener(MouseEvent.CLICK, gotennis2);
    function gotennis2(event:MouseEvent):void {
              var gotennis2url:URLRequest= new URLRequest ("adulttennis.php");
              navigateToURL(gotennis2url,"_parent");
    tennis3_btn.addEventListener(MouseEvent.CLICK, gotennis3);
    function gotennis3(event:MouseEvent):void {
              var gotennis3url:URLRequest= new URLRequest ("http://abbottsports.com/membership/memberships.php#tennis");
              navigateToURL(gotennis3url,"_parent");
    tennis4_btn.addEventListener(MouseEvent.CLICK, gotennis4);
    function gotennis4(event:MouseEvent):void {
              var gotennis4url:URLRequest= new URLRequest ("staff.php");
              navigateToURL(gotennis4url,"_parent");
    tennis5_btn.addEventListener(MouseEvent.CLICK, gotennis5);
    function gotennis5(event:MouseEvent):void {
              var gotennis5url:URLRequest= new URLRequest ("calendar.php");
              navigateToURL(gotennis5url,"_parent");
    tennis6_btn.addEventListener(MouseEvent.CLICK, gotennis6);
    function gotennis6(event:MouseEvent):void {
              var gotennis6url:URLRequest= new URLRequest ("tenniscourts.php");
              navigateToURL(gotennis6url,"_parent");
    Please help:  i have a couple of them types of menus but this is the only one that is giving me problems.  Here is the website I'm using them on:
    www.abbottsports.com  Working
    http://abbottsports.com/football/football.php Working
    http://abbottsports.com/motocross/motocross.php working
    I was adding another on to our tennis page. I just copied the flash files to my tennis folders and renamed everything tennis instead of football including the buttons like you can see on the right side of the page in the photo.
    I'm pretty sure it has something to do with me renaming the button, because I never changed anything in the code except replacing the word football to tennis in every spot. and renamed my buttons to tennis instead of football.
    Thanks for any assistance.

    yeah they are all named right.
    tennis1_btn
    tennis2_btn
    tennis3_btn
    tennis4_btn
    tennis5_btn
    tennis6_btn
    I uploaded it here:
    http://abbottsports.com/tennis/flash/tennismenu.swf
    http://abbottsports.com/tennis/flash/tennismenu.fla
    http://abbottsports.com/tennis/flash/tennismenu.html

  • Access of possibly undefined property number through a reference with static type...

    Hello everyone !
    I run into this problem today ... take a look on the code :
    import com.trick7.effects.TeraFire;
    for (var j:uint=0; j<10; j++) {
        var fire:TeraFire = new TeraFire();
        fire.x = j * 40 + 20;
        fire.y = 100;
        fire.number = j; //This line is causeing the problem
        addChild(fire);
        fire.buttonMode = true;
    TeraFire class creates fire particles. The compiler error is :
    Scene 1, Layer 'Layer 1', Frame 1, Line 7
    1119: Access of possibly undefined property number through a reference with static type com.trick7.effects:TeraFire.
    Anyone can help me to find a solution to this problem.
    I can do that ".number" with a movieclip but not in this case. What can I do ?

    I borrowed that class from the internet.
    I made the changes you suggested: imported flash.Display.MovieClip and also made the class extend MovieClip.
    The error is still throwing in compiler errors. I am not really good enough to edit this class because there are some functions I don't still understand very good. This is the class below:
    package com.trick7.effects{
        import flash.display.BitmapData;
        import flash.display.GradientType;
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.filters.DisplacementMapFilter;
        import flash.filters.DisplacementMapFilterMode;
        import flash.geom.Matrix;
        import flash.geom.Point;
        import flash.geom.Rectangle;
        public class TeraFire extends MovieClip{
            public var phaseRateX:Number;
            public var phaseRateY:Number;
            private var offsets:Array= [new Point(),new Point()];
            private var seed:Number = Math.random();
            private var fireW:Number;
            private var fireH:Number;
            //火の色
            //private var fireColorIn:uint;
            //private var fireColorOut:uint;
            private var ball:Sprite;
            private var gradientImage:BitmapData;
            private var displaceImage:BitmapData;
            private var focalPointRatio:Number = 0.6;
            private const margin:int = 10;
            private var rdm:Number;
            public function TeraFire(xPos:Number=0, yPos:Number=0, fireWidth:Number=30, fireHeight:Number=90, fireColorIn:uint = 0xFFCC00,fireColorOut:uint = 0xE22D09){
                fireW = fireWidth;
                fireH = fireHeight;
                phaseRateX = 0;
                phaseRateY = 5;
                var matrix:Matrix = new Matrix();
                matrix.createGradientBox(fireW,fireH,Math.PI/2,-fireW/2,-fireH*(focalPointRatio+1)/2);
                var colors:Array = [fireColorIn, fireColorOut, fireColorOut];
                var alphas:Array = [1,1,0];
                var ratios:Array = [30, 100, 220];
                var home:Sprite = new Sprite();
                ball = new Sprite();
                ball.graphics.beginGradientFill(GradientType.RADIAL,colors, alphas, ratios, matrix,"pad","rgb",focalPointRatio);
                ball.graphics.drawEllipse(-fireW/2,-fireH*(focalPointRatio+1)/2,fireW,fireH);
                ball.graphics.endFill();
                //余白確保用透明矩形
                ball.graphics.beginFill(0x000000,0);
                ball.graphics.drawRect(-fireW/2,0,fireW+margin,1);
                ball.graphics.endFill();
                addChild(home);
                home.addChild(ball);
                this.x = xPos;
                this.y = yPos;
                addEventListener(Event.ENTER_FRAME,loop);
                displaceImage = new BitmapData(fireW+margin,fireH,false,0xFFFFFFFF);
                var matrix2:Matrix = new Matrix();
                matrix2.createGradientBox(fireW+margin,fireH,Math.PI/2,0,0);
                var gradient_mc:Sprite = new Sprite;
                gradient_mc.graphics.beginGradientFill(GradientType.LINEAR,[0x666666,0x666666], [0,1], [120,220], matrix2);
                gradient_mc.graphics.drawRect(0,0,fireW+margin,fireH);//drawのターゲットなので生成位置にこだわる必要はない。
                gradient_mc.graphics.endFill();
                gradientImage = new BitmapData(fireW+margin,fireH,true,0x00FFFFFF);
                gradientImage.draw(gradient_mc);//gradient_mcを消す必要は?
                rdm = Math.floor(Math.random()*10);
            private function loop(e:Event):void{
                for(var i:int = 0; i < 2; ++i){
                    offsets[i].x += phaseRateX;
                    offsets[i].y += phaseRateY;
                displaceImage.perlinNoise(30+rdm, 60+rdm, 2, seed, false, false, 7, true, offsets);
                displaceImage.copyPixels(gradientImage,gradientImage.rect,new Point(),null, null, true);
                var dMap:DisplacementMapFilter = new DisplacementMapFilter(displaceImage, new Point(), 1, 1, 20, 10, DisplacementMapFilterMode.CLAMP);
                ball.filters = [dMap];
    I you can clarify a little bit further I would appreciate it a lot because I wasted some good time on this.

  • Simple question (Trace issue) Access of undefined property

    Having a strange issue with my new Flash Builder and the trace command. Anyone seen this before and why?
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
         <fx:Declarations>
               <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
    <fx:Script>
         <![CDATA[
              var myString:String = "Help";
              trace(myString);
              //Error 1120: Access of undefined property myString.
         ]]>
    </fx:Script>
    </s:Application>

    your trace command isn't in a function
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"          
                   xmlns:s="library://ns.adobe.com/flex/spark"          
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" applicationComplete="doThis()">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                private var myString:String = "Help";
                private function doThis():void
                    trace(myString);
            ]]>
        </fx:Script>
    </s:Application>

  • Undefined property when it does exist

    Can anyone help me grasp why this isn't working? I keep
    getting an 1120 error about the property, but i know that it
    exists. This is the HTTPService:
    <mx:HTTPService id="userupdate"
    url="https://server/flex/usrchgpwd.php"
    result="checkADMUsrPWD(event)" useProxy="false" method="POST"
    showBusyCursor="true">
    <mx:request xmlns="">
    <admtype>{admType.valueOf()}</admtype><username>{adm_username.text}</username><newpwd>{adm _password.text}</newpwd>
    <group>{adm_usergroup.text}</group><level>{adm_level.text}</level><status>{adm_activestatu s.text}</status>
    </mx:request>
    </mx:HTTPService>
    This is the AS function that is erroring out:
    private function checkADMUsrPWD(evt:ResultEvent):void {
    if(userupdate.lastResult.changesuccess == "nodb"){
    mx.controls.Alert.show("No DB connection, contact your
    administrator.");
    I get the error: "1120: Access of undefined property
    userupdate."
    I don't understand why. It's right there. And if I start
    typing userupdate and then put a period, it lists the availabe
    functions it will let me do. The other thing is that the script and
    app actually work properly, no problems at all. So I do not
    understand why it's throwing these errors.
    Any thoughts?
    Thanks,
    Chris

    Chris,
    I'm having the same issue, I'm about to shoot some one!
    He is my code.
    Application:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" >
    <mx:Script>
    <![CDATA[
    import dto.Example;
    [Bindable]
    public var tempExample:Example = new Example();
    tempExample._id = "test";
    ]]>
    </mx:Script>
    </mx:Application>
    Class Code:
    package dto
    public class Example{
    public var _id:String;
    public function Example(){
    I think it's a bug....

  • Getting the very lovely 1120: Access of undefined property...

    Hi Guys n Gals,
    I’m getting the "1120: Access of undefined property texttwo_mc." error I've done this code before and no issue.
    What I’m doing is simple, click a button and it will go to a movie clip within a movie clip to start the label named "_go", and this error accrued. The MC I’m calling is on the beginning of the timeline.
    Thanks
    BTW for some odd reason my SWF keeps deleting it self, thats on 2 differnt PC's ones CS5 and CS4.

    Hi Ned,
    Ok ill be as detailed as possible.:
    In the main stage I have a MC with a instance name of texttwo_mc, within that i have a mocvie clip "about button" that acts like a button and its on 5 on the timeline.
    The "about button" is not viable till timeline 5 but there's a stop on timeline 1 and it goes to timeline 5 (to make itself viable) when its told to in action scripting. And there's a button on the main stage that makes it go from 1 to 5 in action scripting.
    and thats where the eror is.
    BTW the "about button" is on timeline 1..just not viable till 5.

  • Mxmlc 3.6 Socket.timeout undefined property

    Hi,
    I decided to dive into and get dirty with Flex and ActionScript. Downloaded flex_sdk_3.6.0.16995A.zip from Adobe site, extracted it, added to my path and started coding away.
    I am trying to compile an ActionScript class with mxmlc in Linux (Ubuntu 10.04).
    In my class I use a socket, and I try to set the timeout property, however it gives me a compile error.
    Here is the class that's giving me the problem (I have left only the relevant code for clarity):
    package
      import flash.net.*
      import flash.events.*
       public class Socks4Sock
            private var sock: Socket;
            public function Socks4Sock(host:String, port:int):void
              sock = new Socket();
              sock.timeout = 5000;
    I get the following error during compilation:
    mxmlc Socks4Sock.as
    Loading configuration file /opt/flexsdk/frameworks/flex-config.xml
    /var/www/example/Socks4Sock.as(14): col: 16 Error: Access of possibly undefined property timeout through a reference with static type flash.net:Socket.
              sock.timeout = 5000;
    I am not sure what I am doing wrong. It seems according to the documentation, that timeout property is supported in AS3.
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/Socket.html#t imeout
    This is the mxmlc version I am using:
    mxmlc -version
    Version 3.6.0 build 16995
    Any help would be greatly appreciated!

    Thanks for the quick and consise reply. I tried that argument  and gave me "command line: Error: unknown configuration variable 'player-version'"
    Howerver, following up on the same idea, I searched and found out it's '-target-player'
    This is the argument I used:
    mxmlc -target-player=10 Socks4Sock.as
    That worked. Once again, thanks.

  • Error, please help? 1120: Access of undefined property event

    I have ActionScript 3 in two frames of my piece. In this 2nd frame, I get an error: "1120: Access of undefined property event" for "myXML=XML(event.target.data);" Can anyone help? I am not sure how to fix this.
    var myloader:URLLoader=new URLLoader();
    myloader.dataFormat=URLLoaderDataFormat.VARIABLES;
    myloader.addEventListener(Event.COMPLETE, guestBookWriteFunc);
    function guestBookWriteFunc(e:Event):void{
              var loader:URLLoader=URLLoader(e.target);
              var vars:URLVariables=new URLVariables(loader.data);
              var url:String="makexml.asp";
                   var sendloader:URLLoader=new URLLoader();
                   var request:URLRequest=new URLRequest(url);
                   trace("xml page created");
    var urlRequest:URLRequest=new URLRequest("makexml.asp");
    var urlLoader:URLLoader=new URLLoader();
    urlLoader.addEventListener(Event.COMPLETE, fileLoaded);
    urlLoader.load(urlRequest);
    //Setting up the XML
    var myXML:XML=new XML();
    myXML.ignoreWhitespace=true;
    var xmlList:XMLList;
    //Setting up the data holder Arrays
    var theUserName:Array=new Array();
    var theUserEmail:Array=new Array();
    var theUserComment:Array=new Array();
    function fileLoaded(e:Event):void{
         myXML=XML(event.target.data);
         xmlList=myXML.children();
         for (var i:int=0; i<xmlList.length(); i++){
              var xmlName:String=xmlList[i].username;
              var xmlEmail:String=xmlList[i].useremail;
              var xmlComment:String=xmlList[i].usercomment;
              theUserName.push(xmlName);
              theUserEmail.push(xmlEmail);
              theUserComment.push(xmlComment);
              if(i==xmlList.length()-1){
                   updateText();
    //Populating the text field to display messages
    var maximumMessages:Number=5;
    var currentMessages:Number=0;
    function updateText(){
         guestText.htmlText="";
         for (var i=currentMessages; i<maximumMessages; i++){
                   guestText.htmlText+=("<b><u>Name:</u></b>" + theUserName[i]);
                   guestText.htmlText+=("<b><u>Email:</u></b>" + theUserEmail[i]);
                   guestText.htmlText+=("<b><u>Comment:</u></b>" + theUserComment[i]);
                   guestText.htmlText+=(".................................");
                   currentMessages=i;
                   myScroller.scrollTarget=guestText;

    You are more likely to get a reply if you ask in the Flash or ActionScript forum.

  • 1119 Error help undefined property

    Here is my code:
    var gameSounds:Sound = new Sound(new URLRequest("inGame.mp3"));
    gameSounds.play();
    var gunShotSound:Sound = new Sound(new URLRequest("gunshot.mp3"));
    import flash.events.MouseEvent;
    import flash.display.MovieClip;
    import flash.geom.Point;
    stop();
    gunBarrel.addEventListener(Event.ENTER_FRAME,  gunEnterFrame);
    function gunEnterFrame(pEvt) {
        var mc = pEvt.currentTarget;
        var angleRadian = Math.atan2(mouseY - mc.y,mouseX - mc.x);
        var angleDegree = angleRadian * 180 / Math.PI;
        mc.rotation = angleDegree;
    Mouse.hide();
    main_crosshair.startDrag(true);
    main_crosshair.addEventListener(MouseEvent.MOUSE_DOWN, crosshairFX);
    function crosshairFX (e:MouseEvent):void{
              gunShotSound.play();
              var projectile:bullet = new bullet();
    //projectile.x = parent.mouseX;
    //          projectile.y = parent.mouseY;
              projectile.x = gunBarrel.x;
        projectile.y = gunBarrel.y;
        // Save the randian angle between the mouse and the tank
        // This angle will set the direction of the bullet
        projectile.angleRadian = Math.atan2(mouseY - gunBarrel.y, mouseX - gunBarrel.x);
        // Add an enter frame event on each bullet
        projectile.addEventListener(Event.ENTER_FRAME, bulletEnterFrame);
              addChild(projectile);
              main_crosshair.gotoAndPlay(3);
    // Velocity of each bullet
    var speed = 8;
    function bulletEnterFrame(pEvent) {
        // Get the current object (Bullet)
        var p = pEvent.currentTarget;
        // Move this bullet on each frames
        // On X axis use the cosinus angle
        p.x +=  Math.cos(p.angleRadian) * speed;
        // On Y axis use the sinus angle
        p.y +=  Math.sin(p.angleRadian) * speed;
        // Orient the bullet to the direction
        p.rotation = p.angleRadian * 180 / Math.PI;
        // You have to remove each created bullet
        // So after every moves you must check bullet position
        // If the bullet is out of the screen
        if (p.x < 0 || p.x > 400 || p.y < 0 || p.y > 400) {
            // Remove it from the display list
            removeChild(p);
            // /!\ AND REOMOVE HIS EVENT LISTER
            p.removeEventListener(Event.ENTER_FRAME, bulletEnterFrame);
    When I try to run it though I get "1119: Access of possibly undefined property angleRadian through a reference with static type bullet."
    What's wrong with my code?

    cast p as a MovieClip and retest.  if that fails, click file/publish settings/swf, tick "permit debugging" and retest to see the line number with the problematic code.
    function bulletEnterFrame(pEvent) {
        // Get the current object (Bullet)
        var p = MovieClip(pEvent.currentTarget);

  • Flex marking a sample code invalid "Access of undefined property"?

    Hey,
    I used the code from this link: http://tdotblog.info/?q=node/6
    When i put it into Flex Builder 3, it has several issues with the code like "Access of undefined property FileStream" (or File).
    When I run the application, only the typical gray background appears.
    What am I doing wrong?
    Thanks, Erthy

    OK, so I used the code (btw thanks for the link, it is awesome, i already marked as much answers and helpful answers I could) and I came up with something like this:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
         <mx:Script>
              <![CDATA[
                   import flash.filesystem.*;
                   import mx.controls.Alert;
                   public var prefsFile:File; // The preferences prefsFile
                   [Bindable] public var prefsXML:XML; // The XML data
                   public var stream:FileStream; // The FileStream object used to read and write prefsFile data.
                   public function starter():void
                   // stage.nativeWindow.addEventListener(Event.CLOSING, windowClosingHandler);
                   prefsFile = File.applicationStorageDirectory;
                   prefsFile = prefsFile.resolvePath("slovnik.xml");
                   readXML();
                   private function readXML():void
                   stream = new FileStream();
                   if (prefsFile.exists) {
                       stream.open(prefsFile, FileMode.READ);
                       processXMLData();
                   else
                       Alert.show("Nenalezeny žádné slovníky!");
                   // stage.nativeWindow.visible = true;
                   private function processXMLData():void
                   prefsXML = XML(stream.readUTFBytes(stream.bytesAvailable));
                   stream.close();
                   // var slovicko = prefsXML.slovicko.cs;
                   Alert.show("Česky je to: " + prefsXML.slovicko.@cs + "\n Anglicky je to: " + prefsXML.slovicko.@en);
                   // stage.nativeWindow.x = prefsXML.windowState.@x;
                   // stage.nativeWindow.y = prefsXML.windowState.@y;
                   // stage.nativeWindow.width = prefsXML.windowState.@width;
                   // stage.nativeWindow.height = prefsXML.windowState.@height;
                   private function writer():void
                   createXMLData();
                   writeXMLData();
                   private function createXMLData():void
                   prefsXML = <slovicka/>;
                   prefsXML.slovicko.@id = 2;
                   prefsXML.slovicko.@cs = "kočka";
                   prefsXML.slovicko.@en = "cat";
                   // prefsXML.windowState.@width = stage.nativeWindow.width;
                   // prefsXML.windowState.@height = stage.nativeWindow.height;
                   // prefsXML.windowState.@x = stage.nativeWindow.x;
                   // prefsXML.windowState.@y = stage.nativeWindow.y;
                   // prefsXML.saveDate = new Date().toString();
                   private function writeXMLData():void
                   var outputString:String = '<?xml version="1.0" encoding="utf-8"?>\n';
                   outputString += prefsXML.toXMLString();
                   outputString = outputString.replace(/\n/g, File.lineEnding);
                   stream = new FileStream();
                   stream.open(prefsFile, FileMode.WRITE);
                   stream.writeUTFBytes(outputString);
                   stream.close();
              ]]>
         </mx:Script>
         <mx:Button id="start" label="Start" width="130"
                      click="starter()"/>
        <mx:Button id="write" label="Write" width="130"
                      click="writer()" x="138"/>
    </mx:WindowedApplication>
    However, when I change the value, it overwrites the contents of the file. How can I just add one more "slovicko" element to the XML, so it would look like this:
    <?xml version="1.0" encoding="utf-8"?>
    <slovicka>
      <slovicko id="1" cs="blah" en="blah" />
      <slovicko id="2" cs="kočka" en="cat"/>
    </slovicka>
    after adding a new element, instead of just overwriting the previous content leaving only the id=2 element.
    Thanks, I failed to find it and I am sorry for my English.

  • ...undefined property keyCode...

    Hi, I'm fairly new to actionscript.  I was just begining to get the hang of buttons in AS2 when I dropped it to begin learning AS3.  I have Adobe Flash CS3 Professional and I'm going through the "Programming Actionscript 3.0" tutorial files in the help section of the program.  I've gotten past the introductory explainations and reached the first hands-on segment of the tutorial and I'm running into compiler errors like crazy.   I'm 99% sure I don't have any typos or missing semi-colons.
    mainText.border = true;
    textIn.border = true;
    var myGreeter:Greeter = new Greeter();
    mainText.text = myGreeter.sayHello("");
    textIn.addEventListener(KeyboardEvent.KEY_UP, keyPressed);
    function keyPressed(event:Event):void
        if (event.keyCode == Keyboard.ENTER)
            mainText.text = myGreeter.sayHello(textIn.text);
    that's the code I'm working with.  I have a dynamic textbox with the lable "mainText" and an input textbox with the lable "textIn" the tutorial previously went through creating a custom class in an external file "Greeter.as" When i try to compile this I recieve the error
    Description:     1119: Access of possibly undefined property keyCode through a reference with static type flash.events:Event.
    Source:            if (event.keyCode == Keyboard.ENTER)
    I'm just totally lost right now, so any tips that could point me in the right direction to fix this and understand it better would be tremendously appreciated.

    In the listener you are defining it as a KeyboardEvent, so you should be consistent and retain that in the function...
    function keyPressed(event:KeyboardEvent):void
    If the tutorial offered the code as you had it, do not be shocked.

  • Undefined property when it does exist - Need Help

    Hello everyone,
    Im having trouble finding out wuy i keep recieving :
    Line 255 1120: Access of undefined property mandala_email_click.
    The function manda_email_click exists but it keeps showing this error...
    heres the script:
    //-------button-------//
    grupoMenu.mandalaMc.hitsMc.btEmail.addEventListener(MouseEvent.CLICK, mandala_email_click);
    //--------function------//
    private function mandala_faq_click(e:MouseEvent)
    GlobalSettings.btClicado = 11;
                   if (GlobalSettings.AREA != 9)
                        Root.targets[Targets.MAIN_LOADER].trocaBg(8);
                        Root.targets[Targets.BASE].escondeScroll();
                        Root.targets[Targets.MAIN_LOADER].removeConteudoBanner("internaFaq.swf");
                        if (! GlobalSettings.areaHomeProd)
                             Root.targets[Targets.MAIN_LOADER].removeConteudoInterna("internaHome.swf");
                        GlobalSettings.AREA = 9;
                        cor = 0x8EA78F;
                        Root.targets[Targets.HOME].corBanner(cor);
                        Root.targets[Targets.BASE].escondeScroll();
                        TweenMax.to(grupoMenu.mandalaMc.guiaMc, 1, {rotation:32.7});
                        TweenMax.to(grupoMenu.mandalaMc.lineMc, 1, {rotation:32.7});
                        TweenMax.to(grupoMenu.menuMc.bt1, 0.3, {alpha:0});
                        TweenMax.to(grupoMenu.menuMc.bt2, 0.3, {alpha:0});
                        TweenMax.to(grupoMenu.menuMc.bt3, 0.3, {alpha:0});
                        TweenMax.to(grupoMenu.menuMc.bt4, 0.3, {alpha:0});
                        TweenMax.to(grupoMenu.menuMc.bt5, 0.3, {alpha:0});
                        TweenMax.to(grupoMenu.menuMc.bt6, 0.3, {alpha:0});
                        TweenMax.to(grupoMenu.menuMc.bt7, 0.3, {alpha:0});
                        TweenMax.to(grupoMenu.menuMc.bt8, 0.3, {alpha:0});
                        TweenMax.to(grupoMenu.menuMc.bt9, 0.3, {alpha:0});
                        TweenMax.to(grupoMenu.menuMc.bt10, 0.3, {alpha:0});
                        TweenMax.to(grupoMenu.menuMc.bt11, 0.3, {alpha:1});
                        //TweenMax.to(grupoMenu.menuMc.bt9, 0.3, { alpha:0 } );
                        TweenMax.to(grupoMenu.mandalaMc, 1.2, { y:StageObj.stage.stageHeight - 3, scaleX:0, scaleY:0,alpha:0, ease:Sine.easeIn, delay:0.25 } );
                        TweenMax.to(grupoMenu.mandalaMc, 1, { y:110, scaleX:0, scaleY:0,alpha:0, ease:Sine.easeOut, delay:2 } );
                        TweenMax.to(grupoMenu.mandalaMc, 1, { alpha:1, scaleX:1, scaleY:1,ease:Back.easeOut, delay:3} );
                        GlobalSettings.NT_produto = 1;
                        trace("GlobalSettings.NT_produto: ",GlobalSettings.NT_produto);
                        Root.targets[Targets.BASE].getXMLByWord("");
                        /*if (StageObj.stage.stageWidth < 850) {
                         TweenMax.to(Root.targets[Targets.MENU].mcRodapeEsq,.8,{y:StageObj.stage.stageHeight + 200});
                         TweenMax.to(Root.targets[Targets.MENU].mcRodapeDir,.8,{y:StageObj.stage.stageHeight + 200});
                        } else {
                        TweenMax.to(Root.targets[Targets.MENU].mcRodapeEsq,.8,{y:StageObj.stage.stageHeight - 5})
                        TweenMax.to(Root.targets[Targets.MENU].mcRodapeDir,.8,{y:StageObj.stage.stageHeight - 5})
                        posicionaRodape();
                        Root.targets[Targets.BASE].analyticsTrakerAreas("contato");
    I dont think theres a problem with the function because i copied another function exaclty the same , just changed the button variable and alpha value.
    Then again, i started using AS3 a few weeks ago.
    Maybe spaces between 2 functions??
    Well i hope someone can help me i would be grateful.

    In the code you included you don't have a function called "mandala_email_click" only one called "mandala_faq_click".
    If that function is included somewhere you'll need to provide that as well, otherwise it looks like your function is just named incorrectly.

  • Undefined property viewPort

    Hi Guys,
    I got a problem. I found these awesome Voxel-Stage3D Engine http://pixelpaton.com/?p=3713 and downloaded the sourcecode (http://www.pixelpaton.com/download/MoleHillVoxels1.zip)
    I openend everything in my Flash Builder 4.6 with Flex 4.6.0 but then i got these Error Message:
    1119: Access of possibly undefined property viewPort through a reference with static type flash.display:Stage3D. in
    Voxel1.as on Line 56
    yeah.. cool.. a bug. thats what i thougt in the first seconds. then i opend up the Voxel1.as and have a look at the Error-Line
    stage3D.viewPort = new Rectangle(0, 0, W, H);
    yeah.. so where is the wrong line in here? looks right to me?! but then i found out, that the viewPort property has been removed by Adobe Frome Stage 3D and i read someting like
    Developers should instead use the Stage3D.x and Stage3D.y properties. Width and height can only be set using the Context3D object.
    and now this part gets difficult to me... actually i just sit in front of the code and think "what? what should i do?" the lines are now:
    var stage3D:Stage3D = stage.stage3Ds[0];
    stage3D.addEventListener(Event.CONTEXT3D_CREATE, initialize);
    stage3D.requestContext3D(Context3DRenderMode.AUTO);
    stage3D.viewPort = new Rectangle(0, 0, W, H);
    var c:Camera = new Camera(W,H, this.stage);
    addChild(c);
    and the fourth line is wrong. so, could you be so kind and tell me how i should change the line now? sorry but... i dont get it :-/

    ok, that helps a lot.
    after i scroll threw the reference page i guess its something like:
    public function Context3D_drawToBitmapData()
    stage3D = this.stage.stage3Ds[0];
    stage3D.x = 0;
    stage3D.y = 0; 
    //Add event listener before requesting the context
    stage3D.addEventListener( Event.CONTEXT3D_CREATE, contextCreated );
    stage3D.requestContext3D( Context3DRenderMode.AUTO );
    //Compile shaders
    vertexAssembly.assemble( Context3DProgramType.VERTEX, VERTEX_SHADER, false );
    fragmentAssembly.assemble( Context3DProgramType.FRAGMENT, FRAGMENT_SHADER, false ); }
    but, that doesent work eather :-/
    but i goess iam close to a final solution... or at least something near to that

  • Undefined property data in inline itemrenderer

    I get:-
    1120: Access of undefined property data.
    in the following code:-
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark"
                        title="HomeView">
    <fx:Script>
                        <![CDATA[
                                  import mx.collections.ArrayCollection;
                                  [Bindable]
                                  private var imageList:ArrayCollection;
                        ]]>
    </fx:Script>
              <s:List dataProvider="{imageList}" width="100%" height="100%">
      <s:layout>
      <s:TileLayout/>
      </s:layout>
      <s:itemRenderer>
      <fx:Component>
                  <s:BitmapImage source="{data.image}" width="150" height="150"/> <!-- HERE -->
      </fx:Component>
      </s:itemRenderer>
    </s:List>
    </s:View>
    I'm using Flex 4.10 but I tried against 4.6 and I still get this error.
    I've no problems before in creating inline item renderers, so what am I missing here?

    I'm answering my own question.
    There is a difference between mx and spark when creating inline item renderers. To create a spark inline item renderer, you need to extend an item renderer class:-
    <s:List dataProvider="{imageList}" width="100%" height="100%">
         <s:layout>
              <s:TileLayout/>
         </s:layout>
        <s:itemRenderer>
             <fx:Component>
                  <s:ItemRenderer>
                       <s:BitmapImage source="{data.image}" width="150" height="150"/>
                   </s:ItemRenderer>
              </fx:Component>
           </s:itemRenderer>
    </s:List>
    I suspect this is due to the mx components being designed by the kitchen sink approach, where as the spark components has eliminated all the unneccessary bloat.

  • FB 4.5: Flash Professinal Project - Access to undefined property

    I have a "Flash Professinal Project" in my Flash Builder. So, I have a FLA file with the scene and some symbols on it. And a pack of AS files with code.
    The trouble is with symbols in FLA file.
    For example, I have a movieclip with instance name "dlg" on my scene.
    And when I try to access this movieclip like "dlg.gotoAndStop(2)" in some code, the Flash Builder 4.5 underlines "dlg" and puts the orange question mark to the left saying "Access to undefined property dlg". Of course, FB doesn't know about existance of this movieclip. But 4.0 version didn't underline it orange.
    Project compiles ok, but some code parts looks very annoying.
    Half of my code looks like this:
    The additional uncomfortable thing is that when I use FB4 and type dlg. , it opens the autocomplete dialog assuming that "dlg" is a MovieClip by default. FB4.5 doesn't do autocomplete even after I type "dlg.gotoAndS" and press "Ctrl+Space".
    So, is there any way to get rid of this annoying orange question makrs? Maybe, there's a way to describe such instances specially for FB so it can find out their existance? Or just return the way it was in 4.0 ?

    Ok, I have finally found my issue. the "switch" syntax must have changed somewhere between Flex Builder 3 and Flash Builder 4.5.1
    This used to work in Flex Builder 3. The 'case "t", "tr"' will cause code completion to stop working, and also give the "?" warnings all over the souce. Jusr use a separate line for each "case" fixed the issue.
    This has been extremely frustrating for me, I don't have a half a day to google all over with no luck. I wound up making a copy of the project and commenting out most of the code a bit at a time to find this. Sure hope this helps someone else out there!
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                                         xmlns:s="library://ns.adobe.com/flex/spark"
                                                         xmlns:mx="library://ns.adobe.com/flex/mx"
                                                         invoke="onInvoke(event);"  >
      <fx:Script>
                        <![CDATA[
                                  private function onInvoke(invokeEvent:flash.events.InvokeEvent):void {
                                            var s:String;
                                            try {
                                                      switch ( s.toLowerCase() )
                                                                case "t", "tr":
                                                                case "trace":
                                                                          s = "trace";
                                                                          break;
                                                                case "l":
                                                                case "log":
                                                                          s = "log";
                                                                          break;
                                                                default:
                                                                          s = "?";
                                                                          break;
                                            catch ( err:Error ) {
                                                      s = "error";
                        ]]>
      </fx:Script>
      <fx:Declarations>
      </fx:Declarations>
    </s:WindowedApplication>

Maybe you are looking for

  • How do I add second MobileMe Gallery to iPhoto

    Hello Friends. On the left side of the iPhoto window I have all my albums, keepsakes, facebook pics, and my mobileme galleries. Now, that works great for me, but my wife can't use her mobileme with iPhoto (or we just haven't figured it out. Is there

  • Queue freezing won't deliver messages to mailboxes

    Every now and again my queue seems to build up and won't deliver until I stop and start mail services then flush the queue. Here is my log, It seems to start filling up right after it refreshed the postfix mail system. I then continually get the mess

  • How to use SOCKS in Java?

    I use 100% working socks and I can't connect through my application. SocketAddress proxyAddr = new InetSocketAddress("1.1.1.1", 12345); Proxy pr = new Proxy(Proxy.Type.SOCKS, proxyAddr); try HttpURLConnection con = (HttpURLConnection) new URL(url).op

  • Activate items from Business Cont. without change existing system

    Hi all, I plan to activate some Infoobjects, DSO and InfoCubes from the Business content. In order to avoid some big issue I'like to know if there is a procedure to follow. My main fear is to Activate all the business content and to overwrite the exi

  • NW04 Sneak Preview Problem

    I'm trying to install the Netwaver Sneak Preview but in one step stops with this error ERROR 2006-02-13 18:11:37 CJS-00030  Assertion failed: in function sapdb_db_create(db_nm, db_host, db_ver) {    var dep_root = sapdb_inst_root(db_nm);    var sdb_i