Enums used by several classes

Hi, I have a few enums usen by several classes. Some are related, some are not. In C I would put all the enums in a header file and include it in all source files. How do I solve this in Java?

kozmic wrote:
How do I solve this in Java?Solve what? Making something available to all classes? Just declare it public and make sure its jar or class file is on your classpath.

Similar Messages

  • Understanding the use of interface class?

    Hello,
    This question referes to java servlets, but the questions is about java design.
    My wrox java server pages text, includes an example where some user data is posted to servlet.
    To process the data posted and store this, they created a interface class and another class AdminManager which implements the interface.
    In the servlet they create an object from the interface class, and call the AdminManager methods through the interface object.
    In the book this was the only example which used a interface. And I wondered if this design approach was often used, or should an interface normally be used if several classes would implement the interface.
    Thanks

    It depends. You might want to create an interface even if you only have a single implementation of that interface in mind, because you want to make it easy to create more implemenations later.
    Also keep in mind that not all implementations of an interface are strictly for production use. For example, you might want to define an interface, define an implementation of that interface for production use, but then also define a "mock" version of that interface for testing, prototyping, etc.
    Generally I feel that if you have a sufficiently complex set of types and relationships between those types, it makes a lot of sense to express those relationships purely as interfaces, on a high level. Then provide implemenations as a separate step in the programming process.

  • How to use the message class CL_BSP_MESSAGES in the event handler?

    Hiii,
    I need to use the message class CL_BSP_MESSAGES in the even handler, because I need to use the Condition co_cancel_event_prefix to prevent saving in the method
    global_messages->add_message(
                                            condition = co_cancel_event_prefix
                                            message   = TEXT-010
                                            severity  = cl_bsp_messages=>co_severity_error ).
                                            dummy     = ME->COMPONENT_ID ).
    Can anybody explain me how to use this method?
    Kind Regards,
    John

    solved

  • How can I create a Web Service with several classes

    Hello,
    I developed an API which I want to use to create a webService that offer an acces to all the classes and use all their methods.I tried this with Netbeans but I view that I will have a WSDL file for each class.
    But I have tested the yahoo api web service of the image search and it offer acces to several objects such us request and result.So I want to make a service that offer the use of several objects. Can I do this.If yes how ? Because I have read tutorials about WebServices and they mention that to create a webservice I must have an EndPoint class so only one class.
    Please I juste began with webservices so I don't know how to do.
    Thanks in advance.

    I don't believe this is possible when starting from Java. I think you need to start with a WSDL to get this to work. I am curious as to why having multiple WSDLs is an issue, would you care to eloborate.
    Thanks

  • Keyword "enum" used in package definition of pre 1.5 library

    Hello,
    I want to use a "old" library which defines a package
    org.pokersource.enum
    When I try to use it with java 1.5 the word "enum" is rejected because it is reserved now.
    Is there any simple way to use this old library with java 1.5?
    Thank you.

    What kind of acces are you making to the offending library classes?
    I doubt you can make any kind of access directly from 1.5 (and I'm assuming you don't have the source for the library).
    What might be possible is to write some kind of addapter classes compiled with -source=1.4 giving your Tiger code indirect acceess to the library.
    Another possible avenue to explore might be loading the offending classes dynamically and accessing them by introspection. Perhaps consider using a proxy class. (You can define your own interface, then use a Map to map the methods of the interace to the introspected methods of the dynamically loaded class).

  • Use of Codec class genereted by Autotyype for xml-jave binding?

    I have generated the java representation and codec classes using Autotype against xml schema. Just wondering can i use this codec class to do Java to xml binding like other tools (XMLBeans, JAXB and Castor) do. If answer is yes can you give me an example how can I use it.
    Thanks,
    Mujeeb

    manoj,
    Thanks for the help.
    Sample 4 tells me that there is no code generated that I can use to write out
    my non-built-in datatype to xml. For each of my non-built-in datatypes, I will
    have to hand write such code, or use a handler.
    John
    "manojc" <[email protected]> wrote:
    Here is an example of start form WSDL usecase:
    http://www.manojc.com/?sample11
    If you want to log the xml input/output to the web service
    you can use a handler. You need to edit the web-services.xml
    dd file to add handler.
    Here is a example of using handler. But this use source2wsdd
    instead of wsdl2service:
    http://www.manojc.com/?sample4
    Regards,
    -manoj
    "John Franey" <[email protected]> wrote in message
    news:3ef30db2$[email protected]..
    Hi,
    I created a wsdl and used the autotype and wsdl2service ant tasks togenerate
    java files.
    As part of my service, I want to log output in xml format of the datareceived.
    I can write my own serialization, or use the code that was generatedby
    autotype.
    I would rather not write my own. I want to use the code generated bywsdl2service.
    Trouble is I can not find a javadoc nor a sample code segment thatshows
    how!
    Call me dense, but I've spent several hours on BEA web pages lookingfor
    answers.
    This is what I found, but I could not get to work for various reasons:
    XML streaming: I have a codec (generated by autotype ant task), butit
    requires
    a SerializationContext. Where do I get a Serialization Context? I thinkserialize
    is a callout from WS and not for applicaiton code to call.
    javax.xml.rpc.encoding.Serializer: An object of this type is madeavailable by
    AbstractCodec (base class of generated code, but how is this classused?
    [Sorry if you've seen this posting a couple of days ago on interest.xml
    newsgroup.>>  I didn't intend to repost but due to lack of response there, I thought>this newsgroup>> was more appropriate and read more.
    Thanks,
    John

  • How do I find, at-a-glance, the sample size used in several music files?

    How do I find, at-a-glance, the sample size used in several music files?
    Of all the fields available in a FInder Search, "Sample Size" is not available. Finder does offer a "Bits per Sample" field, but it only recognized graphic files and not music files.
    Running 10.8.5 on an iMac i5.
    I did search through a couple of communities but came up empty.
    Thank you,
    Craig

    C-squared,
    There is no View Option to allow display of a column of sample size. 
    For WAV or Apple Lossless files, it is available on the Summary tab (one song at a time, as you know).  For MP3 and AAC it is not available at all.
    You can roughly infer it from the files that are larger than expected for their time.
    99% of the music we use is at the CD standard of 16-bit, so I can guess that displaying it has never been a priority.  However, if you want to make a suggestion to Apple, use this link:
    http://www.apple.com/feedback/itunesapp.html

  • Previewing an image before uploading it using the FileReference class

    Previewing an image before uploading it using the FileReference class in flash player 3 not in SDK4

    Previewing an image before uploading it using the FileReference class in flash player 3 not in SDK4

  • Previewing an image before uploading it using the FileReference class in flex 3

    Previewing an image before uploading it using the FileReference class in flex 3 ?

    hai,
              when this code is used in my application ,i got the name of image and new frame is added each time .But image is not displayed.....
    The code  starts like this
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
                xmlns:mx="library://ns.adobe.com/flex/mx" initialize="init()"   backgroundColor="white" width="100%" height="100%">
        <fx:Script>
    <![CDATA[ 
                    import mx.controls.Alert;
                    import mx.messaging.Channel;
                    import mx.messaging.ChannelSet;
                    import mx.messaging.channels.AMFChannel;
                    import mx.rpc.events.ResultEvent;
                    import mx.controls.Image;
                    import spark.events.IndexChangeEvent;
                    import mx.managers.DragManager;
      <mx:DataGridColumn headerText="Dimension Value"  width="10" dataField="dimensionValue"/>
                                                   <mx:DataGridColumn headerText="Unit Nmae"  width="10" dataField="dimensionUnitName"/>
                                                   </mx:columns>
                                           </mx:DataGrid>
                                           <mx:Spacer width="2%"/>
                                       </mx:HDividedBox>
                                       </mx:VBox>
                   <mx:Spacer height="0"/>
                <mx:VBox width="100%">
                    <s:HGroup height="90" top="0" left="0" right="0" verticalAlign="justify" gap="10" paddingLeft="5" paddingRight="5" paddingTop="5" paddingBottom="5">
                        <s:Button id="btn_loader" top="5" bottom="24" width="100" label="load" click="loadImages()"/>
                        <s:Group width="100%">
                            <s:Group name="cl" top="0" left="0" bottom="0" width="20" mouseOver="//scroll_on(event)" mouseOut="//scroll_off(event)">
                                <s:BitmapImage source="@Embed('../assets/left.jpg')" top="0" left="0" bottom="0" right="0" fillMode="scale"/>   
                            </s:Group>
                            <s:List id="imgList" skinClass="skins.ListSkin" top="-3" left="27" right="28" bottom="10"
                                    dataProvider="{ImageCollection}" itemRenderer="Image_Render">
                                <s:layout>
                                    <s:HorizontalLayout gap="0"/>
                                </s:layout>
                            </s:List>
                            <s:Group name="cr" top="0" right="0" bottom="0" width="20" mouseOver="//scroll_on(event)" mouseOut="//scroll_off(event)">
                                <s:BitmapImage source="@Embed('../assets/right.jpg')" top="-1" left="0" bottom="0" right="0" fillMode="scale"/>
                            </s:Group>
                        </s:Group>
                    </s:HGroup>
                    <s:SkinnableContainer id="dropCanvas" top="100" left="5" right="5" bottom="5" backgroundAlpha="1.0" alpha="1.0"
                                          dragEnter="dropCanvas_dragEnterHandler(event)"
                                          dragDrop="dropCanvas_dragDropHandler(event)" contentBackgroundColor="#914E4E" backgroundColor="#F7F7F7">
                    </s:SkinnableContainer>
                </mx:VBox>
                <mx:Spacer height="5"/>
                                      </mx:VDividedBox>
        </mx:Panel>
    </mx:Canvas>

  • Be grateful for your help with Photoshop Elements which I have been using for several years.

    Be grateful for your help with Photoshop Elements which I have been using for several years.  Does Elements need to have access to ‘My Pictures’ on Windows as when I remove Photos from ‘My Pictures’, Elements later, when backing up, gives a message that it is unable to ‘reconnect’ to the same picture on elements.  On other occasions when removing a photo from Elements catalogue I also get a similar message when backing up saying ‘unable to reconnect’.  1. Is there a relationship between Elements and My Pictures and is Elements dependant on    the Windows ‘My Pictures’? 2. Why does some photos in Elements in some cases cause them to multiply e.g. double; triple; quadruple; and on occasions even more?  Is there something I need to do to stop this or an easy way I can remove the multiples without spending hours doing it manually one by one?  Am I doing something wrong? My O/S is Windows XP SP2 and windows Vista on my Laptop.  I have been using Elements 5 and have just purchased Photoshop Elements 8.0. (Upgrade) and about to install it. Be grateful for any advice as I do enjoy using the program if only I can resolve this issue.  I am not a PC wiz and mainly use Elements to catalogue photos from which I compile collections and from them slide shows with music.  Any advice appreciated Sonny.t PS Have tried to post this previously but without success so hoping to see message appear and a +response

    The organizer doesn't care where you send your photos when you download them via the downloader or where they happen to be when you first bring them in if you use the Get Photos command, but once your pics are in the Organizer, you *must* move them from within organizer or it can't find them. You don't have to use My Pictures at all if you don't want to, but regardless of the folder where you put your photos, if you want them someplace else, you use organizer to do it.

  • Tracking Memory usage on iOS using the Stats class

    I've been checking memory usage on an app I'm developing for iOS using the Stats class https://github.com/mrdoob/Hi-ReS-Stats ( http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c3-315cd077124319488fd-7fff.html#WS 948100b6829bd5a61637f0a412623fd0543-8000).
    I added the Stats class to my project and redeployed and, yikes, memory usage reported in Stats creeps up (pretty slowly) even when there's nothing happening in the app (just showing a loaded bitmap).
    To try and track down the issue I created a project with a test class that extends Sprite with just this single call in the constructor :-
    addChild( new Stats() );
    I deployed it to the device to check that it didn't gobble any memory.
    But I was Suprised to watch the memory usage creep up and up (to approx 5) before some garbage collection kicked in and takes memory back down. I left it running and then it crept up again to over 7.5 this time before being kicked back down to just below 3.
    So 2 related questions that I'd appreciate any feedback/observations/thoughts on :-
    1 - Is this normal (i.e. memory creeping up when there's nothing other than Stats in the project) ?
    2 - What is the best way to monitor memory usage within an app ? Is Stats good enough - is Stats itself causing the memory usage ?
    All the best guys !

    Also see thread (http://forums.adobe.com/message/4280020#4280020)
    My conclusions are :-
    - If you run an app and leave it idle, memory usage gradually creeps up (presumably as memory is being used to perform calcs/refresh the display etc)
    - Periodically the garbage collection kicks in and memory is brought back down
    - This cycle could be in excess of 5 mins
    Run with your real app and memory will increase and be released much more rapidly/regularly.
    - It's probably worth performing initial checks by running on your desktop to iron out any initial problems

  • How to use the Rectangle class to draw an image and center it in a JPanel

    I sent an earlier post on how to center an image in a JPanel using the Rectangle class. I was asked to send an executable code which will show the malfunction. The code below is an executable code and a small part of a very big project. To simplifiy things, it is just a JFrame and a JPanel with an open dialog. Once executed the JFrame and the FileDialog will open. You can then navigate to a .gif or a .jpg picture and open it. What I want is for the picture to be centered in the middle of the JPanel and not the upper left corner. It is also important to stress that, I am usinig the Rectangle class to draw the Image. The region of interest is where the rectangle is created. In the constructor of the CenterRect class, I initialize the Rectangle class. Then I use paintComponent in the CenterRect class to draw the Image. The other classes are just support classes. The MyImage class is an extended image class which also has a draw() method. Any assistance in getting the Rectangle to show at the center of the JPanel without affecting the size and shape of the image will be greatly appreciated.
    I have divided the code into three parts. They are all supposed to be on one file in order to execute.
    import java.awt.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class CenterRect extends JPanel {
        public static Rectangle srcRect;
        Insets insets = null;
        Image image;
        MyImage imp;
        private double magnification;
        private int dstWidth, dstHeight;
        public CenterRect(MyImage imp){
            insets = getInsets();
            this.imp = imp;
            int width = imp.getWidth();
            int height = imp.getHeight();
            ImagePanel.init();
            srcRect = new Rectangle(0,0, width, height);
            srcRect.setLocation(0,0);
            setDrawingSize(width, height);
            magnification = 1.0;
        public void setDrawingSize(int width, int height) {
            dstWidth = width;
            dstHeight = height;
            setSize(dstWidth, dstHeight);
        public void paintComponent(Graphics g) {
            Image img = imp.getImage();
         try {
                if (img!=null)
                    g.drawImage(img,0,0, (int)(srcRect.width*magnification), (int)(srcRect.height*magnification),
              srcRect.x, srcRect.y, srcRect.x+srcRect.width, srcRect.y+srcRect.height, null);
            catch(OutOfMemoryError e) {e.printStackTrace();}
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new Opener().openImage();
    class Opener{
        private String dir;
        private String name;
        private static String defaultDirectory;
        JFrame parent;
        public Opener() {
            initComponents();
         public void initComponents(){
            parent = new JFrame();
            parent.setContentPane(ImagePanel.panel);
            parent.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
            parent.setExtendedState(JFrame.MAXIMIZED_BOTH);
            parent.setVisible(true);
        public void openDialog(String title, String path){
            if (path==null || path.equals("")) {
                FileDialog fd = new FileDialog(parent, title);
                defaultDirectory = "dir.image";
                if (defaultDirectory!=null)
                    fd.setDirectory(defaultDirectory);
                fd.setVisible(true);
                name = fd.getFile();
                if (name!=null) {
                    dir = fd.getDirectory();
                    defaultDirectory = dir;
                fd.dispose();
                if (parent==null)
                    return;
            } else {
                int i = path.lastIndexOf('/');
                if (i==-1)
                    i = path.lastIndexOf('\\');
                if (i>0) {
                    dir = path.substring(0, i+1);
                    name = path.substring(i+1);
                } else {
                    dir = "";
                    name = path;
        public MyImage openImage(String directory, String name) {
            MyImage imp = openJpegOrGif(dir, name);
            return imp;
        public void openImage() {
            openDialog("Open...", "");
            String directory = dir;
            String name = this.name;
            if (name==null)
                return;
            MyImage imp = openImage(directory, name);
            if (imp!=null) imp.show();
        MyImage openJpegOrGif(String dir, String name) {
                MyImage imp = null;
                Image img = Toolkit.getDefaultToolkit().getImage(dir+name);
                if (img!=null) {
                    imp = new MyImage(name, img);
                    FileInfo fi = new FileInfo();
                    fi.fileFormat = fi.GIF_OR_JPG;
                    fi.fileName = name;
                    fi.directory = dir;
                    imp.setFileInfo(fi);
                return imp;
    }

    This is the second part. It is a continuation of the first part. They are all supposed to be on one file.
    class MyImage implements ImageObserver{
        private int imageUpdateY, imageUpdateW,width,height;
        private boolean imageLoaded;
        private static int currentID = -1;
        private int ID;
        private static Component comp;
        protected ImageProcessor ip;
        private String title;
        protected Image img;
        private static int xbase = -1;
        private static int ybase,xloc,yloc;
        private static int count = 0;
        private static final int XINC = 8;
        private static final int YINC = 12;
        private int originalScale = 1;
        private FileInfo fileInfo;
        ImagePanel win;
        /** Constructs an ImagePlus from an AWT Image. The first argument
         * will be used as the title of the window that displays the image. */
        public MyImage(String title, Image img) {
            this.title = title;
             ID = --currentID;
            if (img!=null)
                setImage(img);
        public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h) {
             imageUpdateY = y;
             imageUpdateW = w;
             imageLoaded = (flags & (ALLBITS|FRAMEBITS|ABORT)) != 0;
         return !imageLoaded;
        public int getWidth() {
             return width;
        public int getHeight() {
             return height;
        /** Replaces the ImageProcessor, if any, with the one specified.
         * Set 'title' to null to leave the image title unchanged. */
        public void setProcessor(String title, ImageProcessor ip) {
            if (title!=null) this.title = title;
            this.ip = ip;
            img = ip.createImage();
            boolean newSize = width!=ip.getWidth() || height!=ip.getHeight();
         width = ip.getWidth();
         height = ip.getHeight();
         if (win!=null && newSize) {
                win = new ImagePanel(this);
        public void draw(){
            CenterRect ic = null;
            win = new ImagePanel(this);
            if (win!=null){
                win.addIC(this);
                win.getCanvas().repaint();
                ic = win .getCanvas();
                win.panel.add(ic);
                int width = win.imp.getWidth();
                int height = win.imp.getHeight();
                Point ijLoc = new Point(10,32);
                if (xbase==-1) {
                    xbase = 5;
                    ybase = ijLoc.y;
                    xloc = xbase;
                    yloc = ybase;
                if ((xloc+width)>ijLoc.x && yloc<(ybase+20))
                    yloc = ybase+20;
                    int x = xloc;
                    int y = yloc;
                    xloc += XINC;
                    yloc += YINC;
                    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
                    count++;
                    if (count%6==0) {
                        xloc = xbase;
                        yloc = ybase;
                    int scale = 1;
                    while (xbase+XINC*4+width/scale>screen.width || ybase+YINC*4+height/scale>screen.height)
                        if (scale>1) {
                   originalScale = scale;
                   ic.setDrawingSize(width/scale, height/scale);
        /** Returns the current AWT image. */
        public Image getImage() {
            if (img==null && ip!=null)
                img = ip.createImage();
            return img;
        /** Replaces the AWT image, if any, with the one specified. */
        public void setImage(Image img) {
            waitForImage(img);
            this.img = img;
            JPanel panel = ImagePanel.panel;
            width = img.getWidth(panel);
            height = img.getHeight(panel);
            ip = null;
        /** Opens a window to display this image and clears the status bar. */
        public void show() {
            show("");
        /** Opens a window to display this image and displays
         * 'statusMessage' in the status bar. */
        public void show(String statusMessage) {
            if (img==null && ip!=null){
                img = ip.createImage();
            if ((img!=null) && (width>=0) && (height>=0)) {
                win = new ImagePanel(this);
                draw();
        private void waitForImage(Image img) {
        if (comp==null) {
            comp = ImagePanel.panel;
            if (comp==null)
                comp = new JPanel();
        imageLoaded = false;
        if (!comp.prepareImage(img, this)) {
            double progress;
            while (!imageLoaded) {
                if (imageUpdateW>1) {
                    progress = (double)imageUpdateY/imageUpdateW;
                    if (!(progress<1.0)) {
                        progress = 1.0 - (progress-1.0);
                        if (progress<0.0) progress = 0.9;
    public void setFileInfo(FileInfo fi) {
        fi.pixels = null;
        fileInfo = fi;
    }

  • Uploading files using FTP(Linlyn class)

    I'm currently learning java right now on my own, and I'm having some trouble.
    I'm trying to upload a txt file using the linlyn class. How do you create a file then upload it on an applet?

    I'm currently learning java right now on my own, and I'm having some trouble.
    I'm trying to upload a txt file using the linlyn class. How do you create a file then upload it
    from an applet?

  • How to trigger New page while using ALV with classes/oops?

    Hi All
    I am trying to print a report which has to show the data in two pages.
    I am using ALV with classes/oops.
    Though I am able to print the report but a new page is not coming. Whole of the data is coming in one single page.
    Please tell me as to how to trigger a NEW PAGE while using ALV with classes/oops.
    Please send some code samples also if available.
    Thanks in advance.
    Jerry

    using sort option you can do it. in case of grid/oo alv class ALV you can view that only in print mode/preview mode.
    in case of list you can view that directly.
    sort-fieldname = 'FIELDNAME'.
    sort-group = '*'  "triggers new page
    sort-up = 'X'.
    append sort to it_sort.

  • Using a FireFX Class

    I found this class today which is really cool:
    http://www.gskinner.com/blog/archives/2007/11/fire_effect_com.html
    However, I've never used a public class before.  I've been reading up on them all morning.  I'll provide the code for it here as well.  Anyway, the author also provides a sample application using the class; however, it's a bit different than what I've been reading.  He doesn't call the class in his code;however, it seems he has the class in his library, which is news to me.
    Anyway, the biggest thing I'm after is trying to design my own application calling this class and just hardcoding the fire aspects in my application.  However, I'm coming up empty at every angle.  Any help would be much appreciated!
    Here's the class he created:
    * FireFX by Grant Skinner. May 30, 2007
    * Visit www.gskinner.com/blog for documentation, updates and more free code.
    * You may distribute and modify this class freely, provided that you leave this header intact,
    * and add appropriate headers to indicate your changes. Credit is appreciated in applications
    * that use this code, but is not required.
    * Please contact [email protected] for more information.
    package com.gskinner.effects {
                import flash.display.BitmapData;
                import flash.geom.Matrix;
                import flash.geom.Point;
                import flash.geom.ColorTransform;
                import flash.filters.ColorMatrixFilter;
                import flash.filters.BlurFilter;
                import flash.filters.DisplacementMapFilter;
                import flash.display.Sprite;
                import flash.display.MovieClip;
                import flash.events.Event;
                import flash.display.Bitmap;
                import flash.display.DisplayObject;
                public class FireFX extends Sprite {
                            private var _fadeRate:Number=0.4;
                            private var _distortionScale:Number=0.4;
                            private var _distortion:Number=0.5;
                            private var _flameHeight:Number=0.3;
                            private var _flameSpread:Number=0.3;
                            private var _blueFlame:Boolean = false;
                            private var _smoke:Number = 0;
                // private properties:
                            // display elements:
                            private var displayBmp:BitmapData;
                            private var scratchBmp:BitmapData;
                            private var perlinBmp:BitmapData;
                            // geom:
                            private var mtx:Matrix;
                            private var pnt:Point;
                            private var drawColorTransform:ColorTransform;
                            // filters:
                            private var fireCMF:ColorMatrixFilter;
                            private var dispMapF:DisplacementMapFilter;
                            private var blurF:BlurFilter;
                            // other:
                            private var endCount:Number;
                            private var bmpsValid:Boolean=false;
                            private var perlinValid:Boolean=false;
                            private var filtersValid:Boolean=false;
                            private var _target:DisplayObject;
                            public function FireFX() {
                                        var frame:DisplayObject = getChildAt(0);
                                        frame.visible = false;
                                        frame.height = height;
                                        frame.width = width;
                                        scaleX = scaleY = 1;
                                        mtx = new Matrix();
                                        pnt = new Point();
                                        startFire();
                            // getter/setters:
                            override public function set width(value:Number):void {
                                        bmpsValid &&= (value == width);
                                        super.width = value|0;
                            override public function get width():Number {
                                        return super.width;
                            override public function set height(value:Number):void {
                                        bmpsValid &&= (value == height);
                                        super.height = value|0;
                            override public function get height():Number {
                                        return super.height;
                            [Inspectable(defaultValue=0.4,name='fadeRate (0-1)')]
             * Sets the rate that flames fade as they move up. 0 is slowest, 1 is fastest.
             * @default 0.4
                            public function set fadeRate(value:Number):void {
                                        filtersValid &&= (value == _fadeRate);
                                        _fadeRate = value;
                            public function get fadeRate():Number {
                                        return _fadeRate;
                            [Inspectable(defaultValue=0.4,name='distortionScale (0-1)')]
             * Sets the scale of flame distortion. 0.1 is tiny and chaotic, 1 is large and smooth.
             * @default 0.4
                            public function set distortionScale(value:Number):void {
                                        perlinValid &&= (value == _distortionScale);
                                        _distortionScale = value;
                            public function get distortionScale():Number {
                                        return _distortionScale;
                            [Inspectable(defaultValue=0.4,name='distortion (0-1)')]
             * Sets the amount of distortion. 0.1 is little, 1 is chaotic.
             * @default 0.4
                            public function set distortion(value:Number):void {
                                        filtersValid &&= (value == _fadeRate);
                                        _distortion = value;
                            public function get distortion():Number {
                                        return _distortion;
                            [Inspectable(defaultValue=0.3,name='flameHeight (0-1)')]
             * Sets the how high the flame will burn. 0 is zero gravity, 1 is a bonfire.
             * @default 0.3
                            public function set flameHeight(value:Number):void {
                                        perlinValid &&= (value == _flameHeight);
                                        _flameHeight = value;
                            public function get flameHeight():Number {
                                        return _flameHeight;
                            [Inspectable(defaultValue=0.3,name='flameSpread (0-1)')]
             * Sets the how much the fire will spread out around the target. 0 is no spread, 1 is a lot.
             * @default 0.3
                            public function set flameSpread(value:Number):void {
                                        filtersValid &&= (value == _flameSpread);
                                        _flameSpread = value;
                            public function get flameSpread():Number {
                                        return _flameSpread;
                            [Inspectable(defaultValue=false,name='blueFlame')]
             * Indicates whether it should use a blue or red flame.
             * @default false
                            public function set blueFlame(value:Boolean):void {
                                        filtersValid &&= (value == _blueFlame);
                                        _blueFlame = value;
                            public function get blueFlame():Boolean {
                                        return _blueFlame;
                            [Inspectable(defaultValue=0,name='smoke (0-1)')]
             * Sets the amount of smoke. 0 little, 1 lots.
             * @default 0
                            public function set smoke(value:Number):void {
                                        filtersValid &&= (value == _smoke);
                                        _smoke = value;
                            public function get smoke():Number {
                                        return _smoke;
                            [Inspectable(defaultValue='',name='target')]
             * Sets the amount of smoke. 0 little, 1 lots.
             * @default
                            public function set targetName(value:String):void {
                                        var targ:DisplayObject = parent.getChildByName(value);
                                        if (targ == null) {
                                                    try { targ = parent[value] as DisplayObject; }
                                                    catch (e:*) {}
                                        target = targ;
             * Defines the shape of the fire. The fire will burn upwards, so it should be near the bottom, and centered in the FireFX component.
             * @default
                            public function set target(value:DisplayObject):void {
                                        _target = value;
                                        clear();
                            public function get target():DisplayObject {
                                        return _target;
             * Clears the fire.
                            public function clear():void {
                                        if (displayBmp) {
                                                    displayBmp.fillRect(displayBmp.rect,0);
             * Stops the fire effect after letting it burn down over 20 frames.
                            public function stopFire():void {
                                        // let the fire burn down for 20 frames:
                                        if (endCount == 0) { endCount = 20; }
                            private function updateBitmaps():void {
                                        if (displayBmp) {
                                                    displayBmp.dispose();
                                                    displayBmp = null;
                                                    scratchBmp.dispose();
                                                    scratchBmp = null;
                                                    perlinBmp.dispose();
                                                    perlinBmp = null;
                                        displayBmp = new BitmapData(width, height, true, 0);
                                        scratchBmp = displayBmp.clone();
                                        perlinBmp = new BitmapData(width*3, height*3, false, 0);
                                        while (numChildren) { removeChildAt(0); }
                                        addChild(new Bitmap(displayBmp));
                                        updatePerlin();
                                        updateFilters();
                                        bmpsValid = true;
                            private function updatePerlin():void {
                                        perlinBmp.perlinNoise(30*_distortionScale,20*_distortionScale,1,-Math.random()*1000|0,fals e,true,1|2,false);
                                        perlinBmp.colorTransform(perlinBmp.rect,new ColorTransform(1,  1-_flameHeight*0.5  ,1,1,0,0,0,0));
                                        perlinValid = true;
                            function updateFilters():void {
                                        if (_blueFlame) {
                                                    fireCMF = new ColorMatrixFilter([0.8-0.55*_fadeRate,0,0,0,0,
                                                                                                                                                     0,0.93-0.48*_fadeRate,0,0,0,
                                                                                                                                                     0,0.1,0.96-0.35*_fadeRate,0,0,
                                                                                                                                                     0,0.1,0,1,-25+_smoke*24]);
                                                    drawColorTransform = new ColorTransform(0,0,0,1,210,240,255,0);
                                        } else {
                                                    fireCMF = new ColorMatrixFilter([0.96-0.35*_fadeRate,0.1,0,0,-1,
                                                                                                                                                     0,0.9-0.45*_fadeRate,0,0,0,
                                                                                                                                                     0,0,0.8-0.55*_fadeRate,0,0,
                                                                                                                                                     0,0.1,0,1,-25+_smoke*24]);
                                                    drawColorTransform = new ColorTransform(0,0,0,1,255,255,210,0);
                                        dispMapF = new DisplacementMapFilter(perlinBmp,pnt,1,2,14*_distortion,-30,"clamp");
                                        blurF = new BlurFilter(32*_flameSpread,32*_flameSpread,1);
                                        filtersValid = true;
                            private function startFire():void {
                                        endCount = 0;
                                        addEventListener(Event.ENTER_FRAME,doFire);
                            private function doFire(evt:Event):void {
                                        if (_target == null) { return; }
                                        if (!bmpsValid) { updateBitmaps(); }
                                        if (!perlinValid) { updatePerlin(); }
                                        if (!filtersValid) { updateFilters(); }
                                        if (endCount == 0) {
                                                    var drawMtx:Matrix = _target.transform.matrix;
                                                    drawMtx.tx = _target.x-x;
                                                    drawMtx.ty = _target.y-y;
                                                    scratchBmp.fillRect(scratchBmp.rect,0);
                                                    drawColorTransform.alphaOffset = -Math.random()*200|0;
                                                    scratchBmp.draw(_target,drawMtx,drawColorTransform,"add");
                                                    scratchBmp.applyFilter(scratchBmp,scratchBmp.rect,pnt,blurF);
                                                    displayBmp.draw(scratchBmp,mtx,null,"add");
                                        dispMapF.mapPoint = new Point( -Math.random()*(perlinBmp.width-displayBmp.width)|0, -Math.random()*(perlinBmp.height-displayBmp.height)|0 );
                                        displayBmp.applyFilter(displayBmp,displayBmp.rect,pnt,dispMapF);
                                        displayBmp.applyFilter(displayBmp,displayBmp.rect,pnt,fireCMF);
                                        if (endCount != 0 && --endCount == 0) {
                                                    removeEventListener(Event.ENTER_FRAME,doFire);
    Then, this is the sample application he gave:
    import fl.controls.Slider;
    import fl.controls.Label;
    import fl.events.SliderEvent;
    var params:Array = ["distortion","distortionScale","fadeRate","flameHeight","flameSpread","smoke"]
    var l:uint = params.length;
    for (var i:uint=0; i<l; i++) {
                var label:TextField = new TextField();
                label.textColor = 0;
                label.text = params[i];
                label.width = 140;
                label.x = 350;
                label.y = 55+50*i;
                addChild(label);
                label = new TextField();
                label.textColor = 0x999999;
                label.text = "0.35";
                label.name = params[i]+"fld";
                label.width = 30;
                label.x = 490;
                label.y  = 55+50*i;
                addChild(label);
                var slider:Slider = new Slider();
                slider.name = params[i];
                slider.minimum = -2;
                slider.maximum = 2;
                slider.addEventListener(SliderEvent.THUMB_DRAG,handleSlider);
                addChild(slider);
                slider.x = 350;
                slider.width = 170;
                slider.y = 75+50*i;
                slider.snapInterval = 0.05;
                slider.value = 0.35;
                fireFX[params[i]] = 0.35;
    function handleSlider(evt:SliderEvent):void {
                fireFX[evt.target.name] = evt.target.value;
                (getChildByName(evt.target.name+"fld") as TextField).text = String(evt.target.value);
    blueFlame.addEventListener(Event.CHANGE,handleCheckBox);
    hideText.addEventListener(Event.CHANGE,handleCheckBox);
    function handleCheckBox(evt:Event):void {
                fireFX.blueFlame = blueFlame.selected;
                obj.visible = !hideText.selected;
    Thanks again.

    Looks like he has fireFX instance on the timeline. Most probably this instances symbol base class is com.gskinner.effects.FireFX
    You just need to create a directory structure that reflects his package:
    com/gskinner/effects/
    where you place his FireFX.as
    Or, alternatively, you can remove package path from the class header and place FireFx where all you classes (or your application) are:
    package com.gskinner.effects {
    to
    package {
    Then you will just need to instantiate the class.

Maybe you are looking for

  • Who's Who : does not at all show of "Placeholder" of Photo

    Dear Experts We have SAP_ESS with 600 SP16    on   SAP NW 7.00 SP20  Java System (inlcudes Application Server Java + Enterprise Portal + Enterprise Portal Core Components) When we browse thry SAP Standard " Who's Who" - It just display the employee i

  • HDTV OTA question

    I have been forced to make cutbacks and go without a cable provider. I have an antenna in my attic that I used to use before the digital conversion that got great reception, but my new HDTV does not have a tuner built in. I want a tuner box that woul

  • Can execute my report in Bex

    Hi All,                 i can execute my report in Bex.when i am trying to execute my report in portal i am getting user is not authorized person.i checked with basis people.but basis peoples are saying that paricular user have authorization for all

  • Installing windows 7 over XP with 3 partitions

    On my macbook I used the following method to install xp via bootcamp and obtain 3 partitions (windows, shared fat32 data, and mac partitions). http://forums.creativecow.net/thread/246/114 Now I'd like to install windows 7 while keeping my other 2 par

  • Don´t see my iWEB in Macbook Pro

    Approximately a month ago I bought a MacBook Pro, to review the applications I have not iweb. Where I can activate it or do not come into my software. I find the application inside the garageband and not included.