Noob to AS3, Question

Of course I don't expect anyone to write this whole thing for me, I just need a point in the right direction. If somebody could just get me started, and explain how I could accomplish this, I would be very happy.
I have limited programming experience (but I understand the fundamentals), and I'm working on a Flash project in CS5. I have it set up where there are 16 text boxes, and a play button. When play is pressed, the Flash file should check the first text box, and check if one of about 10 different strings of text is present. If so, it should play a sound depending on which string is present. Then it should wait one second, go on to the next text box and do the same thing, and so on for each text box. Each text box would check for the same different strings, and each string would link to one sound.
I'm sure this is really simple, but I am really new to this. Thanks!

if your textfields are tf1,..,tf16:
var tl:MovieClip=this;
var soundObj:Object={};
soundObj["textfield text"]="soundclass associated with this text";
var tfToCheck:uint = 1;
// set up your timer
function soundF(e:Event):void{
if(soundObj[tl["tf"+tfToCheck]]!=undefined){
var SoundClass:Class=Class(getDefinitionByName(soundObj[tl["tf"+tfToCheck]]));
var s:*=new SoundClass();
s.play();
if(tfToCheck==1){
// start your timer
tfToCheck++;

Similar Messages

  • Noob transition to AS3 question

    Slowly learning my way into AS3, here is the original code that i am trying to move into AS3 from AS2. The function is to allow the mouse over state to stay selected until the mouse moves off of the selected area. Here is the AS2 code:
    mc.onRollOver = function(){
    mc.gotoAndStop(2);
    mc.onRollOut = function(){
    mc.gotoAndStop(1);
    How i have changed it: This is where i need help
    mc.addEventListener(MouseEvent.ROLL_OVER)=function(){
    mc.gotoAndStop(2); }
    mc.addEventListener(MouseEvent.ROLL_OVER)=function(){
    mc.gotoAndStop(1); }
    What am i missing with the code?

    I tried this code, and got a duplicate error:
    mc.addEventListener(MouseEvent.ROLL_OUT, overHandler);
    function overHandler(evt:MouseEvent):void {
         mc.gotoAndStop(2);
    DId you define the overHandler function twice? That's about the only way you could get a duplicate error... I think you want:
    mc.addEventListener(MouseEvent.ROLL_OUT, outHandler);
    function outHandler(evt:MouseEvent):void {
         mc.gotoAndStop(1);

  • FlashBuilder and Flash AS3 question

    I'm heads down working with the FlashBuilder tool which is heavy AS3, and have used Flash CSx for years.
    My question: I'm assuming my AS3 skills that I develop with FlashBuilder will be directly applicable to Flash CSx, correct? I understand I'll need the context of applying my AS3 code to the Flash objects when working in Flash CSx but for the most part will my AS3 skills carry over from FlashBuilder to Flash CS4/5?
    Thanks in advance,
    Rich

    AS3 knowledge and skills has nothing to do with editors/IDE (which CSx, FlashBuilder, etc. are) per se. So, once you get your hands on AS3 - it doesn't matter where you write your code - it will work the same way in the final compiled swf. Nevertheless, there is a learning curve involved while getting to know new development environment as with any new software.

  • NOOB with remote question

    Hi all, Im a noob here and just purchased the mega 180.  I already have a couple of questions that I am hoping someone will be kind enough to answer.  I have read through this forum and havent been able to find the answers (maybe looked in wrong place).  
    First, is it possible to use a different remote than the one provided?  And if so, what others can be used or what software is necessary.  Does the use of a different remote affect the HI-FI functions?  As in, do you lose the ability to control those functions?
    Second, could someone please tell me where I can purchase the MSI Mega TV tuner in the U.S.?   And, if I get this tuner will the remote be able to control the media center 3 that ships with the mega?  Will it be able to control the HI-FI?
    Thanks for looking!

    Of course you can use a differente remote and, of course you'll lose the HiFi functions  
    If your new remote have IR-learning function you can make it learn the codes of the original remote and use it directly with your Mega.
    In PC mode, you can use almost every remote and learn the commands with Girder (http://www.girder.nl, actually moved to another site)
    Regards

  • FMS2 noob with capabilities question

    Thanks in advance for any help you can offer.
    I am just learning the basics of FMS2 and have some simple
    questions(I hope).
    I currently have a php/mysql application that creates mixes
    of mp3s.The songs are played using progressive downloads and this
    is causing some concerns among the license holders.I understand
    that by using FMS2 I can stream the mp3s instead.
    My question is about keeping current functionality after
    migrating to FMS2.
    My mp3 player uses xml playlists.Its is already coded to hook
    into flashcom streams if needed. To create a playlist, a user
    searches the DB and adds songs to his account. I then use php to
    write the added song data to an xml playlist. The playlist is
    stored in the users folder, with a copy of the mp3 player. The mp3s
    are all pulled from a specific location on the server.
    From what I have learned about FMS2 so far(which is very
    little), I am not sure if streams can be dynamically created in the
    same fashion. I have seen plenty of info about FMS2 streaming mp3s
    from a specific playlist with the mp3 all coming from the
    application folder, but not any info about what I am trying to
    attempt.
    I would not be doing the coding myself, I can handle
    php/mysql but I know very little about action script and have
    little time to learn. But I want to know if I am barking up the
    wrong tree. Are dynamic streams possible? I dont want to look like
    an idiot when I try to hire someone to code an impossible solution.
    Im not looking for a how to, just want to know if the capability
    exists in FMS2
    Thanks,
    Matt

    Yes... everything you're asking about can be done with FMS,
    and fairly easily at that.

  • Some IPAD noobie email/exchange questions:

    People around here have been super-helpful so if youve answered any of my previous questions, thank you.
    Just started using my first IPAD (3) and have some questions regarding mail:
    1) Is there any faster way to get to an attachment than to scroll down to the end of an email? Why is the "attchment-icon" at the end of the email and not somewhere a bit more accessible?
    2) Everything seemed to have worked fine when I set up exchange but there was no sync for my contacts or notes (only mail and reminders/tasks). What did I possibly do wrong here?
    Finally, for those that use their IPADs for work and who peruse a large amount of emails via exchange, what would you advise I get with regard to a data plan? (I am on Verizon)
    Thanks.

    Hi,
    Make a Hybrid deployment with Exchange on-premises and O365 is a great method : )
    More details, please refer following arcile:
    Exchange Server 2013 Hybrid Deployments
    https://technet.microsoft.com/en-us/library/jj200581%28v=exchg.150%29.aspx?f=255&MSPPError=-2147217396
    Thanks
    Mavis Huang
    TechNet Community Support

  • Hard mathematics/as3 question.

    Hi all;
    I've made a 3D spherical gallery that builts itself solely by the number of pictures it has to contain, and spreads the photos even on the 3D surface.
    basicaly the final goal is to import an XML and convert it to array that will fill the sphere.
    I'f you're willing to help pleas give me your email here and I will send you the FLA because you need to see what I mean inorder to understand what im about to ask, all the code is in the first frame, I have several class for this but i've connected all the crutial parts together so you will get the point.
    the final goal is that the spacing between the pictures closest to you will be minimum 70px wich is the spacing you see if:
    var PhotosNum:Number = 150;
    var rad:Number=600;
    this.transform.perspectiveProjection.fieldOfView=115;
    the photosNum is the length of the photos array built from the XML.
    the rad is a number used to build the Sphere obj.
    the fieldOfView is a pain in the @#%! and the root for all my problems.
    play with these three values so that the sphere will always be in the size of the grey circle on the stage.
    What I need:
    well besicaly, a formula that will set the rad and fieldOfView to achive a good and clear spacing between photos by any parameters you decide to use.
    (PhotosNum, grey circle, width of single photo)
    for now treat all the photos as identical.
    if you need details on the function that spreads the photos to get the number of circles and number of photos in each circle let me know i'll explain it in depth.
    if the explanation/ request is not detaild or not understandble please let me know, sry for my english.
    thanks in advance for whoever chosses to accept the chalange

    Thanks Harm /
    I thought  you might be out there, 7 am here and I am just callin it wuits for tonight / another all nighter here.
    I just wanted to be sure it would have no impact down the road when I get to raid setup.
    Question about the Quadro drivers:
    On the CD they have drivers which I did not install at this point / they said they were some kind of accelleration drivers for CAD graphics work..
    Should I also install these ?
    Also:
    Did not install NVIDIA HD Audio Drivers thinking they might conflict with Premier or the Audio drivers for the Gigabyte UAD-5 motherboard.
    Think I would only need those if I were connecting to a HD TV Display and I wanted the audio to travel with those conncetions ?
    Any feedback on those topics ?
    Thanks Much !

  • Beginner Flex2 / AS3 question

    I am a beginner by all respects and have decided to develop
    an FTP via browser application for my company website in my free
    time. Before I buy a few Flex 2 and Actionscript books for myself
    and dive in, I figured it might be smart to ask the community if
    its even possible or recommended.
    Can you (should you) use Flex2 / AS3 as the basis for a drag
    and drop .ftp through browser application? If so, feel free to
    advise me on any Flex packages or methods to use as a basis and I
    can place emphasis on that in my learning.

    One thing I'd like to point out, generally I'm all for
    recreating something on my own but for something on that magnitude
    I'd suggest checking out this link, someone has already pretty much
    created what you need to accomplish.
    http://www.onflex.org/ted/2007/05/flexftp-ftp-client-in-flex-using.php
    obviously if your not using PHP you can change the server side
    around to reflect your needs but the source there has already
    tackled some of the major issues of a(n) FTP client in Flex. One of
    the biggest ones is with sockets you don't know when it's full so
    you constantly need to clear it. However if you were to use the
    FileReference classes (based on HTTP protocol) your going to need
    to configure your server to allow large buffer sizes for files to
    be uploaded as well as setup long timeouts. The other drawback is
    using sockets theres no way to create a true progress of what's
    been done. Just my two cents. Hope this helps.

  • Simple AS3 question

    in AS2 I used to load swf and send vars to the swf through
    the url like that:
    _root.loadMovie("myMovie.swf?name='bob'")
    how would i do it in As3
    thanks

    shikozel,
    > thanks David. first I have to tell you that I am a
    regular on
    > your blog. I really like it.
    Thanks! I like writing it and getting to know so many fellow
    developers.
    > how would you get this var within Flex application?
    Although I use Flex Builder fairly often and have tinkered
    with the Flex
    framework, I haven't yet loaded SWFs with FlashVars-type
    variables into that
    framework. In AS3, the approach would be the one I posted
    earlier, but the
    Flex framework itself may have some other way of evaluating
    the additional
    data.
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Christmas Mac noob!  First question is on printing

    Greetings to the Mac community from a lifelong Windows/DOS geek. I have a brand-new MacbookPro that I'm muddling my way around -- I'm on Day Two, and so far so good, except...I can't print successfully.
    Details: HP Laserjet 3200 all-in-one, networked via a Windows box running XP. My new MBP prints fine to the network --great! -- except it's gibberish. What should be a half-page doc runs on for 10-20 pages or more; looks like some kind of secret Mac code. Sounds like a driver issue, right? I've tried the HP 3200 drivers showing up on the MBP list when I "add printer," and so far nothing is working. Should I be crawling into the Windows box and doing something there?
    TIA

    Kren wrote:
    Thanks, that seems eminently logical. Only question: I haven't checked but I'm pretty sure the printer cable is not compatible with my laptop's available connections. I guess I need some kind of adapter.
    The best info I can find says that this printer shipped with both parallel and USB interfaces, so you should be able to hook it up via the USB port simply by buying a USB cable.
    The parallel port won't work reliably under Mac OS X, even with an adapter cable. You could buy one from a specialized cable company, but like the SCSI to FireWire adapters that were popular for a while, it wouldn't work that well.

  • Studying "programming in AS3" questions

    Hi,
    Looking at the code below, I presume KeyCode and ENTER are both values (or should I say property?) of the Keyboard class.   Bear with me, I'm new at learning AS3.  So far, I find it easier than learning Flash itself, but still I want to make sure I learn it right.
    function keyPressed(event:KeyboardEvent):void
    if (event.keyCode == Keyboard.ENTER)
    mainText.text = myGreeter.sayHello(textIn.text);
    The manual mentions (see below) that sample files come with it, but it doesn't say where those files are located.  Any ideas where they are?
    Working with end-of-chapter examples
    Like this chapter, most chapters in this manual include a significant end-of-chapter example that ties together many of the concepts discussed in the chapter. However, unlike the Hello World example in this chapter, those examples will not be presented in a step-by-step tutorial format. The relevant ActionScript 3.0 code in each example will be highlighted and discussed, but instructions about running the examples in specific development environments won’t be provided. However, the example files distributed with this manual will include all of the files you need to compile and run the examples easily in your chosen development environment.
    Updated 11

    Getting more and more interesting.
    Thanks!
    Ron

  • Noobie aspect ratio question

    hello-
    i'm a total novice FCP user and i'm just trying to do a simple edit, but i'm having a weird issue with my footage.
    i did not capture this picture within FCP, i captured it in imovie. the format is 720 x 480 (640 x 480). i have my Video Settings at DV NTSC 48. however, when i load a clip in the viewer it's too big (scroll bars appear on the sides of the viewer). when i export, everything looks squashed.
    can anyone tell me what i'm doing wrong?
    much appreciated!!
    morgan

    when i load a clip in the viewer it's too big (scroll bars appear on the sides of the viewer)
    In the Viewr window options, select Fit to windows. You have some zoom applied !
    can anyone tell me what i'm doing wrong?
    Probably not the answer you expect but . . . take the time to learn how and recapture your video using FCP Log&Capture. If you don't do that, the next problem you'll find is you must render all your with iMovie capture footage.
    The best is close the project, select the NTSC DV Easy Setup (A Guide To Setting Up Your Project In Final Cut 5 ) and go to Log&Capture.
    Hope it helps !
      Alberto

  • Need help AS3 question

    I am programming a music game where there are five movieclips (acting as buttons) representing five notes of a piano.  When the user clicks on each one, they play a note.  I would like to know how I can program it so that if the user clicks a specific five note sequence, it will trigger an animated movieclip in the timeline.
    Example:
    Note_1 + Note_4 + Note_2 + Note_5 + Note_3 = Animation_movie
    I am using Flash CS4 and Actionscript 3.  I've searched everywhere for a posting on this and couldn't find it anywhere.  Any help would be greatly appreciated!

    I tried using the array command, I feel like I'm getting closer, but I still can't get it to work.  This is what I have so far
    ActionScript Code:
    var noteArray:Array = new Array(note05_mc, note01_mc, note03_mc, note04_mc, note02_mc);
    var buttonArray:Array = new Array();
    stage.addEventListener(MouseEvent.CLICK,musicsequence);
    function musicsequence(event:MouseEvent):void {
        if (noteArray.toString().indexOf(event.toString()) != -1) {
            buttonArray.push(event);
            if (buttonArray.toString().indexOf(noteArray.toString()) != -1) {
                // (This is where my event would go)
            trace("Hey, it works!");
            buttonArray = new Array();
    } else {       
            buttonArray = new Array();

  • A Noob XSLT SE Question

    Hi, I'm new to JavaEE.
    I was trying to install XSLT SE (downloaded from OpenESB latest nightly build, Build071030) on my multi-language GlassfishV2 final, and it just won't start.
    Here is the message:
    ERROR:(JBIFW1136)Engine sun-xslt-engine cannot be initialized. The LifeCycle init() method threw a java.lang.NoClassDefFoundError exception. The exception message is: com/sun/jbi/component/endpoint/impl/AbstractEndpoint
    Caused by:(JBIMA0000)com/sun/jbi/component/endpoint/impl/AbstractEndpointAny idea?
    The Glassfish is run on CentOS 5.
    The ESB runtime is built-in in the Glassfish.
    The XSLT engine in the Glassfish bundle in my Netbeans 6.0 beta works fine, and I have tried to install the xsltse.jar inside the bundled Glassfish into the Glassfish run on CentOS, but results the same.
    Following SL, BC and SE are installed in the Glassfish:
    sun-encoder-library
    sun-shared-util-library
    sun-transform-library
    sun-wsdl-library
    sun-file-binding
    sun-http-binding
    sun-jms-binding
    sun-bpel-engine
    sun-javaee-engine
    sun-sql-engine
    update:
    same results with english Glassfish.
    Edited by: Mark-H-Y-Lee on Oct 31, 2007 4:48 PM

    Hi Mark,
    Try removing the TransformSL library; there may be a classloading conflict between the SharedUtilSL and TransformSL. Both libraries include the AbstractEndpoint class and I suspect that's causing your issue.
    Due to JBI classloading requirements, shared libraries cannot depend on (i.e. reference) each other. Since TransformSL is built using the utilities in SharedUtilSL, such as the Common Runtime Library (CRL) and Wsdl4jExt, the SharedUtilSL currently includes TransformSL in its deployment. Consequently, there is no need to install both SharedUtilSL and TransformSL. In case it's not clear, SharedUtilSL = sun-shared-util-library and TransformSL = sun-transform-library.
    Regards,
    Kevan

  • Basic AS3 Question

    I have a function that I want to use to add a movie clip from
    the library to the stage. Anyone have the code for that?

    If you have a movie clip in libruary, right click on it and
    chose "linkage", then check "Export for Action Script", and write
    down the name in "Class" field. After that you can use this name as
    usual class name, for example:
    var myClip:myClipClassName= new myClipClassName();
    addChild(myClip);

Maybe you are looking for

  • Question about Exception Error

    I'm writing a small PBE program for a class project and I keep getting an InvalidKeySpecException that claims my char[ ] is not ASCII. Now I am under the impression that when a char value is entered it's in ASCII values... I've only put up a piece of

  • Photoshop Album Starter Ed - Why won't print option work?

    When I select "print" I'm taken to the window to "select" photos, but when they are selected and appear in printer window, they have no status.  Nothing happens.  Also, when I try to access "Help" I get a message saying my browser is unable to open. 

  • How to set default keyboard command in Logic

    I seem to have lost my default keyboard commands in Logic. How do I set them back? Thanks

  • Best way to call

    which is the best way to call a scotland mobile phone from skype? i been using pay as u go credit and its 8 cents a min and was wondering if a monthly thing or a subscription is the way to go

  • Standby DB not applying logs

    Hi, i opened my primary DB using "alter database open resetlogs" after recovering from a power failure crash. this caused the log sequence number to reset to 1. when i check the standby DB for maximum log sequence applied, it is showing the last log