EventListener Help (undefined property Scene2)???

I created a button (kitchen_btn1) in Scene 1 on my timeline where I want the user to click and go to Scene 2 and stop.
stop();
//import classes so we can have them in our movie
import flash.display.*;
import flash.events.*;
import flash.display.MovieClip;
import flash.display.Sprite;
kitchen_btn1.addEventListener(MouseEvent.CLICK, kitchenCLICK);
function kitchenCLICK (event:MouseEvent): void {
gotoAndStop(Scene2);
Everytime I try and test the movie I get an error message and my movie loops from scene 1 to scene 2 wiith out stopping.
The error message reads:
Scene 1, layer 'actions', Frame 1, Line12                                 1120: Access of undefined property Scene2.
In Scene 2 in my Actions layer, I program the scene to stop on frame 1.
stop();
How do I define Scene 2 and get this to work properly?
Thank you.....

In AS3, the first argument in a gotoAnd... call is the frame identifier, so you should use gotoAndStop(1, "Scene 2");
If you changed the name of Scene 2 to be Scene2 (no space) use that instead.
If you have an error in your coding, it is normal for the file to just loop thru constantly without care for any code, such as the stop() you have in scene 2  (its way of throwing a fit)

Similar Messages

  • 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);

  • 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.

  • 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.

  • Error Code 1120 access of undefined property...help please

    I am fairly new to Flash - I have CS4 and am not sure if I am in the right place to get help.
    I am trying to build a click through gallery with small buttons that you click on and it switches the larger image out as you click through.
    I copied over a gallery I had successfully built with 10 images.  The new gallery has 20 images.
    Basically the movie just runs continuously without being able to click on the thumbnails.
    I am getting the following compiler errors
    Scene1 Layer 'actions', Frame 1, Line 42 1120:Access of undefined property btn11_btn Source - btn11_btn.addEventListener(MouseEvent.CLICK, showimage11);
    I get this for image 11 through 20
    The following is my code
    stop();
    btn1_btn.addEventListener(MouseEvent.MOUSE_OVER, showimage1);
    function showimage1(event:MouseEvent):void {
    gotoAndPlay("label1");
    btn2_btn.addEventListener(MouseEvent.CLICK, showimage2);
    function showimage2(event:MouseEvent):void {
    gotoAndPlay("label2");
    btn3_btn.addEventListener(MouseEvent.CLICK, showimage3);
    function showimage3(event:MouseEvent):void {
    gotoAndPlay("label3");
    btn4_btn.addEventListener(MouseEvent.CLICK, showimage4);
    function showimage4(event:MouseEvent):void {
    gotoAndPlay("label4");
    btn5_btn.addEventListener(MouseEvent.CLICK, showimage5);
    function showimage5(event:MouseEvent):void {
    gotoAndPlay("label5");
    btn6_btn.addEventListener(MouseEvent.CLICK, showimage6);
    function showimage6(event:MouseEvent):void {
    gotoAndPlay("label6");
    btn7_btn.addEventListener(MouseEvent.CLICK, showimage7);
    function showimage7(event:MouseEvent):void {
    gotoAndPlay("label7");
    btn8_btn.addEventListener(MouseEvent.CLICK, showimage8);
    function showimage8(event:MouseEvent):void {
    gotoAndPlay("label8");
    btn9_btn.addEventListener(MouseEvent.CLICK, showimage9);
    function showimage9(event:MouseEvent):void {
    gotoAndPlay("label9");
    btn10_btn.addEventListener(MouseEvent.CLICK, showimage10);
    function showimage10(event:MouseEvent):void {
    gotoAndPlay("label10");
    btn11_btn.addEventListener(MouseEvent.CLICK, showimage11);
    function showimage11(event:MouseEvent):void {
    gotoAndPlay("label11");
    btn12_btn.addEventListener(MouseEvent.CLICK, showimage12);
    function showimage12(event:MouseEvent):void {
    gotoAndPlay("label12");
    btn13_btn.addEventListener(MouseEvent.CLICK, showimage13);
    function showimage13(event:MouseEvent):void {
    gotoAndPlay("label31");
    btn14_btn.addEventListener(MouseEvent.CLICK, showimage14);
    function showimage14(event:MouseEvent):void {
    gotoAndPlay("label14");
    btn15_btn.addEventListener(MouseEvent.CLICK, showimage15);
    function showimage15(event:MouseEvent):void {
    gotoAndPlay("label15");
    btn16_btn.addEventListener(MouseEvent.CLICK, showimage16);
    function showimage16(event:MouseEvent):void {
    gotoAndPlay("label16");
    btn17_btn.addEventListener(MouseEvent.CLICK, showimage17);
    function showimage17(event:MouseEvent):void {
    gotoAndPlay("label17");
    btn18_btn.addEventListener(MouseEvent.CLICK, showimage18);
    function showimage18(event:MouseEvent):void {
    gotoAndPlay("label18");
    btn19_btn.addEventListener(MouseEvent.CLICK, showimage19);
    function showimage19(event:MouseEvent):void {
    gotoAndPlay("label19");
    btn20_btn.addEventListener(MouseEvent.CLICK, showimage20);
    function showimage20(event:MouseEvent):void {
    gotoAndPlay("label20");
    Any advice would be great
    I dont know if I have to start from scratch - which would be a pain for sure
    Thanks

    I feel foolish - I solved my own problem!
    I figured out that I had not given buttons 11 - 20 an instance name
    Once I did that - voila problem solved
    Sorry for bothering you all.

  • Need help with error msg 1120: Access of undefined property

    I am not a coder, so I need coding help. Any help would be greatly appreciated.
    I'm doing a Flash banner that has clickTAG instructions from Google. The code they said to put on the button is:
    ClickTAG parameter code for ActionScript 3:
    import flash.events.MouseEvent;
    import flash.net.URLRequest;
    someButton_or_displayObject_to_receive_mouseClick.addEventListener(
          MouseEvent.CLICK,
          function(event: MouseEvent) : void {
          flash.net.navigateToURL(new URLRequest( root.loaderInfo.parameters.clickTAG), "_blank");
    Replace someButton_or_displayObject_to_receive_mouseClick with the actual name of button that will receive the click.
    Note that it's not necessary to specify the destination URL for the ad anywhere in this code; this is taken care of through the usage of clickTAG. Also, depending on the structure of your Flash ad, it may be necessary to prepend "_root." or "_level0." to "clickTAG" above, resulting in "_root.clickTAG" or "_level0.clickTAG". It is strongly recommended to upload the ad into your account and verify that the ad is behaving normally prior to it going live, allowing time for any necessary changes.
    And this is the code I put in (btnClickTag is the name of my button):
    import flash.events.MouseEvent;
    import flash.net.URLRequest;
    btnClickTag.addEventListener(
          MouseEvent.CLICK,
          function(event: MouseEvent) : void {
          flash.net.navigateToURL(new URLRequest( root.loaderInfo.parameters.clickTAG), "_blank");
    and this is the error I got:
    Scene1, Layer 'actions', Frame 1, 1120: Access of undefined property btnClickTag. btnClickTag.addEventListener(

    First, make sure you have assigned that name to the button via the properties panel, then, be sure to adjust the code so that it is not spread out over several lines... normally it needs to be on one line.  You should not nest the function in the event listener either, so try the following (no need for the import statements)...
    btnClickTag.addEventListener(MouseEvent.CLICK, tagClick);
    function tagClick(event:MouseEvent):void {
          navigateToURL(new URLRequest( root.loaderInfo.parameters.clickTAG), "_blank");

  • 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....

  • 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.

  • 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 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

  • 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 to use Java Script in Oracle Forms 10g

    Hello, Appreciate if anyone could help me using Java Script in Oracle Forms 10g? Thanks GM

  • Image with a Link to an URL

    Hi, I have an easy question. I would like to have a little question mark-image on my view. And this image has an link to an url. So I would like to push this image, and a new browser-window opens. I only found the Layout-element "LinkToUrl". But with

  • Sent mail display attachment icon in mailbox list?

    I'm new to Mail (just switched from 15 years of Eudora use).  I have installed the paper-clip icon column in my mailbox windows, but when I move

  • Font sizes between  Photoshop and Edge - Any Accurate conversion table?

    I have been trying to make sense of the font sizes between  Photoshop and Edge. It seems that the conversion tables I have found do not actually give the right numbers and I am wondering if there is a table from Adobe that would make it easy to have

  • Long distance in local calling area

    I have set up some Skype to go numbers in my calling area and some of them are working but when I dial others Bell Canada says the number is a long distance number.  Is there any way to chose the number (ie 613 927 XXXX or 613 434 XXXX) instead of it