How can I evaluate "S1" (S1.mp3) as an element?

I have a Button named "Bt1P" that when I click on it, the Sound "S1" starts to play
(Note "S1" is the Linkage class specified for "S1.mp3" in the library)
This is the code that works:
Bt1P.addEventListener (MouseEvent.MOUSE_DOWN, Bt1PDown);
function Bt1PDown (event:MouseEvent):void {
    var playSound = new S1();
    playSound.play();     
But In case I want to play for example "S2" (S2.mp3) instead of "S1" (S1.mp3),
how can I evaluate the "S1" as an element?
For example I tried this code:
    var test:String = "S" + 1
    var playSound = new this[test];  // instead of S1
and it didn't work.... here is the Error:
Error #1007: Instantiation attempted on a non-constructor.
at Asmaa_fla::MainTimeline/Bt1PDown()
Anyone has a suggestion please??

"S"+1 would be an error waiting to be reported, mixing data types ("S"+String(1) would be better, though wouldn't make sense as a realistic bit of code unless 1 was in variable form).
But you can dynamically load a class using a string value....
var ClassRef:Class = Class(getDefinitionByName("S1"));
var  playSound:* = new ClassRef();

Similar Messages

  • How can I evaluate if a collection is empty or not with struts logic tag?

    How can I evaluate if a collection is empty or not with struts logic tag?
    I tried with logic empty tag. but the tag evaluated if a collection is null or not.
    I would like to do like this below.
    List list = new ArrayList();
    set(list);
    <logic:XXXX name="someForm" property="list">
    The list size is 0.
    </logic>thanks in advance.

    U can use :
    <logic:present name="urform" property="urlist">
    </logic:present>
    to check "urlist" is empty or not

  • How can you evaluate a graphed point in numbers

    After you make a graph and incorporate a trendline. How can you evaluate that trend line at a specific x/y value point, even if it is not a graphed point in your table?

    If you know the constants from the trendline then you can use them to extrapolate.  To get the constants check the "Show Equation" box in the Chart Inspector > Series > Trendline
    On the graph you will see the equation for the trendline:
    In this case the equation is "y=2.6x + 2"
    I added a new column to the data table and named is "Y extrapolated".
    Then I highlighted the graph
    Then click on the "sprocket " for the X values in the data table and select the "Share X Values"
    Then click and hold the little circle at the bottom right corner of the selection in the table (to add the new column to the graph), then drag to the right one colum (my column is green).
    Then in the new column add the formula as shown:
    C7=2.6*A7+2
    select C7 and fill down  as need (by clicking and holding on the little circle at the bottom right of the selected cell).
    I hope this helps

  • How can I edit photos in iPhoto in Photoshop Elements?  I select PE in iPhoto preferences but they stay in iPhoto for editing.

    How can I edit photos in iPhoto in Photoshop Elements?  I select PE in iPhoto preferences but they stay in iPhoto for editing.

    Here's something you can try with a copy of your current library.
    1 - go to iPhoto's Events preference pane and set the auto split option to 1 day per even.
    2 - go the the Events mode, select all Events.
    3 - go to the Events menu  and and select Autosplit Selected Events.
    which will give you an event for each day.
    4 - again select all events (although it might be better do to fewer at a time) and export them to your desired destination via the File ➙ Export ➙ File Export  menu option with the following settings:
    The workflow above will produce a folder for each days photos with the date as the folder's title.

  • How can I get my 2001 copy of Photoshop Elements to run on my Windows 7 computer?

    How can I get my 2001 copy of Photoshop Elements to run on my Windows 7 computer?

    Your talking about photoshop elements 1?
    Did you install photoshop elements 1?
    What happens when you try to run it?
    Do you get the message "Scratch Disk is Full" or similar message?
    How much free space do you have on your hard drive?

  • How can I install a recent version of Photoshop Elements and keep the albums set up in the older ver

    How can I install a recent version of Photoshop Elements and keep the albums set up in the older version?

    http://tv.adobe.com/watch/learn-photoshop-elements-11/converting-a-catalog-from-previous-v ersions/

  • How can I get rid of pink tint in Elements 6 "Editor" ?

    How can I get rid of pink tint in Elements 6 "Editor" ?  I received Elements 6 free with a scanner. It works o.k. on my Windows XP, except whenever I go to Editor workspace, the photo turns completely pink -- no other color.  I can use the various tools on the pink, but this is useless, as I don't want a pink photo. Can't even convert it to black & white -- just stays pink. I tried everything I could think of to get a normal color transfer to editor from the organizer, but no luck.  Please help. 

    This is an update to the pink tint problem.  The problem mysteriously FIXED ITSELF today, after being stubbornly pink for weeks.  I have no idea what happened, as I didn't do anything -- it was somehow already fixed when I started the program.  So maybe it will revert again, who knows, but hoping for the best.

  • How can I output the alpha channel in Premiere elements 10

    How can I output the alpha channel in Premiere elements 10. What format should I use?
    Tried outputting to an AVI filet but the file did not contain an alpha channel that After Effects 5.5 would recognize.

    Bill,
    I hope you ordered 32 GB or more on that new computer After Effects 5.5 takes up as much as it can.
    The Roto Brush tool is really a timesaver over ordinary Rotoscoping. Although, my problem now is: when I try to send a 1 min. And 11 second video from Adobe Premier Pro 5.5 two Adobe Media encoder 5.5, the process hangs in wait state in the Media Encoder. I have filed a request for help on the Media Encoder forum.
    I know you will put your new computer to use in helping other people and for this I thank you.

  • When uploading to Facebook how can I remove the "via Photoshop & Adobe Premiere Elements Uploader" ?

    Hi everyone,
    I am slowly getting to grips with Premiere Elements12.
    When uploading to Facebook how can I remove the "via Photoshop & Adobe Premiere Elements Uploader" ?
    I see there was an earlier posting (http://forums.adobe.com/message/3320214#3320214) which was for version 8, and I can understand the issue, but, (assuming its the same issue) has a remove tagline feature been installed??
    Is this also the same in the Pro version?
    Thanks in advance for any good info
    Pete

    Offul Duster
    I do not know if Premiere Pro CS6 CC offers an upload to Facebook export. Strictly an Elements Windows person here.
    The Premiere Pro Forum is a good place to ask about that.
    http://forums.adobe.com/community/premiere
    I do not have any Facebook accounts, so I cannot answer your specific Facebook question, but generalizing I can offer the following suggestions.
    If your issue with Publish+Share/Computer/Social websites/Facebook is with tagging, you might want to check the Facebook web site for the Video Manager section of it (or that by some counterpart name). I know that YouTube at the YouTube web site allows the account holder to go into Video Manager and manage his/her tags for the file uploaded there and displaying. Have you been there and done that type of thing for your Facebook upload.
    Please see
    https://www.facebook.com/help/tag-suggestions
    https://www.facebook.com/help/privacy/photos
    Please review and then let us know the outcome.
    Thank you.
    ATR
    Add On...As suggested in your inserted link, in Premiere Elements can you export to file saved to computer hard drive and then upload that file from there to Facebook at the Facebook web site without the tagging issue?

  • How can I change my Editor default back to Elements 8? (changed when I loaded trial Elements 11.)

    How can I change my Editor default back to Elements 8?   When I downloaded a trial version of Elements 11, my default changed to version 11.  I use Adobe Lightroom, and when I switch over to Elements using "Edit In", it automatically open Elements 11 now.

      In Lightroom Library prefs link to the PSE8 editor app, usually found on the Mac in support files. This example is for PSE10.

  • How can I merge 2 group photos in Photoshop Elements 12?

    How can I merge 2 group photos in Photoshop Elements 12?

    In the Editor: Enhance> PhotoMerge> PhotoMerge Group Shot
    In the Organizer: Edit> PhotoMerge> PhotoMerge Group Shot
    Here's the Adobe TV link on the feature  - http://tv.adobe.com/watch/learn-photoshop-elements-11/perfect-group-shots-with-photoshop-e lements-11-/
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children
    If this post or another user's post resolves the original issue, please mark the posts as correct and/or helpful accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks.

  • How can i open Nikon D610 RAW files in Element 12 ?

    How can i open Nikon D610 RAW files in Element 12 ?

    You need the ACR 8.3 plug-in to open D610 NEF files.
    Check what Help / About Plug-ins / Camera Raw reports for the version number. 
    If it is something less than 8.3, update to the ACR 8.3 plug-in using Help / Updates from the Editor.  If that says there are no updates, then uninstall and re-install and try again.
    If it is already ACR 8.3 then the files are likely corrupted by using an obsolete version of Nikon Transfer or ViewNX with them.
    You can fix that corruption using a utility from the following webpage, where 14-bits is likely what you’d want to specify, and only use Nikon utilities that are as new as your camera:
    http://owl.phy.queensu.ca/~phil/exiftool/fix_corrupted_nef.html

  • How can i uninstall the free download of photoshop elements 10?

    how can i uninstall my free download of photoshop elements 10?

    Simply use the unijnstaller in your Add or Remove Programs system panel on Windows or the relevant Application Support:Adobe:Installer folder on Mac.
    Mylenium

  • How can Photoshop Album SE3 be integrated with Photoshop Elements 1.0?

    How can Photoshop Album SE3 be integrated with Photoshop Elements 1.0?
    I am quite happy with Elements 1, but now have my images catalogued in SE3, can I link directly between the two programs?
    Maybe this has been asked before but the user forum is a nightmare to negotiate.

    Theer is no easy way to link them - this is something the paid-for PSA 2 can do. However, you can do simple drag and drop - drag a thumb out of PSA SE into PSE and the image will open. If you save back to the same file, you'll need to update the thumbnail. If you do a Save As, you'll need to import the new version.
    > the user forum is a nightmare to negotiate
    Odd comment. In what way do you find it hard?

  • How can i retrieve my serial number for photoshop element 12

    how can i retrieve my serial number for photoshop element 12

    http://www.adobe.com/go/learn_findserialnumber_en
    Let me know if this works.
    Regards,
    Shane.

Maybe you are looking for

  • RHS9 & RH8/Clicking links to topics more than 3 "deep" in the TOC does not open the TOC

    Our IT department recently purchased and installed RoboHelp Server 9. I am publishing two RoboHelp 8 projects to the server using WebHelp Pro output. When I view the projects, I am able to navigate the table of contents without issues, but if I click

  • Making a pdf of an InDesign Booklet

    Ever since I installed Snow Leopard I have not been able to format InDesign booklets into a pdf. I have read many postings on this topic but nothing has worked so far. The best I have come up with is for me to de-install Snow Leopard and go back to L

  • Can using BouncyCastle be an alternative to installing the policy files?

    Hey, sorry if this is a dumb question but I have been looking into this all day. I want to write a program that incorporates unlimited strength encryption, but installing the JCE Unlimited Strength Jurisdiction Policy Files is not an option (I can do

  • Automatic loading from data marts

    Hi All, I have a cube which has a data flow wherein I have an ODS1 which gives data to ODS2 and then finally to the cube. I have put this entire process in a process chain. But many a times due to an erroneous record,. the ODS1 loading fails and then

  • [SOLVED] Can't boot from LUKS - No key available with this passphrase

    The problem Latest kbd package responsible for your keyboard layout may break some LUKS installs depending on the password used, as there are some keymaps which are broken, resulting in the user not being able to enter the password correctly. Relevan