Flash.geom.Matrix

I'm attempting to do something as simple as importing the
flash.geom.Matrix class with Flash 8 and I'm unable to do so. I
keep getting this message:
**Error** Scene=Scene 1, layer=// Action, frame=20:Line 12:
The class or interface 'flash.geom.Matrix' could not be loaded.
var bglgbox:Matrix = new Matrix();
Does anyone know why this would be?

import flash.geom.Matrix;
var mat1:Matrix = new Matrix();

Similar Messages

  • Import flash.geom.Rectangle could not be loaded?

    Hello everyone,
    I currently have a .fla file in folder a/. I have a .as
    called CollisionDetection file under a/com/gskinner/sprites/.
    In the .fla, I am importing the .as like this:
    import com.gskinner.sprites.CollisionDetection;
    In my .as file, I have these four lines of code in the
    beginning:
    import flash.display.BitmapData;
    import flash.geom.ColorTransform;
    import flash.geom.Matrix;
    import flash.geom.Rectangle;
    However, for each of them, it tells me that
    "The class or interface 'flash.geom.BitmapData' could not be
    loaded."
    Any ideas of why this is happening?
    Thanks,
    iloveisrael.

    Hello,
    I figured out what my error was: I was using Flash Player 7
    instead of Flash Player 8.
    Stupid mistake, but it made everything work perfectly.
    Thanks,
    iloveisrael.

  • Flash cs5.5 - sharedObject

    I migrated my iPhone app from flash cs5 to cs5.5. The performance is much better but suddenly I can't write/read sharedObjects. Any idea what might be happening? I didn't have this problem with flash cs5.
    Jakub

    CS5 to CS5.5 you probably change Air 2.5 to Air 2.6, so it's probably not exactly the same code.
    Well, SharedObject should be ok... ... so it's maybe the write permissions ?
    Here a exemple by me:
    package {
            import flash.desktop.NativeApplication;
            import flash.display.Sprite;
            import flash.display.StageAlign;
            import flash.display.StageScaleMode;
            import flash.events.Event;
            import flash.events.TouchEvent;
            import flash.geom.Matrix;
            import flash.net.SharedObject;
            import flash.sensors.Accelerometer;
            import flash.text.TextField;
            import flash.text.TextFieldType;
            import flash.ui.Multitouch;
            import flash.ui.MultitouchInputMode;
        public class Main extends Sprite {
                private static var _tf:TextField;
                public final function Main(){
                        stage.scaleMode = StageScaleMode.NO_SCALE;
                        stage.align = StageAlign.TOP_LEFT;
                        _tf = new TextField();
                        _tf.text = "Hello World";
                        _tf.width = 480;
                        _tf.height = 800;
                        _tf.multiline = true;
                        _tf.selectable = true;
                        _tf.type = TextFieldType.INPUT;
                        addChild(_tf);
                        load();
                        NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, save);
                        Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
                public final function load():void {
                    // Get the shared object.
                    var so:SharedObject = SharedObject.getLocal("HelloWorld");
                    if(so.data["tf"] != null){
                        _tf.text = so.data["tf"];
                public final function save(e:Event):void {
                    // Get the shared object.
                    var so:SharedObject = SharedObject.getLocal("HelloWorld");
                    so.data["tf"] = _tf.text;
                    so.flush();

  • Still having issues with matrix class

    i hope i catch my favorite genius on here, who was helping me
    yesterday. i closed the thread before i actually tested the script
    because it made total sense. however, it's not working...
    import flash.geom.Matrix;
    var mat:Matrix = mc.transform.matrix; //where "mc" = the
    instance name
    mat.b=Math.tan(45);
    i wish to change the angle in which the y axis is skewed of a
    movie clip on the stage. any suggestions to what i'm doing
    wrong?

    you must reassign mc's transform matrix to mat after changing
    mat:

  • 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 do I add custom style to custom AS3 component via .css file?

    Hi all,
    I have created a flex application which displays a custom component I created in actionscript. My custom component is just an extended canvas component which displays a gradient background. When I add the component to my flex app, see code below, the component works great.
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="http://localhost/mycomps">
        <ns1:GradientCanvas fillColors="[#ffffff, #000000]" />
    </mx:Application>
    However, I also want to support css styles to add the gradient colors to my component, like so
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="http://localhost/mycomps">
        <mx:Style source="test.css" />
        <ns1:GradientCanvas styleName="gradientCanvas" />
    </mx:Application>
    test.css
    .gradientCanvas {
        fill-colors: #ffffff, #000000;
    When I try this my component doesn't display a gradient. I have followed the tutorials online that I could find but it seems to be the same example from Adobe repeated on multiple site and it doesn't work.
    My component code is added below, if anyone could show me how to get this to work it would be much appreciated.
    Thanks in advance,
    Xander
    GradientCanvas.as
    package mycomps {
        import flash.display.GradientType;
        import flash.geom.Matrix;
        import mx.containers.Canvas;
        import mx.styles.CSSStyleDeclaration;
        import mx.styles.StyleManager;
        public class GradientCanvas extends Canvas {
            private static var classConstructed:Boolean = constructStyle();
            public function GradientCanvas() {
                super();
                this.width = 100;
                this.height = 20;
            private static function constructStyle():Boolean {
                var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("GradientCanvas");
                if (style) {
                    if (style.getStyle("fill-colors") == undefined) {
                        style.setStyle("fill-colors", [0xffffff, 0x000000]);
                } else {
                    style = new CSSStyleDeclaration();
                    style.defaultFactory = function():void {
                        this._fillColours = [0xffffff, 0x000000];
                    StyleManager.setStyleDeclaration("GradientCanvas", style, true);
                return true;
            override public function styleChanged(styleProp:String):void {
                super.styleChanged(styleProp);
                if (styleProp == "fill-colors") {
                    this._fillColours = getStyle("fill-colors");
                    this._fillColoursChanged = true;
                    this.invalidateDisplayList();
            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
                super.updateDisplayList(unscaledWidth, unscaledHeight);
                if (this._fillColoursChanged == true) {
                    var direction:Number = 90 * (Math.PI / 180);
                    var matrix:Matrix = new Matrix();
                    matrix.createGradientBox(unscaledWidth, unscaledHeight, direction, 0, 0);
                    graphics.clear();
                    graphics.beginGradientFill(GradientType.LINEAR, this._fillColours, [1,1], [0, 255], matrix, "pad", "rgb", -1);
                    graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
                    graphics.endFill();
                    this._fillColoursChanged = false;
            [Inspectable(category="Gradient", type="Array", format="Color", name="Fill Colours")]
            private var _fillColours:Array;
            private var _fillColoursChanged:Boolean = false;
            public function get fillColours():Array {
                return this._fillColours;
            public function set fillColours(value:Array):void {
                this._fillColours = value;
                this._fillColoursChanged = true;
                this.invalidateProperties();
                this.invalidateDisplayList();

    Never mind, I've discovered how to do it for myself.
    Thanks...

  • Passing data from an XML object to an itemRenderer

    I'm trying to color the background of a column in a datagrid and have found a sample file that illustrate the concept. However, the sample has data stored in an arrayCollection whereas mine is in an XML object. The problem is that the data in the sample file is apparently automatically passed to the itemRenderer (shown below: note the trace statement). My XML object does not appear to automatically pass data to the itemRenderer. So my questions are:
    1. Is there a simple way to pass data stored in an XML object to an itemRenderer
    or
    2. Should I convert my XML to an arrayCollection? If so, what's the best way to do this-- I've tried the following, but without success:
    <mx:Model id="xmldata" source="example3.xml"/>
      <mx:ArrayCollection id="myAC" source="{ArrayUtil.toArray(xmldata.Example1)}" />
    Here's what the xml looks like:
    <TABLE>
       <EXAMPLE1>
          <difficulty> 0.5 </difficulty>
          <discrimination> 0.7 </discrimination>
          <item> 3 </item>
       </EXAMPLE1>
    </TABLE>  
    Here's the itemRenderer:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Label xmlns:mx="http://www.adobe.com/2006/mxml">
        <!--
            This item renderer simply extends Label and overrides the updateDisplayList function to
            draw a gradient-filled rectangle. The colors in the gradient are determined from the
            data.
        -->
        <mx:Script>
        <![CDATA[
            import flash.geom.Matrix;
            import flash.display.GradientType;
            import flash.display.Graphics;
            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
                super.updateDisplayList(unscaledWidth,unscaledHeight);
                var m:Matrix = new Matrix();
                m.createGradientBox(unscaledWidth,unscaledHeight);
                var g:Graphics = graphics;
                            trace("data.col3="+data.col3)
                var colors:Array = (data.col3 < 2000 ? [0x0000CC,0x0000FF] : [0x00CC00,0x00FF00]);
                g.clear();
                g.beginGradientFill(GradientType.LINEAR, colors, [0.2,0.6], [0,255], m);
                // the rectangle is drawn a little high and a little tall to compensate for the gap
                // the DataGrid introduces between rows.
                g.drawRect(0, -2, unscaledWidth, unscaledHeight+4 );
                g.endFill();
        ]]>
        </mx:Script>
    </mx:Label>

    This sample code should answer your question of how to bring data into the renderer automatically. It comes in via the DataGrid dataProvider and then you refer to it in the renderer as data.XYZ, where XYZ is the field in the XML with the data. See FB 3 help sys on e4x syntax.
    ------------------ mainapp.mxml --------------------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      creationComplete="srvc.send();">
      <mx:Script>
        <![CDATA[
          import mx.rpc.events.ResultEvent;
          import mx.collections.XMLListCollection;
          [Bindable] private var xlc:XMLListCollection;
          private function dataHandler(evt:ResultEvent):void{
            xlc = new XMLListCollection(evt.result..EXAMPLE1 as XMLList);
        ]]>
      </mx:Script>
      <mx:HTTPService id="srvc" url="data2.xml" result="dataHandler(event)"
        resultFormat="e4x"/>
      <mx:DataGrid dataProvider="{xlc}">
        <mx:columns>
          <mx:DataGridColumn headerText="Difficulty" dataField="difficulty"/>
          <mx:DataGridColumn headerText="Discrimination" dataField="discrimination"/>
          <mx:DataGridColumn headerText="Item" itemRenderer="MyLabel"/>
        </mx:columns>
      </mx:DataGrid>
    </mx:Application>
    ----------- MyLabel.mxml --------------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Label xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
          import flash.geom.Matrix;
          import flash.display.GradientType;
          import flash.display.Graphics;
          override protected function updateDisplayList(unscaledWidth:Number,
            unscaledHeight:Number):void{
            super.updateDisplayList(unscaledWidth,unscaledHeight);
            this.text = data.col3;
            var m:Matrix = new Matrix();
            m.createGradientBox(unscaledWidth,unscaledHeight);
            var g:Graphics = graphics;
            var colors:Array = (data.col3 < 2000 ? [0x0000CC,0x0000FF] : [0x00CC00,0x00FF00]);
            g.clear();
            g.beginGradientFill(GradientType.LINEAR, colors, [0.2,0.6], [0,255], m);
            g.drawRect(0, -2, unscaledWidth, unscaledHeight+4 );
            g.endFill();
        ]]>
      </mx:Script>
    </mx:Label>
    ------------ data2.xml ----------------
    <?xml version="1.0" encoding="utf8"?>
    <TABLE>
       <EXAMPLE1>
          <difficulty> 0.5 </difficulty>
          <discrimination> 0.7 </discrimination>
          <col3> 3 </col3>
       </EXAMPLE1>
    </TABLE>

  • Access of possibly undefined property number through a reference with static type...

    Hello everyone !
    I run into this problem today ... take a look on the code :
    import com.trick7.effects.TeraFire;
    for (var j:uint=0; j<10; j++) {
        var fire:TeraFire = new TeraFire();
        fire.x = j * 40 + 20;
        fire.y = 100;
        fire.number = j; //This line is causeing the problem
        addChild(fire);
        fire.buttonMode = true;
    TeraFire class creates fire particles. The compiler error is :
    Scene 1, Layer 'Layer 1', Frame 1, Line 7
    1119: Access of possibly undefined property number through a reference with static type com.trick7.effects:TeraFire.
    Anyone can help me to find a solution to this problem.
    I can do that ".number" with a movieclip but not in this case. What can I do ?

    I borrowed that class from the internet.
    I made the changes you suggested: imported flash.Display.MovieClip and also made the class extend MovieClip.
    The error is still throwing in compiler errors. I am not really good enough to edit this class because there are some functions I don't still understand very good. This is the class below:
    package com.trick7.effects{
        import flash.display.BitmapData;
        import flash.display.GradientType;
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.filters.DisplacementMapFilter;
        import flash.filters.DisplacementMapFilterMode;
        import flash.geom.Matrix;
        import flash.geom.Point;
        import flash.geom.Rectangle;
        public class TeraFire extends MovieClip{
            public var phaseRateX:Number;
            public var phaseRateY:Number;
            private var offsets:Array= [new Point(),new Point()];
            private var seed:Number = Math.random();
            private var fireW:Number;
            private var fireH:Number;
            //火の色
            //private var fireColorIn:uint;
            //private var fireColorOut:uint;
            private var ball:Sprite;
            private var gradientImage:BitmapData;
            private var displaceImage:BitmapData;
            private var focalPointRatio:Number = 0.6;
            private const margin:int = 10;
            private var rdm:Number;
            public function TeraFire(xPos:Number=0, yPos:Number=0, fireWidth:Number=30, fireHeight:Number=90, fireColorIn:uint = 0xFFCC00,fireColorOut:uint = 0xE22D09){
                fireW = fireWidth;
                fireH = fireHeight;
                phaseRateX = 0;
                phaseRateY = 5;
                var matrix:Matrix = new Matrix();
                matrix.createGradientBox(fireW,fireH,Math.PI/2,-fireW/2,-fireH*(focalPointRatio+1)/2);
                var colors:Array = [fireColorIn, fireColorOut, fireColorOut];
                var alphas:Array = [1,1,0];
                var ratios:Array = [30, 100, 220];
                var home:Sprite = new Sprite();
                ball = new Sprite();
                ball.graphics.beginGradientFill(GradientType.RADIAL,colors, alphas, ratios, matrix,"pad","rgb",focalPointRatio);
                ball.graphics.drawEllipse(-fireW/2,-fireH*(focalPointRatio+1)/2,fireW,fireH);
                ball.graphics.endFill();
                //余白確保用透明矩形
                ball.graphics.beginFill(0x000000,0);
                ball.graphics.drawRect(-fireW/2,0,fireW+margin,1);
                ball.graphics.endFill();
                addChild(home);
                home.addChild(ball);
                this.x = xPos;
                this.y = yPos;
                addEventListener(Event.ENTER_FRAME,loop);
                displaceImage = new BitmapData(fireW+margin,fireH,false,0xFFFFFFFF);
                var matrix2:Matrix = new Matrix();
                matrix2.createGradientBox(fireW+margin,fireH,Math.PI/2,0,0);
                var gradient_mc:Sprite = new Sprite;
                gradient_mc.graphics.beginGradientFill(GradientType.LINEAR,[0x666666,0x666666], [0,1], [120,220], matrix2);
                gradient_mc.graphics.drawRect(0,0,fireW+margin,fireH);//drawのターゲットなので生成位置にこだわる必要はない。
                gradient_mc.graphics.endFill();
                gradientImage = new BitmapData(fireW+margin,fireH,true,0x00FFFFFF);
                gradientImage.draw(gradient_mc);//gradient_mcを消す必要は?
                rdm = Math.floor(Math.random()*10);
            private function loop(e:Event):void{
                for(var i:int = 0; i < 2; ++i){
                    offsets[i].x += phaseRateX;
                    offsets[i].y += phaseRateY;
                displaceImage.perlinNoise(30+rdm, 60+rdm, 2, seed, false, false, 7, true, offsets);
                displaceImage.copyPixels(gradientImage,gradientImage.rect,new Point(),null, null, true);
                var dMap:DisplacementMapFilter = new DisplacementMapFilter(displaceImage, new Point(), 1, 1, 20, 10, DisplacementMapFilterMode.CLAMP);
                ball.filters = [dMap];
    I you can clarify a little bit further I would appreciate it a lot because I wasted some good time on this.

  • Loading, cropping and saving jpg files in Flex

    I'm attempting to apply the code for selecting, cropping and saving image data (.jpg, .png) as shown on the web site:
    http://www.adobe.com/devnet/flash/quickstart/filereference_class_as3.html#articlecontentAd obe_numberedheader_1
    The sample application is contained within a class called Crop contained in the action script file Crop.as which begins as follows:
    package
        import com.adobe.images.JPGEncoder;
        import com.adobe.images.PNGEncoder;
        import flash.display.BitmapData;
        import flash.display.DisplayObject;
        import flash.display.DisplayObjectContainer;
        import flash.display.Loader;
        import flash.display.LoaderInfo;
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.events.IOErrorEvent;
        import flash.events.MouseEvent;
        import flash.geom.Matrix;
        import flash.geom.Rectangle;
        import flash.net.FileFilter;
        import flash.net.FileReference;
        import flash.utils.ByteArray;
        public class Crop extends Sprite
    My application attempts to make use of the Crop class by including the Crop.as file:
         <mx:Script source="Crop.as"/> 
    in the Flex Component which needs it, and then calling the Crop constructor to perform the methods of the class
       var localImage:Crop = new Crop();
       localImage.Crop();
    My application does not compile. The package statement (or the curly bracket on the following line) is flagged with the error "Packages may not be nested".
    I have no idea why this should be as I cannot see any nested definitions anywhere in my application. The component includes the Crop.as file which contains the package and class definition.
    Can anyone give my some guidance as to why this error is occurring?
    Any help would be greatly appreciated.  

    Hi Scott,
    #1
    that error is because "fx:Script" (or mx:Script) are intended to include part of Actionscript code - but not class defitions or blocks.
    So if you are trying to include e.g. such class:
    package
         import flash.display.Sprite;
         public class Crop extends Sprite
              public function Crop()
                   super();
              public function processImage():void
                   trace("processImage()");
    compiler will immediately complain as you are trying to incorporate nested class within your application code.
    #2
    here is correct way (I think) to incorporate some class via mxml tags (here using fx:Script):
    Using class sample above:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/mx"
                      xmlns:utils="*"
                      applicationComplete="completeHandler(event)">
         <!-- util Crop will be initialized here as instance "cropUtil" -->
         <fx:Declarations>
              <utils:Crop id="cropUtil"/>
         </fx:Declarations>
         <!-- script where "cropUtil" will be used -->
         <fx:Script>
              <![CDATA[
                   import mx.events.FlexEvent;
                   protected function completeHandler(event:FlexEvent):void
                        cropUtil.processImage();
              ]]>
         </fx:Script>
    </s:Application>
    But note that you could simply create instance of your class by direct import in fx:Script:
         <fx:Script>
              <![CDATA[
                   import mx.events.FlexEvent;
                   private var cropUtil:Crop = null;
                   protected function completeHandler(event:FlexEvent):void
                        cropUtil = new Crop();
                        cropUtil.processImage();
              ]]>
         </fx:Script>
    hth,
    kind regards,
    Peter Blazejewicz

  • Need help with timeline

    I have this photo gallery code that i found online. I have various frames in my timeline, when the photo gallery loads in frame x and i try to go to frame y. the photo gallery doesnt close out.  I want to include a button that says CLOSE and remove the photo gallery from the timeline.
    The code involves xml files and is pretty complicated. Here it is...  Some Help would be great!!! thank in advance
    import fl.transitions.*;
    import fl.transitions.easing.*;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.geom.Matrix;
    import flash.display.Sprite;
    import com.flashandmath.objects.Tile;
    import com.flashandmath.loaders.GalleryLoader;
    import com.flashandmath.preloaders.LoadSpinner2;
    import flash.display.Loader;
    import flash.display.Shape;
    import flash.events.MouseEvent;
    import flash.text.TextFormat;
    import flash.events.Event;
    var sw:Number = 780;
    var sh:Number = 740;
    var galLoader:GalleryLoader;
    var numPics:int;
    var thumbsData:Vector.<BitmapData>
    var largePicURLs:Vector.<String>;
    var captions:Vector.<String>;
    var spinner:LoadSpinner2;
    var picWidth:Number;
    var picHeight:Number;
    var divisions:Number;
    var gap:Number;
    var tiles:Vector.<Tile>;
    var tileWidth:Number;
    var tileHeight:Number;
    var galleryHolder:Sprite;
    var parameterTween:Tween;
    var variationX:Vector.<Number>;
    var variationY:Vector.<Number>;
    var variationMax:Number;
    var collapsed:Boolean;
    var currentPicIndex:int;
    var captionBox:TextField;
    var collapseTweenDuration:Number;
    var separateTweenDuration:Number;
    var closedPositionOffsetY:Number;
    var thumbnails:Vector.<Bitmap>;
    var pics:Vector.<Bitmap>;
    var angles:Vector.<Number>;
    var loader:Loader;
    var isLoading:Boolean;
    var scrollTweenDuration:Number;
    var pageShift:int;
    var numTiles:int;
    var numPages:int;
    var backSkip:int;
    var navigationPanel:Sprite;
    stage.scaleMode = StageScaleMode.NO_SCALE;
    //this paramObject will be used for our tweened motion:
    var paramObject:Object = {t:0};
    //we create some instances of MovieClips from the library:
    var btnNextImage:BtnNextImage = new BtnNextImage();
    var btncloseGallery:btncloseGallery = new btncloseGallery();
    var btnPrevImage:BtnPrevImage = new BtnPrevImage();
    var btnNextPage:BtnNextPage = new BtnNextPage();
    var btnPrevPage:BtnPrevPage = new BtnPrevPage();
    var btnReturn:BtnReturn = new BtnReturn();
    var mcViewInstructions:McViewInstructions = new McViewInstructions();
    init();
    function init():void {
        thumbsData = new Vector.<BitmapData>();
        largePicURLs = new Vector.<String>();
        captions = new Vector.<String>();
        loader = new Loader();
        isLoading = false; //boolean flag for image loading after thumbnail click
        infoBox.text = "Loading thumbnails, please wait...";
        galleryHolder = new Sprite();
        galleryHolder.x = sw/2 - 3;
        galleryHolder.y = sh/2 + 10;
        this.addChild(galleryHolder);
        btnPrevImage.mouseEnabled = false;
        btnNextImage.mouseEnabled = false;
        btnReturn.mouseEnabled = false;
        btncloseGallery.mouseEnabled = false;
        spinner = new LoadSpinner2(100,100);
        spinner.setColors(0x000762C5, 0xFF0762C5);
        spinner.bgAlpha = 0.5;
        spinner.x = galleryHolder.x;
        spinner.y = galleryHolder.y;
        this.addChild(spinner);
        spinner.startSpinner();
        galLoader = new GalleryLoader("gallery.xml");
        galLoader.addEventListener(GalleryLoader.XMLLOAD_ERROR, xmlError);
        galLoader.addEventListener(GalleryLoader.IMGSLOAD_ERROR, imgsError);
        galLoader.addEventListener(GalleryLoader.ALL_LOADED, loadEnded);
        galLoader.loadXML();
    function xmlError(e:Event):void {
        galLoader.removeEventListener(GalleryLoader.XMLLOAD_ERROR, xmlError);
        galLoader.removeEventListener(GalleryLoader.ALL_LOADED, loadEnded);
        galLoader.removeEventListener(GalleryLoader.IMGSLOAD_ERROR, imgsError);
        infoBox.text="There has been an error loading the XML file. The server may be busy. Try refreshing the page.";
        spinner.stopSpinner();
        spinner.visible=false;
    function imgsError(e:Event):void {
        galLoader.removeEventListener(GalleryLoader.XMLLOAD_ERROR, xmlError);
        galLoader.removeEventListener(GalleryLoader.ALL_LOADED, loadEnded);
        galLoader.removeEventListener(GalleryLoader.IMGSLOAD_ERROR, imgsError);
        infoBox.text="There has been an error loading thumbnails. The server may be busy. Try refreshing the page.";
        spinner.stopSpinner();
        spinner.visible=false;
    function loadEnded(e:Event):void {
        galLoader.removeEventListener(GalleryLoader.XMLLOAD_ERROR, xmlError);
        galLoader.removeEventListener(GalleryLoader.ALL_LOADED, loadEnded);
        galLoader.removeEventListener(GalleryLoader.IMGSLOAD_ERROR, imgsError);
        infoBox.text="";
        spinner.stopSpinner();
        spinner.visible=false;
        initApp();        
    function populateVecs():void {
        var j:int;
        for(j=0;j<numPics;j++){
            thumbsData[j]=galLoader.bmpDataVec[j];
            largePicURLs[j]=galLoader.picsVec[j];
            captions[j]=galLoader.capsVec[j];
    function initApp():void {
        numPics = galLoader.numPics;
        populateVecs();
        thumbnails = new Vector.<Bitmap>();
        createThumbnailBitmaps();
        picWidth = 300;
        picHeight = 200;
        gap = 50;   
        divisions = 3;
        numTiles = divisions*divisions;
        variationMax = 12;
        numPages = Math.ceil(Number(numPics)/Number(numTiles));
        backSkip = numPages*numTiles - numPics;
        collapseTweenDuration = 36;
        separateTweenDuration = 30;
        scrollTweenDuration = 40;
        closedPositionOffsetY = 0;
        pageShift = 0;
        navigationPanel = new Sprite();
        this.addChild(navigationPanel);
        navigationPanel.mouseEnabled = false;
        navigationPanel.y = galleryHolder.y + closedPositionOffsetY - picHeight/2 - 40;
        navigationPanel.x = galleryHolder.x + 2;
        navigationPanel.addChild(btnNextImage);
        btnNextImage.y = 0;
        btnNextImage.x = btnReturn.width/2 + 20;
        navigationPanel.addChild(btnPrevImage);
        btnPrevImage.y = 0;
        btnPrevImage.x = -btnReturn.width/2 - 20;
        navigationPanel.addChild(btnReturn);
        btnReturn.y = 0;
        btnReturn.x = 0;
        navigationPanel.addChild(btncloseGallery);
        btncloseGallery.y = 0;
        btncloseGallery.x = 0;
        this.addChild(mcViewInstructions);
        mcViewInstructions.y = galleryHolder.y - (picHeight + gap*(divisions-1))/2 - 30;
        mcViewInstructions.x = galleryHolder.x + 3;
        mcViewInstructions.mouseEnabled = false;
        this.addChild(btnPrevPage);
        btnPrevPage.x = galleryHolder.x + (picWidth + gap*(divisions-1))/2 + 30;
        btnPrevPage.y = galleryHolder.y - 8;
        this.addChild(btnNextPage);
        btnNextPage.x = galleryHolder.x + (picWidth + gap*(divisions-1))/2 + 30;
        btnNextPage.y = galleryHolder.y + 12;
        this.addChild(btncloseGallery);
        btncloseGallery.x = galleryHolder.x + (picWidth + gap*(divisions-1))/2 + 30;
        btncloseGallery.y = galleryHolder.y + 12;
        btnPrevImage.addEventListener(MouseEvent.CLICK,prevImage);
        btnNextImage.addEventListener(MouseEvent.CLICK, nextImage);
        btnReturn.addEventListener(MouseEvent.CLICK, returnToThumbs);
        btncloseGallery.addEventListener(MouseEvent.CLICK,closeGallery);
        btnNextPage.addEventListener(MouseEvent.CLICK, btnNextPageHandler);
        btnPrevPage.addEventListener(MouseEvent.CLICK, btnPrevPageHandler);
        setPagingVisibility();
        navigationPanel.alpha = 0;
        tiles = new Vector.<Tile>();
        variationX = new Vector.<Number>();
        variationY = new Vector.<Number>();
        angles = new Vector.<Number>();
        tileWidth = picWidth/divisions;
        tileHeight = picHeight/divisions;
        var dsf:DropShadowFilter = new DropShadowFilter(6,45,0,0.7,6,6,1);
        galleryHolder.filters = [dsf];
        var format:TextFormat = new TextFormat("arial",12,0x000000,false,true);
        format.align = TextFormatAlign.CENTER;
        captionBox = new TextField();
        captionBox.defaultTextFormat = format;
        captionBox.autoSize = TextFieldAutoSize.CENTER;
        captionBox.text = "";
        captionBox.x = galleryHolder.x - captionBox.width/2;
        captionBox.y = 20+galleryHolder.y + 0.5*picHeight + closedPositionOffsetY;
        this.addChildAt(captionBox,0);
        captionBox.mouseEnabled = false;
        setUpThumbnails();
        setUpTiles();
        collapsed = false;
    function createThumbnailBitmaps():void {
        var i:int;
        for (i = 0; i < galLoader.numPics; i++) {
            thumbnails.push(new Bitmap(galLoader.bmpDataVec[i]));
    function setUpThumbnails():void {
        var k:int;
        var scaleFactor:Number;
        for (k = 0; k < numPics; k++) {
            scaleFactor = tileWidth/thumbnails[k].width;
            thumbnails[k].x = -scaleFactor*thumbnails[k].width/2;
            thumbnails[k].y = -scaleFactor*thumbnails[k].height/2;
            thumbnails[k].scaleX = thumbnails[k].scaleY = scaleFactor;
    function setUpTiles():void {
        for (var i=0; i<= divisions-1; i++) {
            for (var j=0; j<= divisions-1; j++) {
                var thisTile:Tile = new Tile();
                thisTile.thumbnailHolder.addChild(thumbnails[i*divisions + j]);
                galleryHolder.addChild(thisTile);
                thisTile.openPosition.x = -(picWidth + gap*(divisions-1))/2 + tileWidth/2+(tileWidth+gap)*j;// + (2*Math.random()-1)*gap*0.5;
                thisTile.openPosition.y = -(picHeight + gap*(divisions-1))/2 + tileHeight/2+(tileHeight+gap)*i;// + (2*Math.random()-1)*gap*0.5;
                thisTile.closedPosition.x = -picWidth/2 + tileWidth/2 + tileWidth*j;
                thisTile.closedPosition.y = closedPositionOffsetY - picHeight/2 + tileHeight/2 + tileHeight*i;
                thisTile.x = thisTile.openPosition.x;
                thisTile.y = thisTile.openPosition.y;
                thisTile.which = i*divisions+j;
                thisTile.buttonMode = true;
                tiles.push(thisTile);
                variationX.push(4*variationMax*(2*Math.random()-1));
                variationY.push(4*variationMax*(2*Math.random()-1));
                angles.push(0);
                thisTile.addEventListener(MouseEvent.CLICK, onTileClick);
    function onTileClick(evt:MouseEvent):void {
        if(isLoading||collapsed){
            return;
        isLoading=true;
        currentPicIndex = evt.target.which;
        setFlipVisibility();
        spinner.visible = true;
        spinner.startSpinner();
        //set up listeners for load complete or error, go to changeTilesBeforeCollapse on complete
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadComplete);
        loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,loadingError);
        //load image
        loader.load(new URLRequest(largePicURLs[currentPicIndex + pageShift]));
    function setFlipVisibility():void {
        btnPrevImage.visible = btnPrevImage.mouseEnabled = (currentPicIndex + pageShift > 0);
        btnNextImage.visible = btnNextImage.mouseEnabled = (currentPicIndex + pageShift < (numPics - 1));
    function loadingError(e:IOErrorEvent):void {
        infoBox.text="There has been an error loading the image. The server may be busy. Refresh the page and try again.";
        loader.contentLoaderInfo.removeEventListener(Event.COMPLETE,loadComplete);
        loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,loadingError);
        isLoading=false;
        spinner.stopSpinner();
        spinner.visible=false;
    function onPicClick(evt:MouseEvent):void {
        btnReturn.removeEventListener(MouseEvent.CLICK, returnToThumbs);
        galleryHolder.removeEventListener(MouseEvent.CLICK, onPicClick);
        separate();
    function returnToThumbs(evt:MouseEvent):void {
        galleryHolder.removeEventListener(MouseEvent.CLICK, onPicClick);
        btnReturn.removeEventListener(MouseEvent.CLICK, returnToThumbs);
        btnReturn.mouseEnabled = false;
        separate();
    function loadComplete(evt:Event):void {
        loader.contentLoaderInfo.removeEventListener(Event.COMPLETE,loadComplete);
        loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,loadingError);
        spinner.stopSpinner();
        spinner.visible=false;
        isLoading=false;
        //paint tiles with pic:
        var matrix:Matrix = new Matrix(1,0,0,1);
        var index:int;
        var bd:BitmapData = Bitmap(loader.content).bitmapData;
        for (var i=0; i<= divisions-1; i++) {
            for (var j=0; j<= divisions-1; j++) {
                index = i*divisions + j;
                matrix.tx = (-j-0.5)*picWidth/divisions;
                matrix.ty = (-i-0.5)*picHeight/divisions;
                tiles[index].graphics.clear();
                tiles[index].graphics.beginBitmapFill(bd,matrix,false,false);
                tiles[index].graphics.drawRect(-tileWidth/2, -tileHeight/2, tileWidth, tileHeight);
                tiles[index].graphics.endFill();
        //change caption:
        captionBox.text = "  "+captions[currentPicIndex + pageShift]+"  "; //adding a little extra space to avoid cutoff
        if (!collapsed) {
            collapse();
    function collapse():void {   
        collapsed = true;
        //reset the randomization variables so it won't look the same every time:
        for (var i:int = 0; i < divisions*divisions; i++) {
            variationX[i] = (4*variationMax*(2*Math.random()-1));
            variationY[i] = (4*variationMax*(2*Math.random()-1));
            angles[i] = 60-Math.random()*120;
        parameterTween = new Tween(paramObject,"t",Elastic.easeInOut,0,1,collapseTweenDuration);
        parameterTween.addEventListener(TweenEvent.MOTION_FINISH, collapseComplete);
        this.addEventListener(Event.ENTER_FRAME, onEnterCollapse);
    function separate():void {
        collapsed = false;
        //reset the randomization variables so it won't look the same every time:
        for (var i:int = 0; i < divisions*divisions; i++) {
            variationX[i] = (4*variationMax*(2*Math.random()-1));
            variationY[i] = (4*variationMax*(2*Math.random()-1));
            angles[i] = 60-Math.random()*120;
        parameterTween = new Tween(paramObject,"t",Elastic.easeInOut,0,1,separateTweenDuration);
        parameterTween.addEventListener(TweenEvent.MOTION_FINISH, separateComplete);
        this.addEventListener(Event.ENTER_FRAME, onEnterSeparate);
        btnPrevImage.mouseEnabled = false;
        btnNextImage.mouseEnabled = false;
    function onEnterCollapse(evt:Event):void {
        captionBox.alpha = paramObject.t;
        navigationPanel.alpha = paramObject.t;
        mcViewInstructions.alpha = 1 - paramObject.t;
        btnPrevPage.alpha = 1 - paramObject.t;
        btnNextPage.alpha = 1 - paramObject.t;
        var quad:Number;
        for (var i:int = 0; i< divisions*divisions; i++) {
            quad = paramObject.t*(1-paramObject.t);
            tiles[i].x = tiles[i].openPosition.x + paramObject.t*(tiles[i].closedPosition.x-tiles[i].openPosition.x)+variationX[i]*quad;
            tiles[i].y = tiles[i].openPosition.y + paramObject.t*(tiles[i].closedPosition.y-tiles[i].openPosition.y)+variationY[i]*quad;
            tiles[i].thumbnailHolder.alpha = 1-paramObject.t;
            tiles[i].rotation = quad*angles[i];
    function onEnterSeparate(evt:Event):void {
        captionBox.alpha = 1-paramObject.t;
        navigationPanel.alpha = 1-paramObject.t;
        mcViewInstructions.alpha = paramObject.t;
        btnPrevPage.alpha = paramObject.t;
        btnNextPage.alpha = paramObject.t;
        var quad:Number;
        for (var i:int = 0; i< divisions*divisions; i++) {
            quad = paramObject.t*(1-paramObject.t);
            tiles[i].x = tiles[i].closedPosition.x + paramObject.t*(tiles[i].openPosition.x-tiles[i].closedPosition.x)+variationX[i]*quad;
            tiles[i].y = tiles[i].closedPosition.y + paramObject.t*(tiles[i].openPosition.y-tiles[i].closedPosition.y)+variationY[i]*quad;
            tiles[i].thumbnailHolder.alpha = paramObject.t;
            tiles[i].rotation = quad*angles[i];
    function collapseComplete(evt:Event):void {   
        captionBox.x = galleryHolder.x - captionBox.width/2;
        this.removeEventListener(Event.ENTER_FRAME, onEnterCollapse);
        galleryHolder.addEventListener(MouseEvent.CLICK, onPicClick);
        btnReturn.addEventListener(MouseEvent.CLICK, returnToThumbs);
        btnReturn.mouseEnabled = true;
    function separateComplete(evt:Event):void {
        this.removeEventListener(Event.ENTER_FRAME, onEnterSeparate);
    function prevImage(evt:MouseEvent):void {
        if(isLoading){
            return;
        isLoading=true;
        currentPicIndex -= 1;
        if (currentPicIndex < 0) {
            //pageShift -= numTiles;
            currentPicIndex = numTiles - 1
            //have to do something special if we're on the last page
            if (Math.ceil(Number(pageShift)/Number(numTiles)) == numPages - 1) {
                currentPicIndex -= backSkip;
            prevPage();
        setFlipVisibility();
        spinner.visible = true;
        spinner.startSpinner();
        //set up listeners for load complete or error, go to changeTilesBeforeCollapse on complete
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadComplete);
        loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,loadingError);
        //load image
        loader.load(new URLRequest(largePicURLs[currentPicIndex + pageShift]));
    function nextImage(evt:MouseEvent):void {
        if(isLoading){
            return;
        isLoading=true;
        currentPicIndex += 1;
        if (currentPicIndex > numTiles - 1) {
            //pageShift -= numTiles;
            currentPicIndex = 0;
            //have to do something special if we're on the last page
            if (Math.ceil(Number(pageShift + numTiles)/Number(numTiles)) == numPages - 1) {
                currentPicIndex += backSkip;
            nextPage();
        setFlipVisibility();
        spinner.visible = true;
        spinner.startSpinner();
        //set up listeners for load complete or error, go to changeTilesBeforeCollapse on complete
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadComplete);
        loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,loadingError);
        //load image
        loader.load(new URLRequest(largePicURLs[currentPicIndex + pageShift]));
    function setPagingVisibility():void {
        btnPrevPage.visible = false;
        btnPrevPage.mouseEnabled = false;
        btnNextPage.visible = false;
        btnNextPage.mouseEnabled = false;
        if (pageShift + numTiles < numPics - 1) {
            btnNextPage.visible = true;
            btnNextPage.mouseEnabled = true;
        if (pageShift > 0) {
            btnPrevPage.visible = true;
            btnPrevPage.mouseEnabled = true;
    function btnNextPageHandler(evt:MouseEvent):void {
        nextPage();
    function btnPrevPageHandler(evt:MouseEvent):void {
        prevPage();
    function nextPage():void {
        var k:int;
        pageShift += numTiles;
        if (pageShift + numTiles > numPics) {
            pageShift = numPics - numTiles;
        for (k = 0; k < numTiles; k++) {
            if (tiles[k].thumbnailHolder.numChildren > 0) {
                tiles[k].thumbnailHolder.removeChildAt(0);
            tiles[k].thumbnailHolder.addChild(thumbnails[k + pageShift]);
        setPagingVisibility();
    function prevPage():void {
        var k:int;
        pageShift -= numTiles;
        if (pageShift < 0) {
            pageShift = 0;
        for (k = 0; k < numTiles; k++) {
            if (tiles[k].thumbnailHolder.numChildren > 0) {
                tiles[k].thumbnailHolder.removeChildAt(0);
            tiles[k].thumbnailHolder.addChild(thumbnails[k + pageShift]);
        setPagingVisibility();

    Thank you! you actually gave me an idea which worked. All i did was put an emtpy movie clip on stage and put my actionscript nested within that empty movie clip and it worked. Thanks!

  • Extremely simple photo gallery crashes after few tens of pics viewed... (ipad)

    Images are JPG, 300 - 350kb each, the thing crashes every time! not to mention that in future it was planned to pload few swf's instead of few jpgs there...
    package
        import flash.display.*;
        import flash.geom.Matrix;
        import flash.utils.*;
        import flash.net.URLRequest;
        import flash.events.TransformGestureEvent;
        import flash.system.Capabilities;
        import flash.system.TouchscreenType;
        import flash.ui.Multitouch;
        import flash.ui.MultitouchInputMode;
        import flash.events.*;
        import flash.utils.getDefinitionByName;
        import com.greensock.TweenLite;
        import com.greensock.easing.*;
        public class Base extends Sprite
            var pageCounter = 1;
            var controlsoff = false;
            var activePage;
            var previousPage;
            var total = 70;
            public function Base()
                loadNewPage("next");
                nextp.visible = false;
                prevp.visible = false;
                btn1.buttonMode = true;
                btn1.addEventListener(MouseEvent.CLICK, openbook);
            function openbook(evt:MouseEvent):void
                pageCounter++;
                loadNewPage("next");
                btn1.visible = false;
                arrow1.visible = false;
                nextp.visible = true;
                prevp.visible = true;
                nextp.buttonMode = true;
                prevp.buttonMode = true;
                nextp.addEventListener(MouseEvent.CLICK, slidenext);
                prevp.addEventListener(MouseEvent.CLICK, slideback);
            function loadNewPage(direction)
                previousPage = activePage;
                var loader = new Loader();
                loader.load(new URLRequest("full/"+pageCounter+".jpg"));
                loader.x = (pageCounter-1)*768;
                //newpage.cacheAsBitmap = true;
                activePage = loader;
                container.addChild(loader);
                TweenLite.to(container,1, {x:-(pageCounter-1)*768, delay:.5, ease:Cubic.easeOut, onComplete:removePage});
            function removePage()
                if (previousPage)
                    container.removeChild(previousPage);
                    previousPage.unload();
                    previousPage = null;
            // ----------------------------------------------- sliding to the next page  ------------------------------------------
            function slidenext(evt:MouseEvent):void
                if (controlsoff == false)
                    controlsoff = true;
                    pageCounter++;
                    setTimeout(function() {
                    controlsoff = false;
                    }, 1000);
                    loadNewPage("next");
                    if (pageCounter==total) {
                        nextp.visible = false;
                    prevp.visible = true;
            // ----------------------------------------------- sliding to the previous page  ------------------------------------------
            function slideback(evt:MouseEvent):void
                if (controlsoff == false)
                    controlsoff = true;
                    pageCounter--;
                    setTimeout(function() {
                    controlsoff = false;
                    }, 1000);
                    loadNewPage("prev");
                    if (pageCounter==1) {
                        prevp.visible = false;
                        nextp.visible = false;
                        btn1.visible = true;
                        arrow1.visible = true;

    Can't test this right now, but you keep creating new loaders, and those loaders all have a loader.content.  Can you keep a reference to them and then null those out?
    loader.content=null;
    container.removeChild(loader);
    loader=null;
    etc.
    Might help to see which object is hanging around.  It definitely sounds like a memory issue, though.  Something is not being cleaned up...

  • Where to add new script in an ActionScript file

    Hi,
    moved to AS3 forum
    I am a newbie using Flash Pro CS5 and have beginner skills in AS3.
    I am working on an eLearning lesson and already, with a lot of earlier help of others, and have an Action Script file to use for a white noise  animation in a learning lesson.
    I need to make a couple of additions but am very unfamiliar with adding  script to an Action Script file "package." Specifically, I want to add a  URL checking to the Action Script file so that students do not view the  Flash movie animation outside of the lesson which contains learning  materials and instructions for using the animation.
    I would like to add the following script but so far, I have been getting error messages:
    if ((this.loaderInfo.url).indexOf("mywebsite. com") == -1)
                navigateToURL (new URLRequest ("http://mywebsite.com/default.html"));
                else
    //run the animation
    The current AS3 in the .as file is:
    package
        import flash.display.Bitmap;
        import flash.display.BitmapData;
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.events.MouseEvent;
        import flash.events.TimerEvent;
        import flash.geom.Matrix;
        import flash.geom.Point;
        import flash.utils.getTimer;
        import flash.utils.Timer;
        public class Main extends Sprite
            private var viewbmd:BitmapData;
            private var workbmd:BitmapData;
            private var scaleUp:Matrix;
            private var px:Vector.<uint>;
            private var timer:Timer;
            private var itsNoisy:Boolean;
            public function Main():void
                if (stage) init();
                else addEventListener(Event.ADDED_TO_STAGE, init);
            private function init(e:Event = null):void
                removeEventListener(Event.ADDED_TO_STAGE, init);
                viewbmd = new BitmapData(stage.stageWidth, stage.stageHeight, false);
                var view:Bitmap = new Bitmap(viewbmd);
                addChild(view);
                workbmd = new BitmapData(viewbmd.width / 8, viewbmd.height / 8, false);
                scaleUp = new Matrix();
                scaleUp.scale(8, 8);
                itsNoisy = true;
                stage.addEventListener(MouseEvent.CLICK, manageNoise);
                initNoise();
                timer = new Timer(50);
                timer.addEventListener(TimerEvent.TIMER, onTick);
                timer.start();
            private function initNoise():void {
                var array:Array = [];
                for (var i:uint = 0; i < 255; i++) {
                    array[i] = 0xffffff * (i % 2);
                workbmd.noise(getTimer(), 0, 255, 7, true);
                workbmd.paletteMap(workbmd, workbmd.rect, new Point(0, 0), array, array, array);
                px = workbmd.getVector(workbmd.rect);
            private function onTick(e:Event):void {
                flipSomePixels(160);
                viewbmd.draw(workbmd, scaleUp);
            private function flipSomePixels(howMany:int):void {
                for (var i:int = 0; i < howMany; i++){
                var pxidx:int = Math.floor(Math.random()*px.length);
                    px[pxidx] = ~px[pxidx]; //bitwise NOT to flip all bits
                workbmd.setVector(workbmd.rect, px);
            private function manageNoise(e:MouseEvent):void {
                itsNoisy ? timer.removeEventListener(TimerEvent.TIMER, onTick) : timer.addEventListener(TimerEvent.TIMER, onTick);
                itsNoisy = !itsNoisy;
    If anyone can take a look and please let me know how to add the  additional script to check for the URL (please be specific since I am a beginner in  scripting):
    I have tried everything that I can think of and am stuck.
    Thanks in advance for your help.
    Kind Regards,
    saratogacoach

    in your constructor:
    if (this.loaderInfo.url.indexOf("mywebsite.com") == -1) {
        navigateToURL(new URLRequest ("http://mywebsite.com/default.html"));
    } else {
        addEventListener(Event.ADDED_TO_STAGE, init);

  • Large vertical gradients not working like examples

    Hello guys, now this seems to be a very straight forward thing to do and there are loads of tutorials about the subject. None of them are helping me get this right though, and I can't for the life of me figure out what's wrong...
    Im trying to create a simple gui component that has a vertical gradient, simple enough right... I create the sprite, and draw the gradient with beginGradientFill and a matrix with a 90 degree radian angle on it; but it stops working if the sprite has a long width, below is an exmaple of what I mean:
    package
    import flash.display.GradientType;
    import flash.display.Shape;
    import flash.display.Sprite;
    import flash.geom.Matrix;
    public class Main extends Sprite
    public function Main()
    var theWidth : Number = 800;
    var theHeight: Number = 100;
    var shape1:Shape = new Shape();
    var matrix:Matrix = new Matrix();
    matrix.createGradientBox(theWidth , theHeight, Math.PI*0.5, 0, 0);
    var colors:Array = [ 0xffffff, 0x000000];
    var alphas:Array = [ 100, 100];
    var ratios:Array = [ 0, 255];
    shape1.graphics.lineStyle(2,0xa1b0b6);
    shape1.graphics.beginGradientFill(GradientType.LINEAR,colors, alphas, ratios, matrix);
    shape1.graphics.drawRect( 0.0, 0.0, theWidth , theHeight);
    shape1.graphics.endFill();
    addChild(shape1);
    If I change
    matrix.createGradientBox(800, 100, Math.PI*0.5, 0, 0);
    to
    matrix.createGradientBox(800, 100, Math.PI, 0, 0);
    it works fine - but horizontally - why is it that applying 90 degrees the fill does not work?
    Thanks for your help, I really don't know whats wrong with this

    Hi Rob, I'm really confused, if I create a new action script project and use the code i posted I get this:
    As you can see its not going from white to black, but instead it just looks grey - although there is a gradient, it looks like its massive or something :S I don't get it
    Im using flash builder 4, I create a new action script project, in the as file I paste that code into the constructor and run the application.
    ps.. yes i know about the alphas need to be 1, it was a typo when i posted this, setting them to 1 doesn't seem to be my issue. Any other ideas?

  • Set boundaries for magnifying cursor

    Hello,
    I have placed an image within a movieclip that I would like to zoom in on when the mouse passes over it. The zoom on the cursor is working, but the mouse remains a magnifying glass even after it rolls off of the zoomable image.
    I have tried putting the image and zoom code inside an swf and loading in it into a container via loadmovie, but the same problem with the cursor occurs.
    Here is a link to an .swf of the problem:   http://www.gingerjarvis.com/test/
    How can I set boundaries for the zoom function so that my cursor only becomes a magnifier over the image and is normal outside of it?
    Thank you so much for your time and help!!
    Ginger
    This is the code I am using:
    loadMovie("01.jpg", imgHolder);
    this.createEmptyMovieClip("zoomImg", 33);
    zoomImg.setMask(imgMask);
    var zoomBitmap = new flash.display.BitmapData(155, 155, false, 0xEAEAEA);
    zoomImg.attachBitmap(zoomBitmap, 5);
    var magPower = 2;
    var zoomMtx = new flash.geom.Matrix();
    zoomMtx.scale(magPower, magPower);
    magGlass.swapDepths(_root.getNextHighestDepth());
    _root.onEnterFrame = function()
    Mouse.hide();
    magGlass._x = _xmouse - 70;
    magGlass._y = _ymouse - 70;
    zoomImg._x = magGlass._x;
    zoomImg._y = magGlass._y;
    imgMask._x = magGlass._x;
    imgMask._y = magGlass._y;
    zoomMtx.tx = -_xmouse * magPower;
    zoomMtx.ty = -_ymouse * magPower;
    zoomBitmap.draw(imgHolder, zoomMtx);

    use:
    var mcl:MovieClipLoader=new MovieClipLoader();
    var lo:Object={};
    lo.onLoadInit=function(target){
    target.onRollOver=function(){
    magGlass._visible=true;
    Mouse.hide();
    this.onEnterFrame=magnifyF;
    target.onRollOut=function(){
    magGlass._visible=false;
    Mouse.show();
    delete this.onEnterFrame;
    zoomBitmap.dispose();
    mcl.addListener(lo);
    mcl.load("01.jpg",imgHolder);
    this.createEmptyMovieClip("zoomImg", 33);
    zoomImg.setMask(imgMask);
    var zoomBitmap = new flash.display.BitmapData(155, 155, false, 0xEAEAEA);
    zoomImg.attachBitmap(zoomBitmap, 5);
    var magPower = 2;
    var zoomMtx = new flash.geom.Matrix();
    zoomMtx.scale(magPower, magPower);
    magGlass.swapDepths(_root.getNextHighestDepth());
    magGlass._visible=false;
    function magnifyF()
    magGlass._x = _xmouse - 70;
    magGlass._y = _ymouse - 70;
    zoomImg._x = magGlass._x;
    zoomImg._y = magGlass._y;
    imgMask._x = magGlass._x;
    imgMask._y = magGlass._y;
    zoomMtx.tx = -_xmouse * magPower;
    zoomMtx.ty = -_ymouse * magPower;
    zoomBitmap.draw(imgHolder, zoomMtx);

  • Movieclip convert to a graphic

    hello every one
    im trying to add to a movieclip called "movimiento"
    a graphic  property
    var movimiento: Graphics = faceRectContainer.graphics;
    but the following error occurs:
    /Users/ignacionieto/Documents/AS3/OpenCVFlash/Marilena_mod10/src/FaceDetector_Camera.as, Line 112    1119: Access of possibly undefined property x through a reference with static type flash.display:Graphics.
    Is there a way to convert the movieclip to a graphic object, or other is there other alternative to control mc movimiento with the faceRectContainer variable?
    package
        import com.quasimondo.bitmapdata.CameraBitmap;
        import flash.display.Bitmap;
        import flash.display.BitmapData;
        import flash.display.Graphics;
        import flash.display.Sprite;
        import flash.display.StageAlign;
        import flash.display.StageScaleMode;
        import flash.events.Event;
        import flash.geom.Matrix;
        import flash.geom.Rectangle;
        import flash.text.TextField;
        import jp.maaash.ObjectDetection.ObjectDetector;
        import jp.maaash.ObjectDetection.ObjectDetectorEvent;
        import jp.maaash.ObjectDetection.ObjectDetectorOptions;
        public class FaceDetector_Camera extends Sprite
            private var detector    :ObjectDetector;
            private var options     :ObjectDetectorOptions;
            private var view :Sprite;
            private var faceRectContainer :Sprite;
            private var tf :TextField;
            private var camera:CameraBitmap;
            private var detectionMap:BitmapData;
            private var drawMatrix:Matrix;
            private var scaleFactor:int = 4;
            private var w:int = 640;
            private var h:int = 480;
            private var lastTimer:int = 0;
            private var movimiento:prueba;
            public function FaceDetector_Camera() {
                initUI();
                initDetector();
            private function initUI():void{
                stage.scaleMode = StageScaleMode.NO_SCALE;
                stage.align = StageAlign.TOP_LEFT;
                view = new Sprite;
                addChild(view);
                camera = new CameraBitmap( w, h, 15 );
                camera.addEventListener( Event.RENDER, cameraReadyHandler );
                view.addChild( new Bitmap( camera.bitmapData ) );
                detectionMap = new BitmapData( w / scaleFactor, h / scaleFactor, false, 0 );
                drawMatrix = new Matrix( 1/ scaleFactor, 0, 0, 1 / scaleFactor );
                faceRectContainer = new Sprite;
                view.addChild( faceRectContainer );
                movimiento = new prueba;
                movimiento.x = 100;
                addChild(movimiento);
                movimiento.alpha = 0;
                movimiento.visible = false;
            private function cameraReadyHandler( event:Event ):void
                detectionMap.draw(camera.bitmapData,drawMatrix,null,"normal",null,true);
                detector.detect( detectionMap );
            private function initDetector():void
                detector = new ObjectDetector();
                var options:ObjectDetectorOptions = new ObjectDetectorOptions();
                options.min_size  = 30;
                detector.options = options;
                detector.addEventListener(ObjectDetectorEvent.DETECTION_COMPLETE, detectionHandler );
            private function detectionHandler( e :ObjectDetectorEvent ):void
                var g :Graphics = faceRectContainer.graphics;
                var mono: Graphics = faceRectContainer.graphics;
               var movimiento: Graphics = faceRectContainer.graphics;
                g.clear();
                //mono.clear();
                if( e.rects ){
                    g.lineStyle( 2 );
                    //mono.lineStyle(4);// black 2pix
                    e.rects.forEach( function( r :Rectangle, idx :int, arr :Array ) :void {
                    g.drawRect( r.x * scaleFactor, r.y * scaleFactor, r.width * scaleFactor, r.height * scaleFactor );
                    trace (movimiento.x);
                    movimiento.x = r.x  * scaleFactor + 100;
                    movimiento.y = r.y * scaleFactor + 100;               
                    movimiento.visible = true;
                    movimiento.alpha = 1;

    If I comment
    //var movimiento: Graphics = faceRectContainer.graphics;
    It works well the bm image follow the g.rect object but goes static an the movieclip that consists in two frames appear only one : (.
    Also the bm object doesnt dissapear i try to addchild to the g.rect the bm object;
    g.addChild(movimiento);
    g.addChild(bm);
    but these error appear
    /Users/ignacionieto/Documents/AS3/OpenCVFlash/Marilena_mod10/src/FaceDetector_Camera.as, Line 109    1061: Call to a possibly undefined method addChild through a reference with static type flash.display:Graphics.
    How can I add the properties of the faceRectContainer to the m Movieclip movimiento so it could appear and dissapear like the g.Rect object?
    Here oges the code
    package
        import com.quasimondo.bitmapdata.CameraBitmap;
        import flash.display.Bitmap;
        import flash.display.BitmapData;
        import flash.display.Graphics;
        import flash.display.Sprite;
        import flash.display.StageAlign;
        import flash.display.StageScaleMode;
        import flash.events.Event;
        import flash.geom.Matrix;
        import flash.geom.Rectangle;
        import flash.text.TextField;
        import flash.display.Bitmap;
    import flash.display.BitmapData;
        import jp.maaash.ObjectDetection.ObjectDetector;
        import jp.maaash.ObjectDetection.ObjectDetectorEvent;
        import jp.maaash.ObjectDetection.ObjectDetectorOptions;
        public class FaceDetector_Camera extends Sprite
            private var detector    :ObjectDetector;
            private var options     :ObjectDetectorOptions;
            private var view :Sprite;
            private var faceRectContainer :Sprite;
            private var tf :TextField;
            private var camera:CameraBitmap;
            private var detectionMap:BitmapData;
            private var drawMatrix:Matrix;
            private var scaleFactor:int = 4;
            private var w:int = 640;
            private var h:int = 480;
            private var lastTimer:int = 0;
            private var movimiento:prueba;
            private var bmd:BitmapData;
            private var bm:Bitmap;
            public function FaceDetector_Camera() {
                initUI();
                initDetector();
            private function initUI():void{
                stage.scaleMode = StageScaleMode.NO_SCALE;
                stage.align = StageAlign.TOP_LEFT;
                view = new Sprite;
                addChild(view);
                camera = new CameraBitmap( w, h, 15 );
                camera.addEventListener( Event.RENDER, cameraReadyHandler );
                view.addChild( new Bitmap( camera.bitmapData ) );
                detectionMap = new BitmapData( w / scaleFactor, h / scaleFactor, false, 0 );
                drawMatrix = new Matrix( 1/ scaleFactor, 0, 0, 1 / scaleFactor );
                faceRectContainer = new Sprite;
                view.addChild( faceRectContainer );
                movimiento = new prueba;
            //  movimiento.x = 100;
                //addChild(movimiento);
                movimiento.alpha = 0;
                movimiento.visible = false;
                bmd = new BitmapData(80, 80, true, 0x00000000);
                bmd.draw(movimiento);
                bm = new Bitmap(bmd);
                this.addChild(bm);
                view.addChild( bm );
            private function cameraReadyHandler( event:Event ):void
                detectionMap.draw(camera.bitmapData,drawMatrix,null,"normal",null,true);
                detector.detect( detectionMap );
            private function initDetector():void
                detector = new ObjectDetector();
                var options:ObjectDetectorOptions = new ObjectDetectorOptions();
                options.min_size  = 30;
                detector.options = options;
                detector.addEventListener(ObjectDetectorEvent.DETECTION_COMPLETE, detectionHandler );
            private function detectionHandler( e :ObjectDetectorEvent ):void
                var g :Graphics = faceRectContainer.graphics;
                //var bmp: Graphics = faceRectContainer.graphics;
               //var hola: Graphics = faceRectContainer.graphics;
         //   ----> error   g.addChild(bm);
                g.clear();
                //mono.clear();
                //movimiento.clear();
                if( e.rects ){
                    g.lineStyle( 2 );
                    //mono.lineStyle(4);// black 2pix
                    e.rects.forEach( function( r :Rectangle, idx :int, arr :Array ) :void {
                    g.drawRect( r.x * scaleFactor, r.y * scaleFactor, r.width * scaleFactor, r.height * scaleFactor );
                    //mono.drawCircle( r.x * scaleFactor, r.y * scaleFactor, r.width * scaleFactor);
                    addChild(movimiento);
                    //trace (movimiento.x);
                    movimiento.x = r.x  * scaleFactor + 100;
                    movimiento.y = r.y * scaleFactor + 100;               
                    movimiento.visible = true;
                    movimiento.alpha = 1;
                    bm.x = r.x  * scaleFactor + 100;
                    bm.y = r.y * scaleFactor + 100;               

Maybe you are looking for

  • Lightroom Imports Photos Upside Down

    I just started using Lightroom to import my photos directly from my camera. It worked fine for the first few times, but now it is reading all of my photos upside-down. XP's Camera Wizard correctly reads the orientation from the camera, so I think thi

  • Redirected when opening Apps Store to iTunes Store on iTouch. Help, please?

    Recently after updating my 3rd Gen iTouch with the 4.0 software, I get redirected to ITUNES store when I try to access the APP store from it. I have tried rebooting and I have restored my device several times. Nothing has made a difference. I do not

  • Operating system call w2k and linux

    Hello: I am not a programmer but i nedd a routine to do an operating system call and execute a batch or shell set of commands, do anyone know how can i do it? thanks a lot in advance

  • Why I don't have backdrop effect in my photo booth?

    I just brought my new iMac and I open photo booth. There were only 2 pages of effect. Why I don't have backdrop effect in my photo booth?

  • DB is slow

    Hi i m running database 9iR2 on windows 2003 before today db is working well and nice but today db is working slow.How can i identify why my db is running slow. after restart db is working fine . Thanks