AS3... why?

what is the point of AS3?. Why is there AS3?.. what doors of possiblities does it open?
I wouldn't mind if AS3 was an extention to AS2 but it seems to be completely different, not similar to other languages, and takes ten times as long to code something simple as it did with AS2..
before people respond with well just use AS2 I would, however every flash job is for people that can AS2 and AS3...
am i going to spend ages learning AS3 to find that adobe have already launched AS4, which im sure will have no relation to AS3?
... sorry for a rant and possibly a pointless post, but thats life.

Hi, Jonny.
First, considering the advantages of AS3 over AS2, one of the most important is that more and more developers are migrating to it, it means that inevitable the AS2 community will slown down...
But, let's go to the languages advantages. First: the new VM of Flash Plugin, the one that runs AS3 is kind of 100 times faster! Run this simple test and confirm what I'm saying:
[AS2]
var initTime:Number = getTimer();
var endTime:Number;
for(var i:Number=0; i < 1000000; i++)
endTime = getTimer();
trace(endTime - initTime);
[/AS2]
[AS3]
var initTime:uint = getTimer();
var endTime:uint;
for(var i:intr=0; i < 1000000; i++)
endTime = getTimer();
trace(endTime - initTime);
[/AS3]
AS3 is really a very superior language. About the time to develop, I also has this impression: AS3 is much more exigent than AS2. But, go for my words, when you get it, you gonna see you will have a much faster and consistent development, without annoying bugs and this stuffs.
I really think that everyone sould migrate to AS3. If you're not convinced yet, some other features:
     Native support to 3D;
     Access to Local File system;
     Native peer-to-peer support coming there (look for Stratus);
     indexOf method in the Array, that became much times faster;
     Control of the loaded data at the byte level (ByteArray);
     Typed vectors (making array much more faster);
     Consistent event structure;
     An incrideble RegExp solution;
     And so on...
AS4 is not about to be launched. It'll take time to. The AS3 language is more compliant with the standards of development, and I believe that it can pass by a improvement on the plugin side, but the language will stay stand for many years. Years enough to worth learn the AS3 and be prepared to the 4. Anothe little advantage, it's very similar to Java, for those familiarized with Java.
These are only some of the advantages of the AS3 engine... but, pal, go AS3!
Cheers,
CaioToOn!

