Simple sprite creation

This is some oversimplified code from a more complex file I'm
writing. I'm getting the same error on my other code. Take a look
at it for me (if you don't mind)- and tell me the proper way to
name a sprite (or custom class extending sprite) instance, so I can
then reference it later. :) thanks!

quote:
Originally posted by:
omnidogg
You can also use array access with objects, so after your
creation loop, you can access various properties of dynamically
created and named objects using the following notation
for (var i=0; i<5; i++)
root["test_" + i].x = 10;
root["test_" + i].y = 10;
root["test_" + i].visible = true;
which also lets you go several layers deep easily and is a
much more straight forward and efficient way of coding.
Sorry, but that is incorrect. You cannot reference the
Sprites via their "name" property like that. There is confusion
over DisplayObject.name and the actual instance name

Similar Messages

  • Simple WebService Creation using JDeveloper 11.1 Technology Preview 2

    Hi,
    I like the way JDeveloper simplifies the web service creation using the wizards and allows to test the web services from the IDE itself.
    I have the following issues when I tried the step-by-step tutorial (http://www.oracle.com/technology/obe/obe11jdev/11/ws/ws.html) to build a web service. I greatly appreciate if some one can help me with these issues. This tutorial basically provides how to create a simple hello world kind of web service using JDev. Some of the steps are failing in my case.
    Failure 1) Unable to find the WSDL document
    When I invoke the "Test Web Service" menu item HTTP Analyzer is unable to locate the dynamically generated WSDL. I did try with and with-out proxy settings both the cases it failed. However I can see the WSDL if I go to the given WSDL URL in my web browser. I suspect I am missing some thing in Jdeveloper configuration. So I had to manually save the WSDL from the browser to go to further steps.
    Failure 2) Failure in the Response message
    When I invoke the request message I am getting the following error in the response:
    "The selected message is not a SOAP message". However, if I use the browser to test the web service, it is working fine.
    I greatly appreciate if you can provide me some insight into why JDeveloper is failing in these cases.
    Thanks
    Sunil

    It started working after I restarted the JDeveloper with no proxy settings. Seems to be after changing proxy settings JDev need to be restarted to take the preference changes to be effective in this case.
    Another interesting aspect that I noticed was, when HTTP analyzer is running it dynamically sets the proxy in the preferences settings as localhost with the HTTP analyzer port.
    But anyway now I am able to run and test this webservice within the JDev itself.
    Regards
    Sunil

  • Demo Documentation for a Simple Cartridge Creation

    Hi,
    Thus anyone knows where i could find a Tutorial or a Demo documentation for implementing a Simple Cartridge in OSM 7.0.2?
    I'm trying to use all the components supplied from the Design Studio but i'm not understanding how to relate them and how to configure them in the correct way just by reading the documentation supplied in the installation.
    All Oracle documentation talks about concepts and the components in a separate matter, but no in a fully detailed How to implement a Cartrigde step by step, using all the components. The only tutorial that i saw was in the Developers Guide and is very, very simple.
    Thanks

    Hi,
    Following are some of the resources:
    1. From Design Studio: File -> New -> Example -> 2 examples under "Design Studio Order and Service Management Provisioning Examples"
    2. Sample SOM cartridge cartridge on OTN (I will put in some Orchestration Samples soon) -> https://www.samplecode.oracle.com/sf/projects/som/
    3. You can download the productize O2A cartridge cartridges from https://edelivery.oracle.com/. However, I would suggest you to look at option 1 & 2 before looking at the O2A cartridges.
    Cheers,
    Deepankar (Deep) Dey

  • Simple link creation

    Hi everyone,
    I have a really simple problem..I've searched the forum and read some posts and I'm really missing the train on this one.
    I don't know how to create a link (page 1) that goes to another page (page 2). Can some PPPLLLEEEAASSEE explain to me how to do this??
    Thanks so much,
    Mary Lee

    You have to give much more detail than this to get a meaningful response.
    Links are created using the f?p= syntax documented in the Users Guide.
    To link to Page 2 in your app, it would be
    Click me

  • Issue in simple Iview creation

    Hi Friends,
    I am going to develop IView, Page, workset, Role, and assigning the Role to the user.
    I created all these four and User, just I added one by one like Iview to page, page to workset, workset to Role and assigned Role to User.
    Now If I open the portal with user, It is showing page not found.
    Could you please help me in this.
    Regards,
    Lakshmi Prasad.

    I have enable all Entry point for iview, workset, roles, etc. However still nothings works.
    The tab of the respective role did not display at all. Standard SAP role is working. Only custom ones are not.
    I have no much idea after trying to fine what's the issue.
    Hoping someone could help me out.
    Thanks.

  • Troubled by simple array creation

    here is the code :
    public class Thing<T> {
         // Ok just wanted to check
         // does not compile (but specs says page 12 : should be unchecked WARNING!)
         //  T[] table = new T[25] ;
         // compiler says unchecked cast to type T !
         T[] table = (T[]) new Object[25] ;
    sorry : must be trivial but I do not get why the compiler (1.5.0) balks at new Object[x] ....
    is there a way to create an array of T?
    is that bad doctor?

    Why would you want to do that?
    private T[] table = new T[25];
    why not? (... though I admit it is not permitted by the spec
    so I bow out gracefully -BTW why is this absurd? is the compiler unable to generate appropriate code
    at compile time?)
    ok main point is about compiler still complaining at new Object[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Multiple Animations for a single MovieClip sprite

    Ok, after hours of exhausting searching, and having to learn how to animate a simple sprite for the 100th time, I hope I might found I more specific, and better explained answer to my problem.
    I'm trying to make a flash game, of course, and I want my main Player sprite to be able to play multiple animations based on specific input. So, a running right animation, a running left animation, a jump animation, and an attack animation.
    At the moment, the most I can seem to achieve is to create a single timeline, with a default frame in the exact middle. Then when player holds left, it plays the previous frame, or scrolls backwards through the timeline. When the Right key is held, it plays forward from the default middle.
    It's ugly and extremely limited. I've tried using the gotoAndStop() and gotoAndPlay() methods, but because the statement checking for the key being pressed is constantly being checked, it will stay on the frame chosen for those methods, rather than move forward along the time line.
    I would greatly appreciate a better method for this, or a more specific tutorial to achieve the goal i'm looking for.
    I've seen mention of the attachMovie() method, but I can not find an understandable explanation of how to properly use it in the way I desire.
    essentially, the sprite will have the default standing frame while no keys are pressed. Then, if the right key is down, it plays the running right animation. When the left key is down, it plays the running left animation. When the jump key is pressed, it plays the jump animation. And when the attack key is pressed, it plays the attack animation.
    I hope that's enough information and that it's understandable, if not, let me know what more you need to know and I'll do my best to explain it more.

    You can do this a number of ways but I will try to explain the what I think is the easiest.
    Step 1
    Draw a box on the stage
    Step 2
    convert this into a movieclip (F8), name this myCharacter (or anything you want really), then press ok. Now select this movieClip and in the properties dialogue box, type "box", again, without the quotes. Then press enter.
    Step 3
    Double click this new movieClip (this should take you into this movieClip timeline)
    Step 4
    Now press F6, 3 times. This wil give you 3 additional key frames on this timeline. You should now have 4 key frames.
    |Step 5
    Select key frame 1 on this timeline and press F8. Type into the diag box "standing", without the quotes. Then select the Movie Clip radio button, if it is not already selected.
    Step 6
    Step 12
    Make sure  your library is in view, if not Ctrl+L. You should see the movement clips you created, running_right, running_left, etc. Double Click any one of these and add the animation your want in these movs.
    There we go, simples.....Test you animation and see how you are doing.
    Select key frame 2 on this timeline and press F8. Type into the diag box "running_right", without the quotes. Then select the Movie Clip radio button, if it is not already selected.
    Step 7
    Select key frame 3 on this timeline and press F8. Type into the diag box "running_left", without the quotes. Then select the Movie Clip radio button, if it is not already selected.
    Step 8
    Select key frame 4 on this timeline and press F8. Type into the diag box "jumping", without the quotes. Then select the Movie Clip radio button, if it is not already selected.
    Great, once you have done this, these new movieClips should now have appeared in your library (press Ctrl+L if you cannot see your library)
    Ok then you have just created your movement MovieClip. You now need to get back to the main timeline. You can just keep on clicking the stage to get back to this location. Once there you need to select the box you have just created and name this "box" for the time being.
    Ok then a little bit of programming now.
    Step 9Create a new layer in the timeline and name it scripts.
    Step 10Then select this layer and press F9 on your keyboard. THis should bring up the scripting pane for this frame.
    Step 11Type in the following code
    box.stop();// when you run this animation, this command will stop your box from doing anything
    var keyBoardListener:Object = new Object();// Creates a new Object for the keyboard presses
    keyBoardListener.onKeyDown = function() {
    if (Key.isDown(Key.LEFT)) {// runnning LEFT action
      _root.box.gotoAndStop(3);// Frame where the running right animation is
    } else if (Key.isDown(Key.RIGHT)) {// running RIGHT action
      _root.box.gotoAndStop(2);// Frame where the running right animation is
    } else if (Key.isDown(Key.UP)) {// JUMPING action
      _root.box.gotoAndStop(4);// Frame where the JUMPING animation is
    keyBoardListener.onKeyUp = function() {
    _root.box.gotoAndStop(1);// When the keys are released, this action takes your animation back to frame 1, where your character is just standing still.
    Key.addListener(keyBoardListener);// this assigns the listener to your key press detection Object.
    Step 12
    Edit the action movs within your library by double clicking each one and adding movement to each. Then test your animation.

  • Can we Automate User Creation in SAP IDES?

    Hey Guys,
    I found this piece of information on Internet somewhere.
    "SAP provides a simple user creation mechanism for IDES system. An enhancement is already active by the name USRADMIN this contains code that executes just after the user logon. If somebody logs on as 'MUSTER' with password 'IDES' it prompts to create a user. and after the creation MUSTER is logged off. If the password of MUSTER is changed the program also reset the password to IDES always. the password is hard coded in the code
    For this to be active an entry has to be maintained in the table zides_user_procc . In this table we maintain the SAP system SID, client where this functionality is to be active and also maintain the reference user which will be copied to the new user ."
    *bol

    It was a while back, but the logic was like this:
    User logs into webpage on intranet.  Lets just say that authentication to that resource is dealt with separately here.
    User is presented with a form and fills in info like
    UserID required
    FirstName
    LastName
    email address
    Password
    This info is used by some backend VB code which initialises an RFC connection with SAP.
    Once RFC is established, a function module to copy an existing template user is executed (template user contains roles to copy etc).  The new user is created as required and you can then log on & use it.
    To be honest, most self service sandbox systems tend to be the log in using existing user & create yourself a user or run a prog which will do it for you.
    Hope that helps,
    Cheers
    Alex

  • Character (sprite) animation

    What is the best way to handle character animation on the iPhone.
    Is using the UIImageView method the best to handle simple sprite animation using a number of PNG's.
    Is there a limit to the number of PNG images you should use?
    Also what is the best way to handle simple effects like zoom and pan, on a block of animation?
    Can a block of animation follow a curved path. e.g. a character walk cycle moving over a hill.
    I appreciate any response. I have a background in 2D animation and need some direction to how best to create animations on the iPhone and also what limitations I am up against.
    Thanks, Steve

    Okay, that is something different. I misunderstood what you meant by 'animation'.
    Moving 2D sprites in a game is done by creating a virtual model of the game world in the code that represents game objects by their positions in 2D space and their "movement" as a numerical velocity vector that specifies the number of pixels that the object should move per unit time. Time is simulated by updating the objects' position and redrawing the screen at some fixed time interval (the frame rate) determined by a timer.
    Here is a simple ball animation sample that assumes you have a 48x48 pixel image named ball.png. It creates a UIView subclass that should be loaded by the AppDelegate class.
    The header:
    #import <UIKit/UIKit.h>
    typedef struct
    CGFloat x;
    CGFloat y;
    } Vector2D;
    typedef struct
    Vector2D position;
    Vector2D velocity;
    } Sprite;
    @interface GameWorld : UIView {
    Sprite ball;
    UIImageView *ballImage;
    @end
    and the implementation:
    #import "GameWorld.h"
    #define kDotRadius 24
    @implementation GameWorld
    - (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
    [UIApplication sharedApplication].statusBarHidden = YES;
    ball.position.x = 200.0;
    ball.position.y = 300.0;
    ball.velocity.x = 3.0;
    ball.velocity.y = -3.0;
    ballImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ball.png"]];
    [self addSubview:ballImage];
    [NSTimer scheduledTimerWithTimeInterval:(1.0 /30.0) target:self selector:@selector(update) userInfo:nil repeats:YES];
    return self;
    -(void)update {
    if(ball.position.x - kDotRadius <= self.bounds.origin.x || ball.position.x + kDotRadius >= self.bounds.size.width)
    ball.velocity.x *= -1.0; //negate to reverse direction
    if(ball.position.y -kDotRadius <= self.bounds.origin.y || ball.position.y + kDotRadius >= self.bounds.size.height)
    ball.velocity.y *= -1.0;
    //commit to changes
    ball.position.x += ball.velocity.x;
    ball.position.y += ball.velocity.y;
    [self setNeedsDisplay];//refresh the view
    - (void)drawRect:(CGRect)rect {
    ballImage.center = CGPointMake(ball.position.x, ball.position.y);
    - (void)dealloc {
    [super dealloc];
    @end
    So it is the UIImageView's center property that is used to create the movement of the image view across the screen. This could be done directly, but the use of C structs (Vector2D and Sprite) make the code easier to read. The center property is updated only at the moment when the screen redraw occurs.

  • If anyone has a simple iPhone application for share ?

    if anyone has a simple iPhone application with teaching comments for share and he can post it here for the begginer developers, Thanks for help.

    Just search the web.  There are lots of tutorials for the beginner.  http://sptci.com/products/articles/iPhoneSDK.pdf had a very simple app creation tutorial at the end.  It should still work, althought that was created a few years ago.

  • Simple Keyboard input?

    I am a new programmer trying to create a simple keyboard input for a Jframe, if that is possible. Here is a simple jframe creation:
        public static void main(String[] args) {
            JFrame frame = new JFrame("Keyboard input");
            frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
            // make window visible
            frame.pack();
            frame.setVisible(true);
        If I wanted to make a class that would put a ball in the frame and have the ball move up, down, left, or right according to which arrow keys were pressed and held- how would I do that?
    Thanks for your help,
    Sam

    See classes KeyListener and KeyAdapter
    And reed the Manual

  • J2me sprite animation

    Could someone please help me? I need a simple j2me program. I needed to display on my phone a simple sprite animation.
    Thank you!!!

    No. We realise that would make it easy for you, whichis precisely why we are not going to do it.
    jugheadwhat exactly is that supposed to mean? Go on then, give him some 'sample' code, that will really help him learn. The ONLY way to learn is to teach yourself, and build associations for yourself. If you just use someone else's code (and sample code will just be used like that), then how are you going to do that?

  • Coding the "List" Flash Component

    Hello,
    I’m designing a simple list creation\editing
    application I was wondering where I can get information on coding
    the “List” Flash Component in Director MX 2004.
    I’ve got as far as finding out how change what is on the list
    using “.data” and “.labels”, but I want to
    be able to tell what the user selects from the list.
    Thanks for your time

    You can use an on change function in a behavior attached to
    the flash
    sprite.
    property thisSprite
    on beginSprite me
    thisSprite = me.spriteNum
    sprite(thisSprite).labels = ["one","two","three"]
    on change me
    put sprite(thisSprite).selectedItem.label
    end
    -- "one"
    Rob
    Rob Dillon
    Adobe Community Expert
    http://www.ddg-designs.com
    412-243-9119
    http://www.macromedia.com/software/trial/

  • New user with several questions on forms and useage.

    Once a user fills out a form, is there a way to make the data in the text fields un-editable?
    While I'm here, on the same form there are several fields that are required to be filled out. Is it possible to prevent the user from being able to save the form before they fill out the required fields?
    I have an Excel file that when opened asks the user for certain data and automatically puts the entered data into the required cells using VB. Is it possible to do the same in Adobe?
    Been using Acrobat for years, but my company only uses it for simple pdf creation and maybe putting stamps on customer supplied files, so these probably seem like simple questions.
    By the way this is on Acrobat 8 Pro.
    Thanks for any help!

    Once a user fills out a form, is there a way to make the data in the text fields un-editable?
    Yes. The best is by using a digital signature. Second best is by using a script to set the fields as read-only at some point.
    Is it possible to prevent the user from being able to save the form before they fill out the required fields?
    No. You can set fields as required but that only applies when the file is submitted. You can display an error message when the file is being saved if some of the required scripts are not filled-in (using a script), but you can't prevent someone from saving the file.
    I have an Excel file that when opened asks the user for certain data and automatically puts the entered data into the required cells using VB. Is it possible to do the same in Adobe?
    Yes, that's possible. Again, using a script.
    By the way this is on Acrobat 8 Pro.
    This is quite an old version, not compatible with any current operating system. You should consider upgrading...

  • How can I convert my animation into a working movie clip that can be used with a new scene?

    Hello all,
    First and foremost, I AM A TOTAL FLASH NOOB. I want to preface this and make it incredibly clear how new this all is to me. I LITERALLY started using flash this morning; that is precisely how new I am.
    With that being said I am going to do my best to explain what I'd like to do.
    I have created an animation of a spider moving its legs back and forth. I want to be able to combine all of the layers into 1 simple animation that can be imported into new flash scenes with the animation exactly how it stands. I have figured out how to convert the whole animation into a symbol AND I have figured out how to import the movie clip from the library. However, herein lies my problem. When I open a new flash scene and import my animation, I play it and it does nothing at all. It's just the static image of the spider I created with no movement.
    I've spent the last couple hours trying to figure out (and doing my own research) what I have done or didn't do to get to this point. I'd be willing to bet I am just going about the entire process incorrectly and I'm simple overlooking a basic facet of the program.
    Any insight to fix my ignorance is greatly appreciated.
    (P.S. Hell, I don't even know if I am using the correct terminology so for all I know I am confusing every person who has taken the time to look at my question. If I am using incorrect terminology please correct me to avoid future hang ups. Thank you.)

    Ned! This totally worked! Thank you! I knew there was a tiny piece of this whole thing that was preventing me from making everything work. Unfortunately as my luck would have it, although I have the movieclip working the spritesheet converter I'm using now no longer recognizes the movie clip. The converter says there are 7 frames in the animation, but doesn't display any working sprites. Just a blank sheet. Frustrating to say the least.
    I'm just going to throw everything out on the table here:
    This is the video tutorial i'm using to convert my animation into a spritesheet. I've done the steps exactly as directly up until the point I actually click "Begin Conversion." When begin conversion is selected, it shows the movieclip exists on the bottom left underneath "list of movieclips" but doesn't actually show any individual sprites.
    Here's the simple sprite converter I am using.
    The irony of this whole situation is that you have successfully helped me make a working movieclip (which was the important piece), but the converter no longer recognizes it. Whereas before, it would at least show the image on the 1 frame of animation it had.
    If you wanted to to take a stab at it and see if you can successfully get it to work I'd be appreciative. If not, I totally understand as you have already been incredibly helpful and have my eternal gratitude for getting me this far. These animation programs can be quite overwhelming when they so vastly differ from one another. Don't even get me started no Anime' Studio Pro.

Maybe you are looking for