Use Of friend Class

In class builder what is the use of friend class and where can i find the standard classes and methods

Being someone's friend, means being allowed to use his protected attributes and method.
When you define a friend for a class, this class can addres these components as if they were public ones.
In real world: my friend (some class) can use my car (which is protected), which is not allowed to strangers (other classes).
Regards
Marcin

Similar Messages

  • Use of Friend class in Class builder

    HI
    Can someone tell me how to use a friend class In class Builder
    SRidhar

    Hi,
    Please check this link
    http://help.sap.com/saphelp_nw04/helpdata/en/b5/693ec8185011d5969b00a0c94260a5/frameset.htm
    Defining Relationships Between Object Types
    http://help.sap.com/saphelp_nw04/helpdata/en/ca/c035b7a6c611d1b4790000e8a52bed/frameset.htm
    Examples
    http://help.sap.com/saphelp_nw04/helpdata/en/47/5f643a7c5dd813e10000000a114084/frameset.htm
    Best regards,
    raam

  • Code to call friends class method

    Hello,
    Please can someone help me with friends class method call. in global classes
    Thanks
    Megh
    Moderator message: please search for available information/documentation before asking.
    Edited by: Thomas Zloch on Nov 2, 2010 5:29 PM

    What is your exact problem?
    The class whose private and protected section you want to use, needs declaration of its friends. You do it in Friends tabstrip. All these classes are allowed then to access these "hiden" sections from outside of the class. Below example how it works with local classes. For global ones the principle stays the same
    CLASS lcl_main DEFINITION DEFERRED.
    CLASS lcl_other DEFINITION FRIENDS lcl_main. "only LCL_MAIN can use may hiden sections
      PROTECTED SECTION.
        METHODS prot_meth.
      PRIVATE SECTION.
        METHODS priv_meth.
    ENDCLASS.                  
    CLASS lcl_other IMPLEMENTATION.
      METHOD prot_meth.
        WRITE / 'This is protected method of class lcl_other'.
      ENDMETHOD.                    "prot_meth
      METHOD priv_meth.
        WRITE / 'This is private method of class lcl_other'.
      ENDMETHOD.                    "priv_meth
    ENDCLASS.                   
    CLASS lcl_main DEFINITION.
      PUBLIC SECTION.
        METHODS call_friends_methods.
      PRIVATE SECTION.
        DATA mr_my_friend TYPE REF TO lcl_other.
    ENDCLASS.                  
    CLASS lcl_main IMPLEMENTATION.
      METHOD call_friends_methods.
        CREATE OBJECT mr_my_friend.
        mr_my_friend->prot_meth( ).
        mr_my_friend->priv_meth( ).
      ENDMETHOD.                   
    ENDCLASS.           
    START-OF-SELECTION.
      DATA gr_main TYPE REF TO lcl_main.
      CREATE OBJECT gr_main.
      gr_main->call_friends_methods( ).
    Regards
    Marcin

  • Reg. OOPS....friend class....have ur pont.s

    Hi all,
    we have diff. syntaxes to make friend class say..
    CLASS A DEFINTION CREATE PRIVATE FRIEND CLASS B.
    CLASS A DEFINTION FRIEND CLASS B.
    Pleas reply..
    <b>Have ur point.</b>
    Regards,
    pradeep phogat

    The specified object types (classes or interfaces) obj_type_1 ... obj_type_n are declared as friends of the current class. In this way, these object types and all the object types derived from these through inheritance, inclusion, and implementation are allowed to access PROTECTED and PRIVATE components, in addition to PUBLIC components. They can also create instances from the class, irrespective of the specifications in the CREATE addition. All classes and interfaces from the same program as well as global classes and interfaces from the class library can be specified as object types.
    Note
    If you define global classes and class library interfaces as friends, you should note that the local classes of other ABAP programs will not be visible in them. A static access to the componenents of the class class is not possible in such friends.
    Example
    interface I1.
    endinterface.
    class C1 definition create private friends I1.
      private section.
        data A1(10) type C value 'Class 1'.
    endclass.
    class C2 definition.
      public section.
        interfaces I1.
        methods M2.
    endclass.
    class C2 implementation.
      method M2.
        data OREF type ref to C1.
        create object OREF.
        write  OREF->A1.
      endmethod.
    endclass.
    data OREF type ref to C2.
    start-of-selection.
      create object OREF.
      OREF->M2( ).
    In this excample, classs C2 is a friend of the interface
    I1 and therefore of the implementing class C1. It can
    instance these and also access their private components.
    Addition 7
    ... GLOBAL FRIENDS publ_obj_type_1 ... publ_obj_type_n
    Effect
    This addition must be used only for the definition of global classes. It cannot, therefore be specified locally with the ABAP Editor in an ABAP program, but is automatically generated during the definition of a global class using the tool Class Builder of the ABAP workbench. The specified global object types (classes or interfaces) publ_obj_type_1 ... publ_obj_type_n are declared as friends of the current class. In this way, these objects and all the object types derived from these through inheritance, inclusion, and implementation are allowed to access PROTECTED and PRIVATE components, in addition to the PUBLIC components. They can also create instances from the class, irrespective of the specifications in the addition CREATE
    Rewards if useful.......................
    Minal

  • Friend class

    Hi to all,
    I have created two classes 1) ztest and 2) ztest_cl.
    I have declared 3 private variables of data type i say n1, n2, n3 .i gave Visibility as private for all three variables. And also in the ztest class i have declared ztest_cl as a friend class in friend attribute.
    Now i want to use those data variables in one of the method in the ztest_cl.
    I am writing code some thing like this n3 = n1 + 2 without declaring these parameters in ztest_cl class.
    But its showing a error that data types (n1 and n2 and n3) unknown.
    As it is friend class it should accept those variables but its not taking those variables.
    Can any one suggest me please?
    Thanks & Regards
    Priya

    HI
    FRIEND CLASS is a concept useing which a child can access private components of the base class in it
    FRIENDSHIP is extended by parent to the child
    FRIENDSHIP is not transtive
    VISIBILITY is allways 1st preference in the object oriented programing
    the PRIVATE components are not inherited to the child class but thriugh that child class we can acess PRIVATE components of the BASE CLASS
    *For this we need to create an object of the BASE CLASS with in the child class to access PRIVATE components *
    FRIENDS key word along with the child class name is used in the parent clas definition section to consider a child as a friend

  • 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>

  • 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.

  • How to use two activex class objects in same vi

    HI
    I am using labview to read ECU data from INCA software .INCA providing COMTOOL API(incacom.dll). I am using ACTIVEX for  communication between INCA & Labview. My problem is If I have used single activex class object  I am able to read Inca version, getting the database path etc. If I have used two activex class in same vi (one to open Inca & other one is to read the folder structure) I am not getting output.I have attached snapshot for referance
    Attachments:
    activex1.JPG ‏114 KB
    activex2.JPG ‏107 KB

    It wasnt in the first two images you posted, or I couldnt see it anyway! That was the only reason.
    Did you try the database block on its own, just to confirm that it is working?
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • How to use the different class for each screen as well as function.

    Hi Experts,
    How to use the different class for each screen as well as function.
    With BestRegards,
    M.Thippa Reddy.

    Hi ThippaReddy,
    see this sample code
    Public Class ClsMenInBlack
    #Region "Declarations"
        'Class objects
        'UI and Di objects
        Dim objForm As SAPbouiCOM.Form
        'Variables
        Dim strQuery As String
    #End Region
    #Region "Methods"
        Private Function GeRate() As Double
                Return Double
        End Function
    #End Region
    Public Sub SBO_Appln_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean)
            If pVal.BeforeAction = True Then
                If pVal.MenuUID = "ENV_Menu_MIB" Then
                End If
            Else ' Before Action False
                End If
        End Sub
    #End Region
    End Class
    End Class
    Rgds
    Micheal
    Vasu Anna Regional Feeling a???? Just Kidding
    Edited by: micheal willis on Jul 27, 2009 5:49 PM
    Edited by: micheal willis on Jul 27, 2009 5:50 PM

  • How to use the implementation class in propetty pallete

    Hi,
    I am using forms 10g....I have to insert horizontal scroll bar in text item..
    I have only class files instead of jar files ...how cani place the class file instead of jar file...
    How to use the implementation class in property palette to display the PJC
    Thanks,
    Ansaf.

    The Implementation Class must reflect the full name of the class. For instance, if the full class name is : xx.yyy.zz.class_name, then put this in the Implementation Class property of the corresponding item.
    Also, the class must be stored in the equivalent directory structure, so that, in my example: <DEV_HOME>/forms/java/xx/yyy/zz
    Francois

Maybe you are looking for

  • I have problem in libya map for n78 how can i upda...

    please in last version of nokia map i have libya map and more setails for road (all road in it) but now libya map is only big road but the small road not in it how can i update it

  • Universe level Prompts

    Hi, I was created Universe level Prompts like below. Example: Date Between @Prompt(Sysdate) and @Prompt(Sysdate-60) I was created one report by using Date object which is having prompts and in the report properties i have checked REFRESH ON OPEN. whe

  • Updating to 2.0

    I sync my music and videos and photos to my account at home and I sync my contacts, calender, and e-mail at work. Well I am at work and want to update to 2.0 but it says that I should do this where I sync my media because I will loose all of my photo

  • The Cover Flow on my iPod classic is out of order

    I use the cover flow option on my iPod classic to get to the music I want to listen to and discovered that my albums are out of order in regards of being alphabetical order by artists. For example the greatest hits and soundtracks and other compilati

  • Is my sound card going out or dammaged?

    This may just be my ears or me but how can I detect if my sound card is not flawed or dammaged? Because when I play sounds files I can hear a very very fant trickle of static... It sounds fine but when it is loud it starts doing that...