Posts Tagged as3

Drop Down Menu with AS3

Here is a code snippet that I have been using to create dropdown menus from movieclips in actionscript 3. I probably should try to wrap this up in a class as I bust out this snippet whenever I need this functionality. Usually when I have a ‘button’ that I need to have open up a larger movieclip with selectable/dynamic information in it. Would be nice to set a moviclip to be the ‘menu trigger’ (in the example: _sMouseOver) and another to be ‘the target’ (in the example: _sMenu) in a class… Maybe I will work on a class implementation later.

  AS3 Mouse Over Menu (15.4 KiB, 31 hits)

Code Snippet after the jump: Read the rest of this entry »

,

No Comments

AS3 – Snow Effect

The best snow script that I have seen thus far. You get great performance even with 1500 different snowflakes in the movie and practically everything is customizable. I will definitely be using this in projects that require a snow affect.

What you can customize:

  • side the snow blows in from
  • number of flakes
  • size of flakes
  • distance from camera (range)
  • snow alpha
  • wind force
  • time between wind force changes
  • gravity (b/c who doesnt want 0 gravity snow)
  • Check it out: Tim Soret – Snow

    , ,

    1 Comment

    HTTPService and ArrayCollection in Flash CS4

    Recently I had a need to use the HTTPService & ArrayCollection Flex classes from inside Flash CS4. In order to do this you need to point to the Flex classes in your Flash preferences as outlined in this post. Code after the jump. Read the rest of this entry »

    , , ,

    1 Comment

    Setup WAMP and the Zend Framework for use with Flash and Flex

    There are a few tutorials out there on the net about using Zend with Flash/Flex but most seem to be overly complicated and many don’t work even after following the instructions. (I am hoping that mine will. :) ) The next few articles cover a VERY simple implementation that you can build on for use with future projects and I hope it can save people time when it comes to beginning to explore this new method. This post will deal with setting up your environment to be able to use Zend with Flash/Flex.

    Code and instructions after the jump. Read the rest of this entry »

    , , , ,

    1 Comment

    AS3 – Load XML Document Class Example

    One thing that I do quite often in Flash is load XML. In order to save time, I separated a lot of that code out into external class files. I also created a snippet of code that calls those files in order to save time when I want to use them. (You will need Lee Brimlow’s snippets panel for this to work.)

    The LoadXML and LoadURL classes are probably very similar to those found at Learning Actionscript 3 as that is where I learned a lot about this topic previously. Hope you find this helpful!

      Load XML files (774.5 KiB, 25 hits)

    Code snippet (for the panel) after the break…

    Read the rest of this entry »

    , , , ,

    No Comments

    AS3 – Draw Circle Animation Based on Time

    If you need to perform an animation and have it be standard when viewed across different machines, it is best to use an onEnterFrame event. I had a need in a project recently to draw a circle in a specified amount of time. I had been using the Timer class but found major time discrepancies between running the code locally and running the code in a browser. With some code that Jackson Dunstan provided, I was able to modify the animation so that you can start/stop drawing the circle based on user input. (In the sample provided it is by clicking the stage) I hope this helps someone in a similar situation. Code after the jump…

    Read the rest of this entry »

    , , ,

    1 Comment

    AS3 – Search & Replace a Word

    In a project I was working on recently there was some information coming back from the database that I was displaying in a textfield. I didnt have any control of the text stored in the database and it was saying to ‘click the button above…’ but in this new interface we were designing, the button was below this textfield. I wrote a little function that replaced the word ‘above’ with ‘below’. Code after the break.

    Read the rest of this entry »

    ,

    No Comments

    AS3 – Uppercase an input textfield’s contents automatically

    Here is a quick snippet on how to automatically set an input textfield’s text to uppercase. (If you do it on the KeyboardEvent.KEY_UP event, the text will initially show as lowercase than change to uppercase.)

    1
    2
    3
    4
    5
    
    text_txt.addEventListener(Event.CHANGE, toUpperCase)
     
    private function toUpperCase(evt:Event):void {
    	evt.target.text = evt.target.text.toUpperCase();
    }

    ,

    No Comments