help-based actionscript, tracing of my class object properties

Hi all, I'm just starting to learn about the ActionScript classes, I am following with Moocks book Actionscript for Flash MX and try to run a trace on the properties of my ballclass, but all I get is undefined. It is what I have in my control panel actions.

spherical function () {}
This.RADIUS = 10;
This.Color = 0xFF0000;
this.xPosition = 59;
this.yPosition = 15;
}
var boucyBall = new Ball();

trace (bouncyBall.radius);
trace (bouncyBall.color);
trace (bouncyBall.xPosition);
trace (bouncyBall.yPosition);

Any help would be great

You misspelled the name of the variable, 'bouncyBall' on this line:

var boucyBall = new Ball();

Tags: Adobe Animate

Similar Questions

  • Help class object.

    Hello, even once, I need help.

    I have two classes,

    1.) Tile.as class - for a game tic tac toe, which creates the tile acutal for the grid

    2.) class Game.as - which implements and creates instances of the tile class puts on a grid, check the round, if there is a solution, and what to do with the solution.

    I attribute questions to each square of the grid as hollywood squares. If they get the question wrong the form of opposing teams will fill in the grid of the user has clicked. My problem is erratic behavior in establishing good shape in the squares of the Board. I put a switch box that goes through all marked forms, not what I want.

    In Tile.as

    Game.isClicked is the e.CurrentTarget in the game class.

    Game.isClicked.isSet is a string value that checks and ensures that the values are all the same inorder to solve.

    public void updateGraphic(e:Event) {}

    {Switch (Game.isClicked.isset)}

    case "X":

    tileO.visible = true;

    tileX.visible = false;

    Game.isClicked.isSet = 'F';

    Game.isClicked.isSet = "undefined";

    break;

    case "O":

    tileO.visible = false;

    tileX.visible = true;

    Game.isClicked.isSet = 'X '.

    trace ("O after update", Game.isClicked.name, Game.isClicked.isSet);

    Game.isClicked.isSet = "undefined";

    break;

    }

    }

    }

    In Game.as

    This code is placed on the 2 boxes called 'straight' or 'bad' called obj is e.currentTarget.name

    public static void checkMark(obj:Object)

    {

    Tile.activateMouse (questBox, Tile.questionEvent);

    switch (obj)

    {

    case "right":

    TweenMax.to(questBox.feedRight,.5,{autoAlpha:1});)

    break;

    case "bad":

    isClicked.dispatchEvent (new Event ("updateGfx"));

    TweenMax.to(questBox.feedWrong,.5,{autoAlpha:1});)

    break;

    }

    }

    When applied in this way, the two questions were answered one being the wrong answer, the two will always go through the case statement Tile.as and reset according to the conditions.

    Example: Form of Question 1 was false and all form O and Question 2 was false and the value of X. Once the condition called the O will have the value X in Question 1 Square and X will be settled on O Question 2 room.

    I hope this explains things a bit, and any help/ideas would be greatly appreciated. Thank you.

    Make sure you that understand the purpose of the 'static' keyword

    staticSpecifies that the variable, a constant, or method belongs to the class rather than to instances of the class

    the erratic behavior might have to do with the fact that you have access to the Tile.class instead of the Tile.instances.

    Just a guess, because the code you show is not enough to isolate the problem.

  • ActiveX in BradySoft (CodeSoft) - what method/class/object I would use to send data to the form variable to BradySoft?

    Can what method/class/object I use to send data to the form variable to BradySoft? I have a basic configuration of BradySoft label and I want to send it data of variable shape (a serial number) from Labview ActiveX. I joined guide Brady ActiveX programmers, but can't understand what to use for that.

    P.S. I would call Brady or TekLynx tech support on this issue, but they have a strict policy while BradySoft supports ActiveX, but does not provide technical support assistance programming with it. I thought I would try the Forums OR.

    Just an update. I could get this to work myself after a few days of playing with it (I suppose that the best way to learn!). I have attached a sample VI for anyone interested. Can we Kudo ourselves?

  • Attention impossible to bind to property 'somevar' on the 'Object' class object is not an IEventDispatcher?'

    Hi all

    How to fix under WARNING:

    Attention impossible to bind to property 'somevar' on the 'Object' class object is not an IEventDispatcher

    Thank you

    Sunil Rana

    Hi Paul,.

    I found the solution on the net & here's news

    Cast the data in your itemrenderer as an objectProxy.

    itemRender.mxml

    http://www.Adobe.com/2006/mxml '.

    verticalScrollPolicy = "off".

    horizontalScrollPolicy = "off".

    creationComplete = "init (); » >

    Import mx.utils.ObjectProxy;

    [Bindable]
    public var dataProxy:ObjectProxy;

    private function init (): void {}
    dataProxy = new ObjectProxy (data);
    }
    ]]>
        

    Thank you

    Sunil Rana

  • XML class object.

    Hello.
    I want to create DataGrid with itemReneder for each column.

    It is generated inline itemRenderer:
    DataGridColumn.itemRenderer = new ClassFactory (MyCustomClass);
    MyCustomClass - it manually generated class that contains some form elements (TextInput, Combox... e.t.c.)

    I want to consturct ItemRenderer dynamics. For this I need to create the class object and send it to itemRenderer:
    var component: DynamicFormClass = new DynamicFormClass();
    var newComponent: Class = component.someMethodWhichWillCreateForm (configData); -This request will display the elements of class that will generate the form that describes in configData
    DatagridColumn.itemRenderer = new ClassFactory (newComponent);

    This code is how I see the solvetion of this problem, but it does not work.
    I don't really know how it create answers how and will be very grateful for any decision.
    Thank you.


    Amy Blankenship Merci for the answer, this is not what I need. I found the answer on this question: is the substitution DataGrid ItemRenderer set, method.

  • in the 2.0 class objects - how to swap the depths of a clip

    How do put you an object up? If it's just a clip, I could do a swapdepths, but if it's a clip which is part of an object YOU 2.0, how to exchange the depths of the entire object?

    I create 2 objects (same class) each with a movieclip in their breast. The clip is created on a single level with getNextHighestDepth().

    I have a button that tries to swapDepths of 2 objects, but I can't make it work. Can anyone help?


    Here are the details:

    1. create a symbol in the library called "someShape_mc" and put a form in it - a circle, a square, either - this symbol is exported for action script and received a class AS "ClassObject" 2.0 (I also put a dynamic text in the form field to display the current depth - it is called "depth_txt")

    2. create a button called 'swap_btn' on the stage.

    Frame 1 to the following actionscript code:

    var BottomObject:ClassObject = new ClassObject(this,100,150);
    var topObject:ClassObject = new ClassObject(this,110,160);

    for the button Add this:

    {Swap_btn.onRelease = Function ()}

    Try it with the full path:
    _root. BottomObject.__LocalMovieClip.swapDepths (_root.topObject.__LocalMovieClip);

    Try it with just the objects:
    BottomObject.__LocalMovieClip.swapDepths (topObject.__LocalMovieClip);

    Try it with the object as a movieclip
    BottomObject.swapDepths (topObject);
    trace ("he Swap?");

    Try it with a method in the class...
    BottomObject.swapIt (topObject.__LocalMovieClip);
    BottomObject.swapIt (topObject);
    trace ("nope... no permutation in progress...");
    }

    ================================

    Here is the AS file: 'ClassObject.as. '

    ClassObject class extends MovieClip {}
    var __LocalMovieClip;
    var __Depth;
    function ClassObject (passedIn_mc:MovieClip, x: Number, y: Number) {}
    __Depth = passedIn_mc.getNextHighestDepth ();
    __LocalMovieClip = passedIn_mc.attachMovie ("someShape_mc", "__LocalMovieClip", __Depth);
    trace ("a form to" + __Depth);

    __LocalMovieClip._x = x;
    __LocalMovieClip._y = y;
    __LocalMovieClip.depth_txt. Text = __Depth;

    }

    public void swapIt (targetMc) {}
    __LocalMovieClip.swapDepths (targetMc);
    __LocalMovieClip.depth_txt. Text = __LocalMovieClip.getDepth (); no difference.
    trace ("tried to Exchange class...");
    }
    }


    ========================
    So - the goal is to be 'down' class on the top of the object of 'top '. Button tries various methods of Exchange from the depths of clips – but it is not one that works. What Miss me?

    TIA
    Ferd

    aHA! I got it! Thank you very much - I am not you! good eye!

  • Creation of class objects

    Hey,.

    I need help with this code he does and the error when I put it in my project, but when sound in an empty space of the project it works fine?

    Code:

    package

    {

    import flash.display.MovieClip;

    public class newchars extends MovieClip

    {

    public void newchars()

    {

    for (var i: int = 0; i < 1; i ++)

    {

    var newchar1:MovieClip = new mychar();

    addChild (newchar1);

    newchar1.x = Math.Random () * 500;

    newchar1.x = Math.random () *(stage.stageWidth-newchar1.width);

    newchar1.y = Math.random () *(stage.stageHeight-newchar1.height);

    }

    }

    }

    }

    error:

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    at newchars()

    at IceMountain_fla::MainTimeline/frame2()

    at flash.display::MovieClip/gotoAndPlay()

    at IceMountain_fla::MainTimeline/fl_MouseClickHandler_2()

    as soon as I click on my play button in the start menu it interfieres with my class!

    but in an empty space of the project it works fine: S

    Class can make a few mistakes unusual lol

    Thank you.

    use:

    Section 1:

    Stop();

    Play_1.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler_2);

    function fl_MouseClickHandler_2(event:Event):void

    {

    gotoAndStop (2);

    }

    Section 2:

    Stop();

    var enemy1:newchars = new newchars();

    addChilld (enemy1);

    addEventListener (Event.ENTER_FRAME, fl_EnterFrameHandler);

    function fl_EnterFrameHandler(event:Event):void

    {

    Bird_1.x = mouseX;  / / assuming Bird_1 is on stage

    }

  • Help with ActionScript

    I was recently done in ActionScript, and I'm over my head. I need help.

    I want to do is to have a series of images that scroll. However, I would also like to have back and arrows according to, so you can change the images manually.

    Here is where I am now:

    I have two movie clips - I want to switch between two images.
    I have two buttons next and back.

    I am able to make the arrows to work, if I go to a certain slice, but if I try to get to go to a specific movie clip name, I get an error.

    Here is the ActionScript code I currently have:

    function nextclip(event:MouseEvent):void
    {
    image1_mc. Play();
    }
    next_btn.addEventListener (MouseEvent.CLICK, nextclip);


    I guess I'm not sure I'll even on this the correct way. Is there a way to advance to the next image, without having to specify what is the name of the instance of the image?

    Please help me! I'm quite confused.

    You can keep the images on consecutive images (not the space 10 frames) and simply use nextFrame() and prevFrame() for arrows next and previous. Regarding the second loop 10, you can use a timer. (I'll do my best to explain)

    var: clock = new Timer (10000);
    Creates a new timer under the name of the clock object and sets it to check every 10 seconds (10 000 milliseconds, change at your convenience)

    clock.addEventListener (TimerEvent.TIMER, moveNext)
    Adds a listener to the clock. Ticks of the clock every time, the listener will start the function called moveNext

    Clock.Start ();
    Starts the clock (will be start ringing every milliseconds x (however you define it))

    function moveNext(event:TimerEvent) {}
    If (currentFrames == totalFrames) {}
    If it's the last image > Stop at frame 1
    gotoAndStop (1);
    } else {}
    If this is not the last picture > goto the next image
    nextFrame();
    }
    }

    Hope this helps ;-)

  • Attribute getters/setters not found in class object view

    Hello

    I use JDeveloper 10.1.3.4 and you have questions about the customization of the display of the advice in the view object.

    In my application that should be used by the students and administrative staff, I generated entity object both display objects for a table of the database. Some of the attributes need customized display format. For example, the numbers of social security in the datatable is 123456789. For student users must be displayed in the form xxx-xx-6789. For staff users, it should be displayed in the format 123-45-6789.

    So I create two objects from view of the same entity object, one for students and one for its employees, each having its own display format. To put customization code in attributes getter methods, however, I found that in view of object class files get accessor methods do not exist. The entity object class file has the getters; However if the customization is done there I won't have two different formats.

    Suits for buyers are available in the object class file so that I can customize?

    Thank you very much for help!


    Newman

    Newman,

    Attribute getters would be placed on the class view LINE object.

    John

  • Failed to instantiate new custom class object - no trace of the stack

    Hello

    I have a little maddening problem. I created a custom class called 'Notification '. When I try to create an instance of the latter, I don't get any stack trace. Here's the class:

    package net.creative.core.util;
    
    import net.rim.device.api.system.Bitmap;
    
    /**
     * These are the notification objects that are created and stored
     * when a push notification is sent.
     * @author Heather
     *
     */
    
    public class Notification {
    
        private String title;
        private String content;
        private Bitmap image = Bitmap.getBitmapResource("appicon.png");
    
        public Notification(){
            title = "Title";
            content = "Content";
        }
    
        public Notification(String _title, String _content){
            title = _title;
            content = _content;
        }
        public Notification(String _title, String _content, Bitmap _image){
            title = _title;
            content = _content;
            image = _image;
        }
        public String getTitle(){
            return title;
        }
        public String getContent(){
            return content;
        }
        public Bitmap getImage(){
            return image;
        }
        public void setTitle(String _title){
            title = _title;
        }
        public void setContent(String _content){
            content = _content;
        }
        public void setImage(Bitmap _image){
            image = _image;
        }
    
    }
    

    I don't think it's a problem, but the screen I have tried to create an instance of in the Notification is in the com.creative.core package. I imported Notification on the screen while... Any ideas?

    Never mind.. just resolved.

  • Help: Problem with scrolling my html and objects they keep practicing on my main menu

    Basically whenever I have put an html element in my site of Muse or any other object that I encounter a problem when scrolling downwards beyond this object in the preview. I have a menu bar horizontally located on the top of my site and whenever I scroll html elements and objects

    cut through my menu. Is it possible to fix this? -J' tried pinning of items but may not know. Any help would be greatly appreciated.

    Thank you

    So, you have a Menu pin in the master page but are bunk by page objects when you scroll down? If this is the case, select the Menu in the Master, right-click on it and move to master in the foreground.

    Thank you

    Vinayak

  • Help! JavaScript works not when the object is moved from one page to the other!

    Hi all:

    I am new to Adobe Livecycle Designer (version 8.0). I created an interactive pdf form of 3 pages with many objects (text fields, radio buttons, drop-down lists, etc.), our company wants to quickly start to use.

    I'm having trouble with some of my Javascript does not not with some of my items on page 2 of the form. Specifically, there is a drop down menu to "Country" on page 2 of my form. When the user selects, for example, 'United States' in the list, I have the Javascript code that is supposed to change the 'currency' list drop-down to "Dollars" rawValue accordingly (on the change event).

    I think that my Javascript syntax is correct, but I am not sure. Here's my simple Javascript associated with the "Country" drop-down list (Note: rawValue 80 = 'United States' and 105 rawValue = "US $"):

    -


    Form1. Page1.cmbContactInfoCountry::change :-(JavaScript, client).


    If (this.rawValue == 80) {}

    cmbCurrency.rawValue = 105;

    }

    It sounds pretty simple and it WORKS when my "Country" drop-down list is moved to page 1 of the form, but it WON'T WORK when I move the combo box "Country" return to page 2 of the form (i.e. where it belongs).

    Anyone has suggestions or solutions? I spent probably 6-8 hours of racking my brain trying to figure out why it works when on a single page, but it does not work when to move to another page. I guess I can have corrupted something OR that I not address fully the proper name of the object?

    Help, please!

    Frustrated and helpless, near Chicago.

    Taylor T

    Yes, it's a quirk of... in the drop-down lists when you select an item in the DOF it is not committed until you exit the field, unless you do the following:

    If (this.boundItem (xfa.event.newText) == 1) {}

    cmbCurrency.rawValue = 1;

    }

    ElseIf (this.boundItem (xfa.event.newText) == 2) {}

    cmbCurrency.rawValue = 2;

    }

    The xfa.resolveNode stuff was not necessary that both objects are of the same subform, and as such can 'see' each other.

    Think like a folder structure subforms - elements can see what is in their own folder but will say where to find things in other folders. If cmbCountry was subform1 and cmbCurrency was so in subform2 that rawValue above lines would look like:

    subform2.cmbCurrency.RawValue = 1;

    It's a good idea to name all your objects, subforms, etc. it is to work with script is much easier - so you won't have to deal with things like these pieces of xfa.resolveNode you had before (as well). He ones because you have more than one subform called "subform", the number of hooks is the Instance number (when you have several of the same object) if the program has to differentiate between the various "subform".

    The number of instance come in handy, but for things like the rows of the table and so on when you need to make calculations.

  • I need help with actionscript 3, sending information php to my email, Web site created in Flash pro cs5

    Hi, my name is David and I took a course to create my own website of Lynda.com by Paul Trani. After that, I created my first own webste. After that I finished it, everything worked well in flash and firefox. I have one problem or question about the power form back to send information of my website at my emailaddres. I created my website 'LisbonDreamWalking' in Flash pro CS5. I have a contact page, where people can send an e-mail for a walk in Lisbon, the date, the number of people etc. Now I want through my ISP / host funpic.org, as the entry info fields of text to be sent to my emailaddress [email protected]. My mail URL address iss: http://lisbondreamwalk.li.funpic.org This is a free webhost, so they do not work with forms as in the course, and I need some additional Info for php. Here is my HTML (Flash actionscript 3.0) to send, I don't have that red text to fill (php), I was told by the adobe course. I really hope that someone can help me? Thanks in advance!

    Instructions: 1. Add your custom code on a new line after the line that says "/ / Start your code custom" below. The code runs when the user clicks the symbol instance. * / send_btn.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler_13);  function fl_MouseClickHandler_13(event:MouseEvent):void {if (thename.text == "": theemail.)} Text == ' | thetime. Text == ' | thepersons. Text == ' | TheMessage. Text == "") {thankyou.text = "Please fill out all fields';      } else {/ / create a container var allVars: URLVariables = new URLVariables();}           allVars.name = thename.text;           allVars.email = theemail.text;           allVars.time = thetime.text;           allVars.persons = thepersons.text;           allVars.message = themessage.text;           Send the info to a URL var mailAddress:URLRequest = new URLRequest ("http.www.namewebsite.com/gdform.php");           mailAddress.data = allVars;           mailAddress.method = URLRequestMethod.POST;           sendToURL (mailAddress);            Thankyou. Text = "Thank YOU!"           theName.Text = "";           Theemail. Text = "";           thetime. Text = "";           thepersons. Text = "";           TheMessage. Text = "";      } }

    H

    your code and my code are not the same.  Copy and paste the code that I have proposed.

  • Help the passage of the document class for the class of database!

    Hello comrades!

    I thought that I ve solved that problem, but I was wrong

    I created a movieclip with a star. Then I create a document class and I named it like Main.as.

    In this document class that I wrote:

    package 
    {
         import flash.display.*;
    
         public class Main extends MovieClip
         {
              var st:star=new star();
    
              public function Main()
              {
                   stage.addChild(st);
                   st.x=20;
                   st.y=30;
              }
         }
    }
    

    If I run this code, I will get a star on the stage in the x direction and y positions.

    Now, I want to drag the star with the mouse and drop it anywhere on the stage. After the fall, the star must return to its original position.

    To achieve this, I create a new AS3.0 class. I named it DragDrop.as, and I linked to the movieclip as the baseclass.

    Inside this category I wrote:

    package 
    {
         import flash.display.*;
         import flash.events.MouseEvent;
    
         public class DragDrop extends MovieClip
         {
              var x_origin:Number;
                    var y_origin:Number;
                    public function DragDrop()
              {
                            x_origin=this.x;
                            y_origin=this.y;
                            trace(x_origin);
                            trace(y_origin);
                   this.addEventListener(MouseEvent.MOUSE_DOWN,drag);
              }
              function drag(evt:MouseEvent):void
                    {
                   this.startDrag();
              }
         }
    }
    

    I m not posting the code here, but you can easily see that the use of variable I m x_origin and y_origin to keep the original position of the clip.

    I'll use them to bring star back in its original position.

    The problem is that instead of being respectively 20 and 30, retracing their I see that they are both ZERO.

    So, when I drop the star, instead of going to x = 20, y = 30 back to x = 0 and y = 0.

    I ve for the position of Star compared to the scene, but I can´t find anyway!

    Could you help me?

    Thanks in advance!

    Best rgds

    Eduardo

    I think I see... you have:

     stage.addChild(st);               st.x=20;               st.y=30;
    

    for the init works in the star before set the position... so still 0,0. You can set the x, y front sets addChild... or you can change your star class to accept the position in the constructor. And then you'd like: var st:star = new star (20,30);

  • fade out dynamic text only fading. Need help with actionscript

    Hi all

    I hope someone can help me. I have a dynamic text I want to fade and then fade out and then disappear in another bit of copy. My text fades but is not melted, paragraph disappears and then evokes the next paragraph suddenly. All the basic ideas on the code that I have attached here? Let me know if you need more.

    Thanks a lot for your help. I finally found it and done in a much simpler way with much less code. I used symbols that I mentioned in previous posts, following this same actionscript help basis but put my video clips on frame 1, used a stop action and ended up with PlayMC()

Maybe you are looking for

  • HP Pavilion dv4 - 2070br: Hp pavillion SSD update

    Hello, I bought an SSD of 960 GB Sandisk the amazon link is: http://smile.amazon.com/gp/product/B00M8ABHVQ My question is: Is there instructions, or things I should be aware, before trying to install this player? I intend to my current HARD disk imag

  • Users on the network can not connect to my computer

    Since the upgrade to ElCapitan on my computer, my children are unable to connect to my computer from their. They can see it, but when it is clicked on the "Could not connect" message appears.

  • Where is the CPU on the P10-S429 Satellite lock

    Where is the lock-on the P10-S429 Satellite Toshiba CPU

  • supports most windows xp?

    When MS says they will be be dropping support for Windows XP, this means that existing updates to the operating system will be lowered, or will they continue to be available long after he retired?  If so, how long can we hope that they are still avai

  • Adobe reader and Windows XP Pro SP3 DEP

    OS is XP Pro. Cannot print anything Adobe Reader now. This has never been a problem in the past. Tried updating to the latest version of Adobe Reader (9.3). This does not solve the problem. Entered in the configuration of the DEP and Adobe added to t