Similar Messages

  • OSMF instead of AS3 -- Why Again?

    Would someone please explain to me again why we need OSMF? It's just pseudo-methods built with AS3--why not just use AS3? Why not simply create an open-source AS3 media player class library? Why are all the new methods (whose names change with each Sprint release) needed again--seems like it's just for Flex (MXML) developers. I'm sorry Father, my faith is weakening.

    Hi John,
    Great question.
    Following are a few quick thoughts in response.  Please post back if you do  (or do not) find any of the following helpful in response to your questions.
    Here are a few cases where you do *NOT* need OSMF:
    FLVPlayback works just fine
    You already have production media players
    fwiw, First OSMF *IS* ""an open-source AS3 media player class library.  (I  think.)  Do you mean just a "pure" AS3 media player?  Without the various  parsers, plug-in architecture, layout and composition capabilities, etc.?
    Second, OSMF is *NOT* "just for Flex (MXML) developers".  Yes, Flex  ActionScript developers can use OSMF.  And yes the OSMF team uses Flex/Flash  Builder ActionScript projects for organizing the OSMF code base and MXML  projects for most samples.  However, it is anticipated that for lightweight  production SWFs, most implementations will use Flash in building their media  player UI skins.  Reason being, most production implementations will not want or  need the SWF file size increase that using the full Flex 3 / Flex 4 framework  will add.
    So, WHY OSMF?
    We just today got the following article up on the Adobe Developer  Connection:
    Open Source Media Framework: Introduction and overview
    http://www.adobe.com/devnet/video/articles/osmf_overview.html
    The article highlights a lot of the business case for OSMF.
    One use case where OSMF is a no-brainer choice today is:
    HTTP Streaming (currently code-named Project Zeri)
    Other areas with very strong use cases:
    Advertising 
    In-line
    Pre-roll
    Post-roll
    Companion ads, overlays, leave behinds, etc.
    Using VAST and/or MAST
    Once OSMF gets to v1.0, hopefully momentum around OSMF will build quickly,  and OSMF will become compelling for more and more use cases.  For instance,  OSMF's plug-in architecture will result in an ecosystem of partners including  CDNs, analytics, advertising, etc.  As partners provide plug-ins that deliver  functionality your media players require, your using their plug-ins will provide  you immediate payback for learning OSMF's abstractions
    In short, OSMF is not the optimal solution for every use case.  However, it  will be optimal for some.
    Small note ... sorry about "the new methods (whose names change with each  Sprint release)".  The API is now frozen so ... no more name changes  :-)   (Sorry about your being exposed the frustrations of pre general release code.)
    hth,
    g

  • Flash is complaining about XML? Im using AS3 why are there XML errors? Unknown syntax errors.

    Sorry to keep spamming these forums with my stupid errors, but I am trying really hard to learn Flash/AS3 and when I have got to grips with it, I will return the love.
    I am a flash rookie trying to make a simple calculation device and I am getting a whole world of errors I have never seen before.
    My Code (I apologise but it may be my bad syntax):
    import flash.ui.Mouse;
    var Hnum:String;
    var PCnum:String;
    var calc:Number = 25;
    var Total:Number;
    num1.restrict = "0-9";
    num2.restrict = "0-9";
    Est_btn.addEventListener(MouseEvent.CLICK, calculate);
    function PartCount(event:MouseEvent):void{
        PCnum = num2.text;
        if (PCnum > 0 && < 10){
            parseInt(PCnum) * 10;
        or if (PCnum > 11 && < 20){
            parseInt(PCnum) * 5;
        or if (PCnum > 21){
            parseInt(PCnum) * 1;
    Est_btn.addEventListener(MouseEvent.CLICK, calculate);
    function calculate(event:MouseEvent):void{
        Hnum = num1.text;
        PCnum = num2.text;
        Total = parseInt(Hnum) * calc + parseInt(PCnum);
        Total.toString();
        Total_txt.text = String(Total);
    I had everything working when I was only calculating Hnum by 25. But when I try to intergrate  the if or statement everything goes wrong and I get these 5 errors.
    Scene 1, Layer 'Actions', Frame 1, Line 15
    1104: invalid xml name
    Scene 1, Layer 'Actions', Frame 1
    1084: Syntax error: expecting xmltagendend before end of program.
    Scene 1, Layer 'Actions', Frame 1
    1084: Syntax error: expecting rightparen before end of program.
    Scene 1, Layer 'Actions', Frame 1
    1084: Syntax error: expecting identifier before end of program.
    Scene 1, Layer 'Actions', Frame 1
    1084: Syntax error: expecting rightbrace before end of program.
    I dont understand what these errors are pointing out? Why XML? is it my variable names?
    Here is the code I had before the second function that worked fine:
    var Hnum:String;
    var PCnum:String;
    var calc:Number = 25;
    var Total:Number;
    num1.restrict = "0-9";
    num2.restrict = "0-9";
    Est_btn.addEventListener(MouseEvent.CLICK, calculate);
    function calculate(event:MouseEvent):void{
         Hnum = num1.text;
         PCnum = num2.text;
         Total = parseInt(Hnum) * calc;
         Total.toString();
         Total_txt.text = String(Total);
    Any help would be greatly appreciated! I will get the hang of this!
    MrB

    Thanks guys you were right it was parse problem with the var type.
    I have changed the code adding parseInt where necessary.
    I have also added the other functions. But now after it was working fine with just the one function it is doing the strangest thing.
    There are no errors, it is running fine but it is outputting the letter "a" instead of any numbers? Is this something to do with the strings? It is most odd.
    Any help would be greatly appreciated.
    Here is the new code:
    import flash.ui.Mouse;
    var Hnum:String;
    var PCnum:String;
    var PCcalc:Number;
    var Pmath:Number;
    var calc:Number = 25;
    var Total:Number;
    num1.restrict = "0-9";
    num2.restrict = "0-9";
    Est_btn.addEventListener(MouseEvent.CLICK, calculate);
    function PartCount(event:MouseEvent):void{
        if (parseInt(PCnum) > 0 && parseInt(PCnum)< 10){
            PCcalc == 1;
        if (parseInt(PCnum) > 11 && parseInt(PCnum)< 20){
            PCcalc == 2;
        if (parseInt(PCnum) > 21 && parseInt(PCnum)<200){
            PCcalc == 3;
    Est_btn.addEventListener(MouseEvent.CLICK, calculate);
    function PartCalc(event:MouseEvent):void{
        if (PCcalc == 1){
            Pmath * 10;
        if (PCcalc == 2){
            Pmath * 5;
        if (PCcalc == 3){
            Pmath * 1;
    Est_btn.addEventListener(MouseEvent.CLICK, calculate);
    function calculate(event:MouseEvent):void{
        Hnum = num1.text;
        PCnum = num2.text;
        Total = parseInt(Hnum) * calc + Pmath;
        Total.toString();
        Total_txt.text = String(Total);
    Thanks
    MrB

  • AS3: Why wont my jump-to-frame code work?

    I have an input text field that asks the user for the frame of a particular scene to go to. When he inputs a number and clicks a button, I have the following code executing.
    jumpframe_txt.text = String(""); // clear field
    currentframe_txt.text = String(jumpframe_txt); // display new frame #
    var jumpframe:Object = Object(jumpframe_txt); // convert to object
    gotoAndStop(jumpframe, "Section1"); // go to frame
    I get the error: Error #2109: Frame label [object TextField] not found in scene Section1.
    I tried converting it to a number instead of an object but it didn't work. What's wrong here?

    Line 1 - Why do you clear the textfield before you use its text?
    Line 2 - You are trying to assign a TextField object to a String value
    Line 3 = why?
    Line 4 - You just created a TextField object in line 3 and now are trying to use it as a Frame label (text)?
    While it's not clear what all those lines are trying to accomplish, what might work better for you...
    gotoAndStop(jumpframe_txt.text, "Section1"); // go to frame
    jumpframe_txt.text = String("");

  • Why doesn't AS3 FileReference Download Work in IE/FF (Works fine in Chrome)

    I am generating an Excel file with Java on the back-end and it seems to work just fine in Chrome but for whatever reason it doesn't in FF/IE. I have the very latest of Flash in each browser listed from this site: http://helpx.adobe.com/flash-player/kb/find-version-flash-player.html
    I'm sending XML to the server, it is generating the Excel and sending it to the Flash. I'm performing the export by doing the following:
    private var _fileRef:FileReference;
    private function exportReport(e:MouseEvent):void
        _fileRef = new FileReference();
        _fileRef.addEventListener(Event.COMPLETE, excelExportCompleteHandler);
        _fileRef.download(new URLRequest("exportReport"), "report.xlsx");
        function excelExportCompleteHandler(e:Event):void {
            trace('complete');
    There are no error messages from Java/Flash. The browse popup comes up and I save the file the same in IE/FF as I do in Chrome. the trace('complete') is executed every time in every browser but the file only shows up when using Chrome.
    I also searched my filesystem and found temporary internet file shortcuts with the name of the file I was trying to download so it's as if it started the download but didn't finish it for some reason. The location of those files is AppData\Roaming\Microsoft\Windows\Recent Items

    Definitely not a timeout, it takes < 5 seconds for the web service call to finish
    I can also copy and paste the request url with data into the browser and it will successfully download the report just through the browser which made me realize I could use javascript as a non-ideal workaround solution to this problem.
    I would still love to know why it was failing and if anyone has any ideas that would be great but for anyone else with the same issue as me here is the workaround I used:
    as3 code (I used URLVariables to encode the data because trying encodeURI or encodeURIComponent didn't encode ' or " which would cause errors when doing the ExternalInterface.call()
    var reportData:String = getReportXML().toString();
    var variables:URLVariables = new URLVariables();
    variables.q = reportData;
    //Substring at 2 to trim off the 'q=' portion
    reportData = variables.toString().substring(2);
    ExternalInterface.call("function() { return downloadExcelReport('"+reportData+"')}");
    javascript code (I used a hidden form because I needed to be able to perform a POST because the xml data I was passing was too large for a GET)
    <script type="text/javascript">
        function downloadExcelReport(reportData) {
            reportData = decodeURIComponent(reportData);
            window.open("about:blank", "newWindow");
            document.getElementById("reportData").value = reportData;
            document.getElementById("reportForm").submit();
    </script>
    <form id="reportForm" method="post" target="newWindow" action="<%=SERVER_PATH%>excelReport">
        <input type="hidden" name="solutionReportXml" id="reportData" value="">
    </form>

  • Does anyone know why I am getting a yellow question mark by my AS3 .swf?

    I developed a few Actionscript 3 animations in CS Flash 5 to use in Cp5.  Instead of the green ball icon in the upper right corner of the animation, I am getting a yellow question mark like I did when with my Actionscript 2 .swfs.  The reason I created new ones in AS3 was to avoid any conflict.  Hmmm
    The new ones I am trying to use are Moving Red Circle, Moving Red Rectangle, and Moving Exclamation Point.  The Green Ball items are from Cp5 Gallery.
    Thanks

    Ah...that explains why you would be seeing these icons.
    When Captivate's library opens, it goes through and checks the locations of the objects in the library to see if it still can connect to the source file locations.
    I would say the way to get around this would be to have the path to all source files replicated on each machine you work on.  So if you set up a C:/Projects directory with exactly the same folder structure on each PC you use, the path to source files should remain the same.  But I think trying to keep all the files in three machines always synced up will be more trouble than it's worth, personally.

  • Why no Tree component for AS3?

    Why is there no Tree component when working with an AS3 based
    Flash 9 file?
    Kevin

    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=194&threadid =1262046&highlight_key=y&keyword1=accordian
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=288&threadid =1262107&enterthread=y

  • AS3 sucks !!! Why can't access a simple movieClip ???

    Hi People,
    Please - it's as simple as that:
    I have a stageand there is a movieClip instance called "obiekt" in it. Inside "obiekt" movieClip there are two other clips. One instance is called "z1" and another one is called "z2".
    Presume I have a event listener in "z2" what in case of mouse rollover calls a function what is supposed to set "z1" movieClip 'visible' property to true.
    But why the hell when I code:
    root.obiekt.z1.visible = true;
    I get this error:
    1119: Access of possibly undefined property obiekt through a reference with static type flash.display:DisplayObject.
    Jesus - what's the hell - scripting a simplest thing in AS3 requires definig some bloody classes, extending other, importing whatever packages... Only to accesss a movieclip on the stage!!! If I were to do the thing this way I would rather learn C++ not Flash. Flash was supposed to simplify multimedia not making it worse!
    Can anybody help me here? It's really urgent !!!
    Rgs,
    Ziggi

    Look into event bubbling.
    I posted an example in this thread yesterday:
    http://forums.adobe.com/thread/433959?tstart=0
    http://muzakdeezign.com/cs4/Surrey-florist-gallery3.fla
    Best is to forget about root and trying to access objects in a "parent".
    It's all about event dispatching.

  • Why no Built in Behaviors for AS3?

    Why are there no built in behaviors for using AS3? I am
    trying to find a
    way to do basic interactions without needing to learn AS3.
    Just curious
    why it was removed.
    Thanks.

    Not allowed to speculate as to why or why not here --
    But in general, the unibody 17" was just released with the new battery -- Apple just did a 15" refresh in October 08 -- it won't get another major refresh for awhile -- and most likely in the next refresh, they too will have the built-in batteries...at least that is what Apple initially stated when they announced the 17" a few months ago was their plan eventually for the entire portable line.
    But those will be rolled out in the coming years, not right away.

  • Why is AS3 underlining certain fonts but not others (all of which are pretty common)?

    Hello everyone!
         I have a simple question that hopefully has a simple answer (which mocks me with its elusiveness). In the code below (taken from Gary Rosenzweig's "ActionScript 3.0 Game Programming University" (2nd ed.)), I am declaring a simple style sheet using all AS3 supported tags/attributes to underline an HTML link. My question is this: why won't AS3 underline the chosen font (Arial) but yet it will underline certain other fonts that I substitute it for (such as "Times New Roman" and "Garamond")?
    // create a basic format
    var myFormat:TextFormat = new TextFormat();
    myFormat.font = "Arial";
    myFormat.size = 24;
    myFormat.bold = true;
    var myStyleSheet:StyleSheet = new StyleSheet();
    myStyleSheet.setStyle("A",{textDecoration: "underline", color: "#0000FF"});
    // create a text field with a Web URL link
    var myWebLink:TextField = new TextField();
    myWebLink.defaultTextFormat = myFormat;
    myWebLink.styleSheet = myStyleSheet;
    myWebLink.selectable = false;
    myWebLink.htmlText = "Visit <A HREF='http://flashgameu.com'>FlashGameU.com</A>!";
    myWebLink.x = 80;
    myWebLink.y = 90;
    myWebLink.width = 400;
    myWebLink.height = 30;
    addChild(myWebLink);
    var myLink:TextField = new TextField();
    myLink.defaultTextFormat = myFormat;
    myLink.styleSheet = myStyleSheet;
    myLink.selectable = false;
    myLink.htmlText = "Click <A HREF='event:testing'>here</A>";
    myLink.x = 80;
    myLink.y = 190;
    myLink.width = 400;
    myLink.height = 30;
    addChild(myLink);
    addEventListener(TextEvent.LINK, textLinkClick);
    function textLinkClick(event:TextEvent) {
    trace(event.text);

    Mr. Murphy,
         You see what I mean? I knew it would be a simple answer - it had to be, right? That way when someone helped me figure it out, I would get the pleasure of kicking myself for not having seen it before. I tried temporarily disabling the default text (thinking maybe it was somehow interfering with the style sheet), ensuring that I had the fonts that I was trying to use embedded in my program, including all the formatting in the actual style sheet rather than some of it resting in the default text statement, and did a couple other things that now escape my memory. What I didn't do was change the font size to see if it was simply cutting off the underscore. Sure I thought about it, but didn't actually follow it up.
         What makes this worse is that, in the book I referenced, the author doesn't say anything about having to change the font size for this particular application and goes further by demonstrating via inline image his "perfect" outputted result using the exact code that I did. I know this threw off other readers as well who tried to emulate his result only to find that the underline magically "disappeared" when they did it.
         Thanks for the help! As always, I appreciate it.

  • Why not add a scale for accessing both scaleX and scaleY (class extensions in as3?)

    I've considered and am suggesting there be a scale for both scaleX and scaleY (via a setter & getter function)
    I think that one might get confused trying to get a value out of scale if scaleX and scaleY are different, but...
    You could throw an error when using a variable scale (getter only) if they (scaleX&scaleY) are different, and return the value if they are the same.
    It could throw more a warning and return the scaleX or scaleY or an average, and or possible have a policy (although again I can see this may seem potentially more confusing.)
    I remember with ObjectiveC you could/can create a class extension that would extend a class that already exists pervasively like String.
    This way you could alter functionality like this where all onjects have inheritend from a DisplayObject or whereever scaleX & scaleY are. Subclass as an Extension Class this deep lying class and add that kind of ability without needing to do it to all of your higher level classes (or other such tricks String Utility Classes etc.), which as I recall existed in ObjectiveC (and other langauges) no doubt because it was simply impossible to achieve the same effect any other way.
    Is there such a way in AS3 to extend a class? Is it impossible for some reason?
    May appologies if I've got the terminalogy wrong, please clarify if I'm searching for the wrong keyword on this thanks.
    Anyway I still think putting something like
    myCircle.scaleX *= 0.9;
    myCircle.scaleY *= 0.9;
    or
    myCircle.scaleY = myCircle.scaleX *= 0.9;
    or
    myCircle.scaleX *= 0.9;
    myCircle.scaleY = myCircle.scaleX;
    is not as nice clean as
    myCircle.scale *= 0.9;
    would be. I think my thoughts on explaination for why and a simple possible selection of solutions (throw catchable/discargable errors/warning or alterable policies).

    TCP has retry logic. The timeout period varies by OS and configuration. TCP will typically retry three times and wait for the timeout period to expire before reporting an error. I do not believe any OS will fail in less than two minutes with the standard timeout and some systems go to 5 minutes.

  • Why is it that AS3 does not support private constructors as AS2 does?

    Why is it that AS3 does not support private constructors as
    AS2 does?
    Private constructors are standard in most OOP languages (for
    example
    C++ and Java) and were supported in Actionscript 2. However,
    this is
    not the case in AS3 which only allows its constructors to
    have the
    'public' access modifier.
    I have legacy code that I hope to migrate to the AS3
    platform. Some
    key elements of my code rely on design patterns like the
    Singleton
    pattern which in turn depend on private constructors. I could
    refactor
    my code but, ultimately, I would lose the benefits of the
    pattern
    (ie. one and only one instance of the Singleton class).
    I have also used private constructors to simulate enumerated
    types
    much like the enums you would find in Java 5 and up. But I
    can't
    use the same implementation in AS3 without private
    constructors.
    I do not want to resort to mixing legacy code with new AS3
    code to
    keep functionality intact. Are there any possible
    work-arounds for
    this issue?
    If not, are there any lobbying groups I need to know about so
    that
    we can get this feature back?

    http://www.gskinner.com/blog/archives/2006/07/as3_singletons.html

  • Why does AS3 error when opening AS2 sharedObject

    I have a .sol file that can be opened using AS2 but when AS3 opens it i get RangeError: Error #2006: The supplied index is out of bounds.
    at flash.net::SharedObject$/getLocal()
    I have tried the SharedObject.defaultObjectEncoding = ObjectEncoding.AMF0 but this is for writing, not for reading.  Not sure what to do but to trap/suppress the error.  Does not solve the issue, any takers?  If it works in AS2 then it should work in AS3!

    If it works in AS2 then it should work in AS3!
    no.  you can expect the as3 compiler (when in strict mode) to detect errors that as2 bypasses.
    click file/publish settings/flash and tick "permit debugging".  retest.  the problematic line number will be in the error message.

  • AS3.0 Slider to slide timeline is duplicating first frame. Why?

    I have made a slider that I am having issues with. This slider is to control the timeline of a movie clip when dragged. My problem with this is that It seems to be duplicating the first frame. When I slide the slider to the right it will hit first tick and still display what is in frame 1 .. then on the next ticks it will continue with the rest of the timeline. Any Ideas how to prevent / over come my slider from doing this with the first frame? I have dificulty explaining so I have atached an example.
    Thanks In advance.

    I have tried to upload the .fla but server wont let me.
    here is the code I am using for the slider. It controls numbers_mc that contains frames 1-16 all numbered 1-16 These numbers will be replaced later with images. Thanks
    s.setSize(240,1);
    s.maximum=numbers_mc.totalFrames;
    s.liveDragging=true;
    s.addEventListener(Event.CHANGE,updatemc);
    function updatemc(e:Event)
        numbers_mc.gotoAndStop(s.value);

  • HELP! Uploading AS3 Game to server, no sound and Spacebar doesn´t work HELP!

    Hello, relatively new to AS3 and flash, this is the first time i am publishing anything. We are trying to upload our simple flashgame to our webserver, the game works perfectly fine locally save for one thing. We get an error regarding TLF which says it wont stream or something. So when it gets online, no sounds play and spacebar doesn't work, left and right arrow does work. We have three TLF text fields that are used to update score, lives and show you final score. If i turn these into classical text they stop working.
    Things we have tried: Changing default linkage from RLS to Merged into code, changing the text boxes to classical text(they then stop working), made sure the paths are correct(all files are in the same directory including the .swz file)
    This is the code from the soundclass:
    package 
        import flash.net.URLRequest;
        import flash.media.Sound;
        import flash.media.SoundChannel;
        import flash.events.*;
        public class MySound
            private var bgSound:Sound;
            private var fireSound:Sound;
            private var waterSound:Sound;
            private var earthSound:Sound;
            private var lightSound:Sound;
            private var soundChannel:SoundChannel;
            public function MySound()
                soundChannel = new SoundChannel();
                bgSound = new Sound();
                var req:URLRequest = new URLRequest("BackgroundSound.mp3");
                bgSound.load(req);
                //fire
                fireSound = new Sound();
                var req2:URLRequest = new URLRequest("soundFire.mp3");
                fireSound.load(req2);
                // water
                waterSound = new Sound();
                var req3:URLRequest = new URLRequest("soundWater.mp3");
                waterSound.load(req3);
                // earth
                earthSound = new Sound();
                var req4:URLRequest = new URLRequest("soundEarth.mp3");
                earthSound.load(req4);
                // light
                lightSound = new Sound();
                var req5:URLRequest = new URLRequest("soundLight.mp3");
                lightSound.load(req5);
            public function playBgSound()
                soundChannel = bgSound.play(0, 999999);
            public function stopBgSound()
                soundChannel.stop();
            public function playFireSound()
                fireSound.play();
            public function playWaterSound()
                waterSound.play();
            public function playEarthSound()
                earthSound.play();
            public function playLightSound()
                lightSound.play();
    I can somewhat get that sound can bugg out, but why does spacebar stop functioning? ANy help is greatly appreciated as this has to be delivered in twelve hours(published online) for a school assignment.

    Also might add publishing it locally in my own browser everything works, as does ofcourse playing it in flash itself. Changing from RLS to merged into code stops the error from coming, but doesn´t fix the problem on the server.
    Code from main class related to sound and spacebar:
    import flash.display.*;
        import flash.events.*;
        import flash.ui.Keyboard;
        import flash.text.TextField;
        import flash.media.Sound;
        import flash.net.URLRequest;
        import flash.events.MouseEvent;
        import flash.utils.Timer;
        import flash.events.TimerEvent;
        public class main extends MovieClip
            private var fireTimer:Timer; //delay between shots
            private var canFire:Boolean = true;
            private var mySound:MySound;
            private var bulletSpeed:Number = -450;
              public function main()
                //load sounds
                mySound = new MySound();
            private function playGame(event:MouseEvent)
                gotoAndStop(2);
                // initialize
                myLives = 5;
                myHitsNo = 0;
                weaponType = 1;
                mybullets = new Array();
                enemys = new Array();       
                myScoreTxt.text = "Score: " + myHitsNo;
                myLivesTxt.text = "Lives: " + myLives;   
                fireTimer = new Timer(400, 1);
                fireTimer.addEventListener(TimerEvent.TIMER, shootTimerHandler, false, 0, true);
                stage.addEventListener(KeyboardEvent.KEY_DOWN, listenKeyDown);
                stage.addEventListener(Event.ENTER_FRAME, addEnemy);
                stage.addEventListener(Event.ENTER_FRAME, checkCollision);   
                player = new thePlayer(stage.stageWidth-40, spawnPoint2);// stage.stageHeight/2);
                stage.focus = player;
                addChild(player);
                mySound.playBgSound();
    public function listenKeyDown(event:KeyboardEvent)  // Controls and weapontype selector
                if (event.keyCode == 37) //left
                    player.movethePlayerDown();
                if (event.keyCode == 39) //right
                    player.movethePlayerUp();
    if (event.keyCode == Keyboard.SPACE) //space
                    shootBullet();
                    //soundFX.attachSound("Pistol Fire.wav");
                    //soundFX.start();

Maybe you are looking for

  • How to change HR assignment for BP with employee role in CRM

    Hi, we download employees from R3 HR into CRM. By mistake, some duplicates BP were created. we want to change the assignment with the BP employee in CRM and the employee in R3. In other word, to remove the personnel number ID stored in CRM and to add

  • LoadingSecondFile - Dosen't work

    loadMovie() loads SWFs into _root.mc1.mc2, and I use the below method to be able to identify the selected movieclip. It works when I load the first SWF but when the second SWF is been loaded it dosen't work. What may be the cause for this. I tried un

  • Script for rename the pictures name as login names

    I have staff pictures (100+) and pictures name as ID of staff. But I want to rename all with login names. any idea of writing a script? Best lasantha

  • Generating DME format by executing F110

    Hi As per the bank requested, we have an developed and Data Medium Engine format using DMEE. After executing the payment run, I had downloaded the output of the file using Environment --> Payment Medium  --> DME Administration When i go into Environm

  • Invoice verification date

    Hi experts a really simple quest in which table does invoice verification date sit, or do i have to via the change table to get it just as i would for PO release date and if so which tables do i use