[AS3] Crear múltiples variables con un for

A los buenos días!
Llevo tiempo dándole mil vueltas al tema, y no consigo
dar con la
solución....
var foto1:Sprite;
var foto2:Sprite;
var foto3:Sprite;
var foto4:Sprite;
var foto5:Sprite;
var foto6:Sprite;
asi hasta 24, 100 o másss Sprites...
¿Como podría hacer esto mismo con un for en solo
tres líneas?.
Un saludete...
J.R. León

Ya tengo palabras Juan jejeje.
Ya me he caido del olivo, y todo con una sencilla frase de un
compi: que mas
te da tener 100 líneas que 10000 líneas.., mientras
funcione vas bien jeje.
Mi problema es el de siempre soy autodidácta en este
mundo de los 0 y 1, y
en los últimos 6 años, me ha tocado pasar mas horas
discutiendo con el
cliente con que si tal o tal foto, lo que ha llevado a que la
programación
la había dejado un poco aparcada..., pero bueno ahora ya
estoy
recuperándome, y tengo ganas de subir a la red el
proyecto en el que ando,
para que entiendas el porque de tanta "ansina" por ahorrar
líneas jeje.
Un saludete,
J.R. León
"Jose Ramon Leon" <[email protected]>
escribió en el mensaje
news:[email protected]...
> Me has dejado, simplemente sin palabras...
>
>
> "Juan Muro" <[email protected]> escribió en
el mensaje
> news:[email protected]...
>> Hola Hóze: ¿Qué tráeh de
güeno hermano?
>> Pa creal lah múrtipre variableh pues usal un
bucle for in tal que ansina
>> (es que a los extremeños nos han dado una
wikipedia, con dos cohone, la
>> de tonterías que hay que ver. Bueno ya lo
dejo):
>>
>> var i:Number;
>> var mifoto:Sprite=newSprite("foto"+i);
>> for(i=0; i<100; i++){
>> trace("foto"+i);
>> }
>> Ya ves que si cortas y pegas este código en el
primer fotograma y
>> publicas la peli te salen los 100 primeros nombres
de tus variables,
>> ahora bien, una cosa es que estén creadas las
variables y otra diferente
>> es que el hijollasbrón del compilador sepa de
qué tipo son (a pesar de
>> que en la segunda linea le decimos que son sprites y
de que su nombre
>> indica que van contener fotos, ya sabes lo estricto
que se pone), porque
>> el pobre a veces se lía, sobre todo cuando
tenemos varias clases
>> vinculadas o referenciadas, así que es muy
posible, aunque no siempre
>> necesario, que en tu clase personalizada, para
aclararle el tema, debas
>> poner una linea de código más:
>> var mifoto:Class = getDefinitionByName("foto"+i) as
Class;
>> que significa: Oye, mamón, cuando te encuentres
una variable cuyo nombre
>> sea "foto"+i ¡¡¡ES UN SPRITE
VINCULADO COMO CLASE EN LA BIBLIOTECA DEL
>> ARCHIVO FLA, coño ya!!!
>>
>> Salu3 (de AS3)
>> `8¬]
>> Juan Aversitelimpiaslalengua Muro
>>
>> "Jose Ramon Leon" <[email protected]>
escribió en el mensaje de
>> noticias news:[email protected]...
>>>A los buenos días!
>>>
>>> Llevo tiempo dándole mil vueltas al tema, y
no consigo dar con la
>>> solución....
>>>
>>> var foto1:Sprite;
>>> var foto2:Sprite;
>>> var foto3:Sprite;
>>> var foto4:Sprite;
>>> var foto5:Sprite;
>>> var foto6:Sprite;
>>>
>>> ....
>>> asi hasta 24, 100 o másss Sprites...
>>>
>>> ¿Como podría hacer esto mismo con un
for en solo tres líneas?.
>>>
>>> Un saludete...
>>>
>>> J.R. León
>>>
>>>
>>>
>>
>
>

Similar Messages

  • What's the maximum size a varchar2  variable can hold for and NDS Stmnt?

    What's the maximum size a varchar2 variable can hold for and NDS Statement? I read that NDS is good for doing EXECUTE IMMEDIATE on statements that aren't too big. The 10g PL/SQL manual recommends using DBMS_SQL for statements that are too large, but it never gave a limit for what too large was. Does anyone know offhand?

    The limit is the same as the length of varchar2 variable within PL/SQL - that is varchar2(32767).It's not documented, but intermediate concatenation result can hold up to (64k-1) :
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    declare
      part1 varchar2(32767) := rpad('begin null;', 32767);
      part2 varchar2(32767) := lpad('end;',        32767);
    begin
      dbms_output.put_line(length(part1 || ' ' || /*' ' ||*/ part2));
      execute immediate part1 || ' ' || part2;
    end;
    65535
    PL/SQL procedure successfully completed.

  • "Key and Text" values in variable selection list for a field

    Hi,
          we have created the variable for the one of the navigation attributes of the "0customer" field .
          for the customer field in BEX settings we are having "Text" as display.
          for the navigation field in BEX settings we are having "Key" as display.
          while running the reports in the variable selection list for some reports we having both KEY and text for selection and for others only text are displayed,
        we have checked the BEX settings in field and query level there are same.
    Please help us here.

    Check the setting again in the Query level and then maku sure you save it. Come out of the query and then re-open the query and execute, you can see the chages in the output.

  • Hidden variable but ready for Input - BEx

    Hello everyone,
    I wanted to know if it's possible to create a variable for selection screen in the BEx which is hidden but still ready for input.
    I guess that if I uncheck the option "Variable is Ready for Input" in the variable properties in BEx, I will have a variable which is hidden and can be manipulated in a SAP Exit function module. I don't want to manipulate the variable there but send a value through RRI to this report (where the Variable should be hidden). If I uncheck the option "Variable is Ready for Input" I cannot set this in the RRI settings because I don't see the variable since it is not ready for input
    Do you know a possible solution for this?
    Thanks,
    Carlos

    Hello Bob,
    Thanks for your fast answer. I got what you said, but it is not as simple as it is, for that reason I will describe the scenario a little bit more:
    Source query has:
    Variable: Key Date (Single, mandatory) -> InfoObject /APC/ACCTRADAT
    Key date means "all before that date" (defined in the extractor).
    Target query has:
    Variable: Transaction Date (selection Option, optional) -> InfoObject /APC/ACCTRADAT
    Transaction Date means "only that date" or "from one date to other date".
    If I send the date through RRI, the target query will think that the value it is getting is a single value, but it's actually a range (all before that date).
    For that reason I created a new InfoObject called Key Date for Recon. (/APC/RCTKEYDAT) with a single optional variable. I don't want to show the InfoObject as a free char because it makes no sence on it. So, depending on the variable I get, the extractor will decide either if it is a range or a single value. Any ideas?
    Regards,
    Carlos

  • Java.sql.BatchUpdateException: ORA-01027: bind variables not allowed for da

    Hi guys, I m facing a problem while executing below query .Query is working fine in toad i don't know what is the issue with the code
    <code>
    String url3 = "CREATE OR REPLACE VIEW Table2(PERIOD, YEARS, COST_CENTRE, S_DIR_PERM, S_DIR_CONT, S_INDIR_PERM, S_INDIR_CONT, O_DIR_PERM, O_DIR_CONT, O_INDIR_PERM, O_INDIR_CONT)AS select period, year, cost_center, sum(s_dir_perm), sum(s_dir_cont), sum(s_indir_perm), sum(s_indir_cont), sum(o_dir_perm), sum(o_dir_cont), sum(o_indir_perm), sum(o_indir_cont) from ( select b.period, b.year, a.cost_center, sum(a.perm_dir_hc) as s_dir_perm, sum(a.contract_dir_hc) as s_dir_cont, sum(a.perm_indir_hc) as s_indir_perm, sum(a.contract_indir_hc) as s_indir_cont, 0 as o_dir_perm, 0 as o_dir_cont, 0 as o_indir_perm, 0 as o_indir_cont from ZVHR_ACT_HC_ASOF_FISPRD a, pertable b where to_char(as_of_date, 'mm/dd/yyyy') = b.ENDPERIOD and shift not in ('G','N','O2','O7') and b.endperiod = ? group by b.period, b.year, a.cost_center union select b.period, b.year, a.cost_center, 0 as s_dir_perm, 0 as s_dir_cont, 0 as s_indir_perm, 0 as s_indir_cont, sum(a.perm_dir_hc) as o_dir_perm, sum(a.contract_dir_hc) as o_dir_cont, sum(a.perm_indir_hc) as o_indir_perm, sum(a.contract_indir_hc) as o_indir_cont from ZVHR_ACT_HC_ASOF_FISPRD a, pertable b where to_char(as_of_date, 'mm/dd/yyyy') = b.ENDPERIOD and shift in ('G','N','O2','O7') and b.endperiod = ? group by b.period, b.year, a.cost_center) group by period, year, cost_center";
    PreparedStatement statement3 = connection.prepareStatement(url3);
    statement3.setString(1, "12/10/2008");
    statement3.setString(2, "12/10/2008");
    statement3.addBatch();
    statement3.executeBatch();
    </code>
    i m getting the following error
    java.sql.BatchUpdateException: ORA-01027: bind variables not allowed for data definition operations
    can any1 help me with this.

    Can you explain what you are trying to do from a business perspective?
    If you are creating a view, it doesn't make sense to pass bind variables to that DDL statement. The view definition itself is going to have to end up with hard coded date values there. So what possible benefit is there to using bind variables?
    As an aside, if you are using bind variables and you have DATE columns, you really want to pass in the proper data type (i.e. setDate or setTimestamp rather than setString). Otherwise, Oracle has to do implicit string to date conversion, which depends on the session's NLS settings, which is likely to be different on different client machines and lead to all sorts of odd errors and behaviors down the line.
    Are you trying to build a view that takes parameters? If so, there are a few options for that sort of thing.
    Justin

  • Static variable is single for class or single for JVM

    Hello,
    I have doubt, static variable is single for class or single for JVM. as per my knowledge static variable is single for class, but suposse i have an web application (war of an application ) i deployed the application twice with different context, supose yahoo and yahoo1. but the ditrectory structure and classes are same, if i have a statc variable in
    a classof an application, if i change the static variable of one class of an application wether it will change the static value of the class of another application.
    Example
              yahoo -> web-inf ->      classes ->MainPackage->     MyStaticClass->     static int i=9;
              yahoo1 -> web-inf ->      classes ->MainPackage->     MyStaticClass->     static int i=6;
              if i change the static value i in yahoo application to i=5;
              at the same time if i access the value i in yahoo1 application what i will get (wether 5 or 6).
    Thanks.

    A static variable is 'single' in its class.
    A Class is 'single' in its ClassLoader.
    There can be many ClassLoaders per JVM.
    There can be many applications per JVM. Each one generally has its own ClassLoader.
    Ergo there can be many instances of a Class, and therefore many instances of its static data.

  • Variable data solution for full color variable inkjet printing

    Looking for a variable data solution for full color variable inkjet printing.
    Currently we use objective lune  / Planet press and it is not keeping up with the times...any adobe products that might be suitable??
    Thanks
    Everett

    Hi Everett,
    I am an employee of Objectif Lune and just stumbled upon this post.
    I am sorry to hear that you feel that way about PlanetPress.
    As we highly value feedback from our users to continuously improve our products, I would like to know why you think PlanetPress is underperforming so I can pass it onto our team. Please email me at [email protected] if you would like to share your frustrations.
    Thank-you and looking forward to hearing from you.
    Cheers,
    Nancy

  • AS3 alternatives to _global variable path?

    Hi, through out a very old complicated fla there are buttons which set variables using _global paths
    such as:
    function menu1_2(Event:MouseEvent) {
        global.mode = "hide_hotbox";
    MovieClip(this).gotoAndStop("stage_1_b");
    How can I make the variable "hide_hotbox" and others like it accessible and changeable from any movie clip -- whether they be nested in other movie clips or on the main timeline, etc?
    Thank you...(wits end)...extremely appreciated

    yes I will
    and post the code here
    in the meantime, I'm also going to ask as a side note on future threads: how can one keep up with scripting trends and expected actionscript changes?
    I just have one, very, very complicated website -- and otherwise work in CG, etc. most of my time...a few times a year I make graphical changes to this website but updating it from AS 1 to AS 2 and now AS 3 has been a heart stopping nightmare...I'm sure, absolutely confident, if and when I have a family and children I just will not be able to keep up this site...I plan to scale it down, but, how can one be sure to write code now which has a chance of lasting?  Are there trends and viewpoints within the Actionscript community which one could use to anticipate changes in AS 4.  I would have put my code on timelines rather than buttons and named all the buttons when I originally created the site in AS 1 if I had known I'd have to refamiliarize myself with the guts and bolts of this monster horrific site once again.  When I am senial, this site is dead...it is taking every neuron I have.
    sources used for research thus far:
    http://www.uza.lt/codex/as3-global-object/
    most elegant:
    http://www.kirupa.com/forum/showthread.php?p=2110832
    clear:
    http://www.websitemediaplayers.com/blog/global-variables-as3/
    thanks again

  • [AS3] reference to stage variable from MC

    Hi!
    At the begining I'm sory for my English ;)
    I've been coding in AS2 for a while, but now I decided to try
    AS3. The situation is like:
    - I've got one Movie Clip on a stage
    - I have a code in the 1st frame of the Main Timeline:
    var somevar:String = "somevalue"
    - I have a code in the 1st frame of the Movie Clip's
    timeline:
    trace(root.somevar) // error
    trace(parent.somevar) // error
    How to trace that variable?? The same is with stopping the
    Main Timeline's playback.
    parent.stop() and root.stop() don't work :(
    HEEELLLP MEEE! ;)

    (use the attach code option to display code in this forum):

  • Variable Substitution settings for Receiver File Adapter

    Hi All,
    I wanna use variables for File Name Sheme in the File Access Parameters.I had used by enclosing the variable names within %. When i wanna substitute values for those variables, it is given in the documentation(help.sap.com) that v need to set the Enable indicator. only after setting the indiactor, v can use the variables and can then enter the values for those variables in a table. but i can't see either the indicator or the table in my editor. how can i provide the values for the variables used in file name scheme/Target Directory. and for ur information,i'm using sp12.
    any help wud b appreciated.
    thnx
    Anil

    Hi Anil,
    Please check out the following link ...
    Re: Variable substitution - Pseudo Path Variable - file adapter
    Re: Variable substitution problem
    Regards,
    Raj

  • Not getting BI query variable selection screen  for few test users

    Hi,
    i am having problem when i am executing the reports. i am not getting variable screen for the test users ID's. but i am getting the screen when when 0BI_ALL authorization selected.
    i want role based authorization, and not complete authorization.
    the parameters in su01 are scl(X) and wlc(X   X  XX   X)
    Thanks,

    Can you please check into Infoobject Maintenance screen in Bex Tab i.e. Query Execution Filter Value Selection. assign "Values from Masterdata Table".
    Try again and let me know.
    Nagesh Ganisetti.

  • URGENT:  Not seeing the variable Pop-up for Button , on web template in WAD

    Hi gurus,
    In IP I have a standard plan function for 'Copy', which has a few variables defined on the funciton itself (as to be changed):
    Version from:
    Version to:
    Order from:
    Order To:
    Fiscal year from:
    Fiscal year to:
    All of the above variable are created with the following parameters:
    Variable input: Optional (have also tried madantory)
    Ready for input: is flagged.
    Variable represents: Single value.
    No default entry.
    No personalized data.
    Now in WAD, I create a button group for this function by selecting the Command, 'Executing Planning Function (simple)', manually entering my plan function technical name next to 'Command specific parameters', and selecting the dataprovider created for the filter I created in IP, and finally flagging the 'Display variable' button.
    The problem is, on the web template the variable screen does not appear when I click on the function button. It executes the function in the background without giving me the pop-up for variable selection. And obviously since the variables have no default values, nothing is processesed.
    I've tried this with planning sequence instead, and still wont give me the variable pop-up screen..
    I've actually explicitlet entered the variables on the 'Parameters for Command screen', the same screen where you enter the filter for databinding and well as the function.
    It still wont work (no variable pop-up screen).
    Is this issue related to the support pack. We're on SP12 right now?
    If not, do any of you gurus have any ideas? Big points will be rewarded for this.
    Thanks

    In the parameterization of the command, there is an option 'show variable screen'. I am not sure if you have mentioned this clearly, but have you checked this option?

  • How to use a bind variable in XE for accessing data from different sources

    Hi,
    I am new to XE and trying to create an application like this:
    (region source)
    Select * from v$session@:P1_DATABASE ;
    My intention is to give the name of the database at runtime to fetch the relevant data.
    But I am getting error like this
    1 error has occurred
    Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-01729: database link name expected
    Doesn't work even when I check the "Generic Columns" and run the query at the run time (same error).
    Can some one please help!
    Regards,
    Santosh Loke

    Hi,
    There are rules using names in SQL. I think you could use dynamic SQL to achieve the goal in your case. It is not clear for me what are you going to do. Moreover bind variable are difficult to use some times.
    You could start with something simple as a report and a form.
    Konstantin

  • No variable audio output for Cisco CHS 435HDC set top box.

    Background:  Until the other day I had my stb connectected to a TV, using TV sound, with an HDMI cable.  The P265v2 remote volume control changed the TV volume.  No problems.
    My new TV & home theater system was recently installed.  We don't use the TV speakers.  While my first preference was to program the Verizon remote to change the volume on my Onkyo receiver, this did not appear to be an option on the remote's programming instruction page on the Verizon website.  Instead, I am directed to change a setting on the remote that makes the Verizon remote change the stb output volume vs the tv volume.  I changed the setting on the remote and ensured the stb box was set up for "variabe" audio output.
    Problem:  Using the stb variable audio settings, volume settings 1 through 30 produce the same volume.  (Volume setting 0 produces no volume, as one would hope.)  It appears the "variable" setting isn't producing a variable output as it should be on this unit.
    Thinking that maybe the receiver was complicating the sitation, I tried connecting the stb to the old TV and the new TV directly and had the same results.
    Now, while I am watching TV, I need to have the receiver remote at hand in addition to the Verizon remote.  It would be nice to have the volume be adjustable as it should be while using the Verizon remote.  I don't like the idea of using a seperate universal remote because then I would lose some of the functionality that the Verizon remote provides when watching TV, using the DVR, watching on demand, etc.
    I would like to know if this is a problem just with my unit, or if it exists with all of these units, which would hopefully be fixed with a Cisco/Verizon firmware update soon, hopefully.
    Thank you.

    soups230 wrote:
    Having same issues with hdmi and optical. Any fix to this.
    Hello,
    In order to control the volume on your home theater system, you'll need a FiOS TV Universal Remote that has the 4-buttons on the top for 'DVD', 'Aux'iliary, 'TV' and 'STB'.  The audio receiver would have to be programmed into the FIOS TV Remote, and controlled using the 'Aux'iliary button.
    Verizon's 4-Button Universal Remote Controls are available for purchase:
    a) online via www.verizon.com/fiosaccessories
    OR
    b) at a local FiOS TV store (call first to check if they have them in stock).  For a list of stores:  http://www22.verizon.com/support/residential/tv/fiostv/general+support/account+issues/questionsone/8...
    Presently, the default remotes for new set top boxes are the 2-button P-265 (newer version) remotes.
    Regarding a problem with HDMI/optical on Cisco 435 STBs, check out the following:
    Go to this webpage:  http://www22.verizon.com/Support/Residential/TV/FiOSTV/Receivers/Equipment+Issues/QuestionsOne/12839...
    Click on the link for 'Cisco CHS 435 HD DVR User Guide'.
    Open the PDF and go to page 22 for 'Connecting to a Home Theater System...'.
    Hope this helps!

  • How can I switch to Longtext in a variable selection box for entered value

    I execute a Web Template and enter a value for example a company variable. After this I press the "Check"-Button and get the short text of the company but I want to see the long text.
    The InfoObject settings under Business Explorer is:
    Display:                                          Text
    Text Type:                                       Default
    BEx Description:                              Long description
    Selection:                                        No Selection Restriction
    Query Def. Filter Value Selection:      Values in Master Data Table
    Query Execution Filter Val. Selectn:  Values in Master Data Table
    Filter Value Rep. At Query Exec.:      Selector Box Without Values
    The InfoObject is a reference characteristic and the query was created on BEx 3.5.

    I changed the text type to long text, but the result is the same.
    The only way to get the desired result is to delete the short text and the middle text in the InfoObjects Text Table Properties. But this is not right way.

Maybe you are looking for

  • Runtime Errors Raise Exception in Solution Manager

    Hi Guru's, While I try to excute the transaction solman_issue_mgnt in solution manager for issue tracking, runtime errors occurs. Error analysis     A RAISE statement in the program "CL_GUI_HTML_VIEWER============CP" raised the      exception     con

  • "Unable to set directory" on Seagate 500gb Backup Plus USB Hard Drive

    I recently purchased a Macbook Pro as of today, I'm upgrading from windows, and I'm having issues trying to set up my external hard drive to download torrent files. I know with Windows, I can plug in the hard drive cfrom windows computer to another w

  • Deactivate Change Button in PR05

    Dear Friends, In PR05 Travel Expense Manager Screen there is a CHANGE button. I want to deactivate or disable it. I do not mind if it is there but users can not use it. I have created one new role & assigned only PR05 Transaction code to newly create

  • COPY AND PASTE FREEZE TRACKS

    Hey all, i usually make 8 or 16 bar loops before i copy and paste------->> out to create a song. i use alot of native instruments on some tracks. i can freeze those tracks for the 8 or 16 bar length, which i like to do because its a shorter time that

  • Mutliple Libraries into 1

    Problem: I have an iTunes library on a PC and one on an un-related iPod. Both have some DRM protected content. Question: Is it possible to merge/migrate these two libraries to an existing one on my Mac. So basically can I have three libraries on one