Hello all friends, I am trying to adapt a noponies class in KoolMoves 7.0.3, it resize the background with a fade effect.
The class is:
PHP Code:
package noponies.display {
   
import flash.display.Sprite;
   
import flash.display.Bitmap;
   
import flash.display.Stage;
   
import flash.display.StageAlign;
   
import flash.display.StageScaleMode;
   
import gs.TweenLite;//using TweenLite to handle alpha fades
   
import flash.events.*;
   
import flash.net.URLRequest;
   
import flash.display.Loader;

   public class 
FullBrowserBg extends Sprite {
      
/*******************************************************************************
 VARIABLES
*******************************************************************************/
      
private var useMinStageSize:Boolean;//use a minimum stage size?
      
private var XminStageSize:int;
      private var 
YminStageSize:int;

      public static  const 
BG_LOADED:String  "newslideloaded";
      public static  const 
BG_LOADING:String  "newslideloading";
      public static  const 
UNLOAD_BG:String  "unloadbg";

      private var 
imageUrl:String;//array of images
      
private var loader:Loader;//loader for loading in images
      
private var slide:Sprite;//sprite that serves as a content holder for loaders content
      
private var bitMapBg:Bitmap;
      private var 
stageWidth:Number;
      private var 
stageHeightNumber;
      private var 
imageScaleProp:Number;
      
      
//constructor
      
public function FullBrowserBg(imageUrl:StringuseMinStageSize:Boolean=falseXminStageSize:int 400YminStageSize:int 400 ) {
         
this.imageUrl imageUrl;
         
this.useMinStageSize useMinStageSize
         this
.XminStageSize XminStageSize
         this
.YminStageSize YminStageSize
         
         
//Set up the listeners
         
addEventListener(Event.ADDED_TO_STAGEaddedToStageHandler);//use stage as listener for custom events
         
addEventListener(FullBrowserBg.UNLOAD_BGunloadAll);//listener for unload all event
      
}
      
      
//load the image
      
private function loadBgImage() {
         
loader = new Loader();
         
loader.contentLoaderInfo.addEventListener(Event.COMPLETEloaded);
         
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERRORonIOErrorHandler);
         
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESSprogressHandler);
         var 
request:URLRequest = new URLRequest(String(imageUrl));//access our array of url's
         
loader.load(request);
      }
      
      private function 
loaded(event:Event):void {
         
//dispatch the loaded event
         
dispatchEvent(new Event(FullBrowserBg.BG_LOADEDtrue));
         
slide = new Sprite();//create a sprite to load bitmap into
         
slide.alpha 0;//set the slide content to have an alpha of 0
         
slide.0;
         
slide.0;

         
bitMapBg Bitmap(loader.content);//get the loaders content as a bitmap

         
bitMapBg.smoothing true;//turn on smoothing
         
slide.addChild(bitMapBg);//add the bitmap to the slide sprite
         
addChild(slide);
         
         
//remove the eventListeners on the loader object and set it to null
         
loader.contentLoaderInfo.removeEventListener(Event.COMPLETEloaded);
         
loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERRORonIOErrorHandler);
         
loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESSprogressHandler);
         
loader null;
         
         
//set initial scale of image
         
resizeBg(slide);
         
//alpha in the content
         
TweenLite.to(slide5, {alpha:1});//alpha in the slides
      
}
      
//here we do the general resizing of our images, this function is called via the stages resize handler. 
      //First, check that we are not below the minimum size set for scaling, if we are, we don't scale
      
private function resizeBg(targetSprite:Sprite):void {
         if (
useMinStageSize) {
            if (
stage.stageWidth<XminStageSize || stage.stageHeight <YminStageSize) {
               return;
            }
         }
         
//access stage width here. We want to respond to stage dimension changes immediately
         
stageWidth stage.stageWidth;
         
stageHeightstage.stageHeight;

         if (
stageHeight/stageWidth>targetSprite.height/targetSprite.width) {
            
imageScaleProp targetSprite.width/targetSprite.height;
            
targetSprite.height stageHeight;
            
targetSprite.width stageHeight*imageScaleProp;
         } else {
            
imageScaleProp targetSprite.height/targetSprite.width;
            
targetSprite.width stageWidth;
            
targetSprite.height stageWidth*imageScaleProp;
         }
         
targetSprite.0;
         
targetSprite.0;
      }
      
//resize listener
      
private function resizeListener(event:Event):void {
         
resizeBg(slide);
      }
      
//added to stage handler
      
private function addedToStageHandler(event:Event):void {
         
stage.scaleMode StageScaleMode.NO_SCALE;
         
stage.align StageAlign.TOP_LEFT;
         
stage.addEventListener(Event.RESIZEresizeListener);
         
stageWidth stage.stageWidth;
         
stageHeightstage.stageHeight;
         
loadBgImage();
      }
      
// IO Error handling
      
private function onIOErrorHandler(event:IOErrorEvent):void {
         
trace("There has been an ioErrorHandler: " event);
      }
      
//progress handler, uncomment and use, if desired.
      
private function progressHandler(event:ProgressEvent):void {
         
//trace("bytesLoaded = " + event.bytesLoaded + " bytesTotal=" + event.bytesTotal);
         //dispatch the loading event
         //dispatchEvent(new Event(FullBrowserBg.BG_LOADING, true));
      
}
      
//dispatch an unload event to remove all listeners and set content to null
      
private function unloadAll(event:Event):void {
         
stage.removeEventListener(Event.RESIZEresizeListener);
         
stage.removeEventListener(Event.ADDED_TO_STAGEaddedToStageHandler);
         
slide.removeChildAt(0)
         
bitMapBg null
         removeChild
(slide);
         
slide null;
         
removeEventListener(FullBrowserBg.UNLOAD_BGunloadAll);
      }

   }


and in the KM time line actions have:
PHP Code:
import noponies.display.FullBrowserBg;
var 
newBrowserBg:FullBrowserBg = new FullBrowserBg("images/holdsteady.jpg"false);
addChildAt(newBrowserBg,0); 
When I test it with (Ctrl+Alt+Enter) the error output show me:
Code:
ReferenceError: Error #1069: No se encontró la propiedad UNLOAD_BG en noponies.display.FullBrowserBg y no hay ningún valor predeterminado.
	at noponies.display::FullBrowserBg()
	at fullBrouser_fun::MainTimeline/frame1()
It is in Spanish, I sorry.
How can I to fix this ?. Thanks.