How to dynamically create a movieclip of an image

Hi there !
Im Java developer in transition to AS3, my task is to create one of those spaceship games ( beathazard / asteroids style ) but im already being destroyed by the differences between these languages.... im trying to make this game completely through AS3, in other words, trying to evade manual setup as much as possible, at this moment, im trying to create my spaceship (an instance of my SpaceShip class), my background (instance of my Scenary class), my bullets (instance of Bullet class) and my game ( Game class ).
The first problem im having is that i cant seem to make the ship find its sprite while executing its  constructor so i can create a new instance of it and add it to my game (actually, my scenary).
Any ideias of how to do this ?Im using this constructor :
public function Nave() {
var imgLoader : Loader = new Loader();
               imgLoader.load(
new URLRequest("../img/normalShip.png"));
this.addChild(imgLoader);}
and then just creating an instance of this ship on my game and adding it as a child of my game.
Thanks in advance ! Any advice will be very welcome !!!

If you want to add the loaded image to a MovieClip or Sprite, you need to wait until the image is loaded before doing so.  To wait for it you assign a COMPLETE event listener to the contentLoaderInfo property of the Loader.  Once it is loaded you can have the event handloer function process the Loader.content (the image) into whatever object you plan to have it in.

Similar Messages

  • How to dynamically create a treeview in sharepoint using javascript or jquery

    How to dynamically create a treeview in sharepoint using javascript that displays spsites ,spweb,splist

    Hi,
    In SharePoint 2010, we can customize web service and use Server Object Model to get all the SharePoint sites, webs and lists, then call the web service using jQuery and using the jQuery Treeview plugin to display the data.
    The following articles for your reference:
    Walkthrough: Creating a Custom ASP.NET Web Service
    https://msdn.microsoft.com/en-us/library/office/ms464040%28v=office.14%29.aspx?f=255&MSPPError=-2147217396
    Using Jquery to call an ASMX service in sharepoint 2010
    http://stackoverflow.com/questions/9035539/using-jquery-to-call-an-asmx-service-in-sharepoint-2010
    jQuery-ui Treeview
    https://plugins.jquery.com/btechcotree/
    Best Regards,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How set dynamically created query in GridControl?

    How set dynamically created query in GridControl?
    Thank you

    If your dynamic query is based on an Entity object, then you can probably use RowSetInfo setQueryInfo method.
    The argument to this method is a 'Query' object. There are three flavours provided in the oracle.dacf.dataset
    package.
    oracle.dacf.dataset.QueryViewInfo
    defines an updateable SQL query based on a predefined BC4J View Object.
    oracle.dacf.dataset.QueryStatementInfo
    Creates a view object based on an arbitrary SQL statement.
    oracle.dacf.dataset.QueryInfo
    Creates a View Object from an Entity Object and additional SQL clauses. The View Object will have
    that Entity Object as its sole Entity Object base.
    If in your application you are able to specify the name of the entity, then you can use the QueryInfo method to define your
    query. Please try the following.
    SessionInfo si = ....
    void runDynamicQuery()
    RowSetInfo rsi = new RowSetInfo();
    AttributeInfo ai = new AttibuteInfo(..);
    ai.setName(..);
    rsi..addChild(ai);
    si.addChild( rsi)
    rsi.setQueryInfo( new QueryInfo( ...../* include entity name */ .... ));
    rsi.setName(....);
    rsi.open(true);
    grid.setDataItemName(...);
    Hope this helps,
    Sathish.

  • How can I create a link on an image?

    How can I create a link on an image?

    Select your image and in the hyperlinks tool on the toolbar simply type in your site address you want to link to. be sure to include the http:// before the domain name.

  • How can I create a black and white image similar to what I see in the "Replace Color" tool?

    Hi all, I'm just wondering how I can create a black and white image similar to what I see in the preview window of the "Replace Color" tool. See attached screenshot for clarification -- I need the grass to be black while the soil is white or vice versa. Any tips?

    One way is to use Select>Color Range
    Make a new Color Fill Layer>White
    (Layer>New Fill Layer>Solid Color)
    Put a new color fill layer below>black
    Just invert the layer mask on the top fill layer for the opposite effect.

  • How to dynamically create sqlldr control file using stored procedure

    I am trying to dynamically create the control file (.ctl) and execute the same using a stored procedure.I would be passing the file name as a parameter to this procedure. How do I go about doing this?
    The control file has the following structure. The file name (mktg) varies and is passed as an input to the stored procedure.
    SPOOL mktg.ctl
    LOAD DATA
    INFILE 'mktg.csv'
    INTO TABLE staging
    FIELDS TERMINATED BY ','
    TRAILING NULLCOLS
    (COMPANY_NAME,
    ADDRESS,
    CITY,
    STATE,
    ZIP)
    SPOOL OFF ;
    sqlldr scott/tiger CONTROL= mktg.ctl LOG=mktg.log BAD=mktg.bad

    We are using oracle 9i rel 2.
    I have not had much success with the creation of log and bad files using external tables when they are being used within a dynamic sql.
    Plz check this:
    Re: problems related to data loads from excel, CSV files into an oracle 9i db

  • How to dynamically create header record in a file

    Hi All,
    how can we create custom header in data file. i have interface that creates file dynamically and Generate Header is set to true. The file header contains the column names. i want to create different file header like FileName_noOfrows_currentDate .how can i do this
    example... header_15_20121213
    Thanks
    Edited by: huny on Dec 19, 2012 4:53 AM

    Hi
    Please refer to this post :
    How to Add Header and Footer in Flat file
    You should find some advices and clues to create your custom header.

  • How to dynamically create a JSF dataTable from a String[][] array

    Hi, I�m developing an application that uses columns, rows and data instead of any other attributes, so I got from a database Resultset a String[] array with the rows headers, other String[] array with the columns headers, and a String[][] array with the information between every row[] and column[] header al this String arrays depend on a method that receives the group title as a parameter so they are dynamically created, anyway I can display this information in a jsp page but I don�t know how to display this information in a JSF dataTable.
    Does anybody knows how I could do this? and which is the proper way to create a dynamically rows and columns dataTable?

    Hi, I�m developing an application that uses columns, rows and data instead of any other attributes, so I got from a database Resultset a String[] array with the rows headers, other String[] array with the columns headers, and a String[][] array with the information between every row[] and column[] header al this String arrays depend on a method that receives the group title as a parameter so they are dynamically created, anyway I can display this information in a jsp page but I don�t know how to display this information in a JSF dataTable.
    Does anybody knows how I could do this? and which is the proper way to create a dynamically rows and columns dataTable?

  • How do I create a collectio from developed images in the develop module of Lightroom 5?

    How do I create a collestion of developped and modified images in the develop module of Lightroom 5

    Right-click on Tone Curve and choose basic again or press Ctrl+1 in Develop.
    On Mac (Control-Click or Cmd+1)

  • How can i create a .mov file from image sequence with different durations

    how do u create an image sequence with different durations? image one stays for 10 seconds and image two may stay for 30 and so on. each one has a custom duration. can this be done with an apple script or a text file saved as an mov file?

    Hello Omar,
    The example code Programmatic Printing of TestStand Reports - Modular contains a sequence that will convert an XML file to an HTML file given the XML file's path and the path to the stylesheet.  It may need to be altered to fit with the modifications you have already made to the report generation routines, but I think it should definitely get you off on the right foot.  Let me know if you have any questions!
    NickB
    National Intruments

  • How to dynamic create Select SQL statements.

    Hi frnds,
    I want to make a SELECT statement in which all values I will get dynamically. Like i have two fields on selection screen, one for table name and one for field name. Now I need to make my ITAB according to the table selected and field name selected. So finally my ITAB will be having the field which I chosen from selection screen.
    Now how can I make a dynamic ITAB and how to create a dynamic SELECT statement?
    It wud be great if you can help me.
    Thanks
    Arpit

    Here is a sample program....
    This will get you started in programming a dynamic internal table as well as dynamic select.
    report zrich_0002.
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>,
                   <dyn_field>.
    data: alv_fldcat type slis_t_fieldcat_alv,
          it_fldcat type lvc_t_fcat.
    type-pools : abap.
    data : it_details type abap_compdescr_tab,
           wa_details type abap_compdescr.
    data : ref_descr type ref to cl_abap_structdescr.
    data: new_table type ref to data,
          new_line  type ref to data,
          wa_it_fldcat type lvc_s_fcat.
    selection-screen begin of block b1 with frame title text .
    parameters: p_table(30) type c.
    selection-screen end of block b1.
    * Get the structure of the table.
    ref_descr ?= cl_abap_typedescr=>describe_by_name( p_table ).
    it_details[] = ref_descr->components[].
    loop at it_details into wa_details.
      clear wa_it_fldcat.
      wa_it_fldcat-fieldname = wa_details-name .
      wa_it_fldcat-datatype = wa_details-type_kind.
      wa_it_fldcat-intlen = wa_details-length.
      wa_it_fldcat-decimals = wa_details-decimals.
      append wa_it_fldcat to it_fldcat .
    endloop.
    * Create dynamic internal table and assign to FS
    call method cl_alv_table_create=>create_dynamic_table
                 exporting
                    it_fieldcatalog = it_fldcat
                 importing
                    ep_table        = new_table.
    assign new_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
    create data new_line like line of <dyn_table>.
    assign new_line->* to <dyn_wa>.
    * Select Data from table.
    select * into corresponding fields of table <dyn_table>
               from (p_table).
    * Write out data from table.
    loop at <dyn_table> into <dyn_wa>.
      do.
        assign component  sy-index  of structure <dyn_wa> to <dyn_field>.
        if sy-subrc <> 0.
          exit.
        endif.
        if sy-index = 1.
          write:/ <dyn_field>.
        else.
          write: <dyn_field>.
        endif.
      enddo.
    endloop.
    Regards,
    Rich Heilman
    Message was edited by: Rich Heilman

  • How to dynamic create Splitter Bars

     just like  this  user interface
    Attachments:
    bar.JPG ‏178 KB

    I'm confused by the title of this question. What is it that you want to do dynamically?
    Hi Michael,
    May be I'm wrong (as you can notice my mother tongue is not English) but my interpretation of Mike's question is "What are splitter bars ?" and not "How can I dynamically add a splitter bar to a FP ?" Only Mike could confirm if this was his original question...
    Unfortunately, I don't know how to create a splitter bar programatically, and even more, I'm afraid that this is not possible. So my aim was only to answer to what seemed to be the source of Mike's confusion.
    This being said, I hope that Mike's and your confusion left !
    Message Edité par JB le 05-29-2007 02:04 PM

  • How to dynamically create sql statement for Defaulting Segment Values?

    Hi,
    Navigation:
    1) Descriptive/Segments
    2) Query for DFF to be modified
    3) Uncheck “Freeze Flexfield Definition”
    4) (B) Segments
    5) Segments Summary form opens
    6) (B) open - Segments form opens
    Now, here I want to specify Default type as "SQL Statement" and in the default value field I want to use SQL statement with parameters (to evaluate the default value).
    The parameters should be pass at runtime from the form in which we have this DFF. The parameters value should be one of the values which get evaluated at runtime in the form window.
    Please suggest how we can achieve this?
    Or is there any alternative to achieve this?
    Thanks!!
    Regards,
    Narender
    Edited by: Narender Singh on Mar 30, 2010 7:47 AM
    Edited by: Narender Singh on Mar 30, 2010 7:48 AM

    Jason,
    it is possible, though not so simple as with a report.
    What you need to do is to create a pipelined function, that returns your date and count data. This pipelined function can be the base of a pseudo-table, which can be used in a select. For the pipelined function you need to define types for one row and a table to define the return-type for your function:
    create or replace type calendar_row as object (date_time date, description varchar2(250));
    create type calendar_table as table of calendar_row;
    Then you can create the package with the function:
    ================================================
    create or replace package dyn_calendar is
    procedure set_query(i_query in varchar2);
    function view_source return calendar_table pipelined;
    end;
    create or replace package body dyn_calendar is
    v_query varchar2(100) := null;
    procedure set_query(i_query in varchar2) is
    begin
    v_query := i_query;
    end;
    function view_source return calendar_table pipelined is
    TYPE cursor IS REF CURSOR;
    c_cal cursor;
    v_date_time date := null;
    v_description varchar2(100) := null;
    r_cal calendar_row;
    begin
    open c_cal for v_query;
    fetch c_cal into v_date_time, v_description;
    loop
    exit when c_cal%notfound;
    r_cal := calendar_row(v_date_time, v_description);
    pipe row(r_cal);
    fetch c_cal into v_date_time, v_description;
    end loop;
    return;
    end;
    end;
    ================================================
    Now you can set query in a PL/SL region before the calendar:
    dyn_calendar.set_query(SELECT count(*), ' || :P8_SOURCE_DATE || ' FROM ' || :P8_SOURCE_TABLE || ' GROUP BY ' || :P8_SOURCE_DATE);
    and you can base your calendar on the query:
    select * from table(dyn_calendar(view_source))
    Good luck,
    Dik

  • How to dynamically create a table to join with

    I have a table of users and when they should submit time sheets: start date and end date.
    I have a table of timesheets with user ID and week-ending date.
    I need to construct a report of which timesheets are missing this year.
    I effectively need a table of week-ending dates for the year to join with the user and table and filter on start/end dates - and derive a list of week-ending dates for which I expect to see timesheets.
    But I donu2019t have write-access to the database: Can I effectively create a local table with the week-ending dates for the year?
    We currently solve it by using a local Excel file. Is that the most efficient way? It is also a nuisance as we have to edit the report and copy the excel file when we move directories.
    2nd question on the forum
    Mike

    Mikecro,
    Trying to actually write a SQL script of any complexity in the Command window itself is a horrible experience. I'd recommend writing your SQL in SSMS and testing it there. Once you have the script written in SSMS and it producing the desired result set you can then copy and paste it into the CR Command. (Just use hard coded dummy parameters in SSMS and replace them once they're pasted into the command.)
    If you are building "canned" reports that will ship with a software package, I'd recommend building it out as a stored procedure (and the same with any other reports). This will also make future support much easier by allowing you to make any modifications to the data set directly on the SQL Server without having to touch CR or CRS.
    If you're acting as a 3rd party consultant and you don't have the access or authority to add SP objects to the SQL Server then sticking with the Command is going to be your best bet. This is still better than using linked tables IMO.
    #1) CR simply lacks the ability to write SQL with any real level of complexity. It can't even create a simple sub-query.
    #2) It looks more professional. From an end users pov a report that uses a sql command, as opposed to linked table, demonstrates that the report developer is of a more advance skill level.
    #3) Most of your clients won't know how to write SQL themselves so they will need to re-engage your services to take care of any existing reports and to build new ones. It's easier to get repeat business than it is to get new business.
    As you've already seen, getting everything into a single, well written, SQL command can make a dramatic improvement in report performance. If you get in the habit of building all of your reports using SPs, Views or Commands, you'll quickly come to appreciate added flexibility it affords you. Once to modify your report building workflows to accommodate the change, you won't even think about going back.
    HTH,
    Jason

  • How to dynamicly create a field name AND access it

    All,
    I am trying to build a code block that will access what amounts to a table structure inside a table. I have 38 occurances if a set of 3 fields. (Source system had an internal array/occurs clause that was converted for our ODS into individual fields) I am returning a single row as a row type and have addressability to all fields. What I am trying to avoid is coding my logic block 38 times, 1 for each occurance.
    FOR X IN 1 .. 38 LOOP
    V_CAT_CD_X := 'CAT_'||X||'_CD';
    End Loop;
    The following is the display of the correctly built field:
    --> Loop Cat CD: CAT_1_CD Rec count:1 Loop counter:1
    --> Loop Cat CD: CAT_2_CD Rec count:1 Loop counter:2
    --> Loop Cat CD: CAT_3_CD Rec count:1 Loop counter:3
    --> Loop Cat CD: CAT_4_CD Rec count:1 Loop counter:4
    My problem is that my row cursor PP1 is addressable hardcoding PP1.CAT_1_CD or PP1.CAT_2_CD ect, however I am having problems using my created string to access the field.
    What do I need to do to gain accessability via this method?
    I do have the ability to select the column names from the system tables but even then, I am lacking addressability to my ROW type using the selected field name.
    Thanks
    Greg

    Not sure if this is what you are looking for:
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2  my_cur SYS_REFCURSOR;
      3  v_rec mytest%rowtype;
      4  cursor c1 is select column_name from all_tab_cols where table_name = 'MYTEST';
      5  v_sql_stmt VARCHAR2(1000) := NULL;
      6  BEGIN
      7  v_sql_stmt := 'SELECT ';
      8  FOR I IN c1 LOOP
      9  v_sql_stmt := v_sql_stmt||I.column_name||',';
    10  end loop;
    11  v_sql_stmt := RTRIM(v_sql_stmt,',');
    12  v_sql_stmt := v_sql_stmt||' FROM mytest';
    13  open my_cur for v_sql_stmt;
    14  LOOP
    15  FETCH my_cur INTO v_rec;
    16  EXIT WHEN my_cur%NOTFOUND;
    17  dbms_output.put_line(v_rec.a);
    18  END LOOP;
    19 close my_cur;
    20* end;
    SQL> /
    1
    2
    PL/SQL procedure successfully completed.
    SQL> Edited by: AP on Nov 17, 2010 5:29 AM

Maybe you are looking for

  • How do I set up my ipod if it is locked

    My ipod's battery broke a while back. I set it to be fixed(not by apple) when i got it back, It told me it needed to be restored and updated to ios 5.1.1 . So I did. But then it said that my itunes should recognize my ipod when it restarted. but it d

  • Steps to Create Database manually.

    Dear All, I need steps to create database manually. How to create password file & database. Aqeel Nawaz

  • Snow Leopard and Screen sharing question

    I followed the information in this article to use screen sharing between 2 SL computers and I can make the basic SS work.  However, two items from this article don't function as described.  It is an older article and I'm asking to see how it still ap

  • ITunes won't launch on Windows 8

    Hi, I upgraded to an HP Win8 box a few weeks ago. At the time, iTunes10 worked fine. Then it wouldn't launch - error with file dsennh.dll. I tried uninstalling, dowloading clean version of 11, & re-installing, but I am still getting the error message

  • Validate string to verify it is (probably) a phone number

    What would I do in expression editor to validate that a string meets the basic constraints for a North American phone number? All I care do at this point is compare the entered string and make sure it matches this pattern: [2-9]XX[2-9]XXXXXX Thanks m