XML AS3 load/unload

I've got a peice of code that I use to load images for a slideshow.  Loader brings it up, adds it to the stage, tweens it in nicely. Everything works fine if the images are all the same size.  The problem is, the previous image is always there.  So if I have images of different sizes, you can still see the previous images.  How do I unload the previous image?  I can't figure out how to (unload, visible= false, alpha=0, ect) after the new image is tweened in.
This is one of those deals where I would have had it done already if I would use the timeline but if I figure out how to package it, I'll have it for next time.
Here's the code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var myTween:Tween;
var xmlRequest:URLRequest = new URLRequest("imageData.xml");
var xmlLoader:URLLoader = new URLLoader(xmlRequest);
var imgData:XML;
var imageLoader:Loader;
var rawImage:String;
var rawH:String;
var rawW:String;
var imgNum:Number = 0;
var checkSec:Timer = new Timer(100);
var delay:Timer = new Timer(3000);
var numberOfChildren:Number;
xmlLoader.addEventListener(Event.COMPLETE, xmlLoadedF);
function xmlLoadedF(event:Event):void {
    checkSec.start();
    checkSec.addEventListener(TimerEvent.TIMER, checkerF);
    imgData = new XML(event.target.data);
function packagedF():void{
    checkSec.removeEventListener(TimerEvent.TIMER, checkerF);
    rawImage = imgData.image[imgNum].imgURL;
    numberOfChildren = imgData.*.length();
    rawW = imgData.image[imgNum].imgW;
    rawH = imgData.image[imgNum].imgH;
    imageLoader = new Loader;
    imageLoader.load(new URLRequest(rawImage));
    master_mc.addChild(imageLoader);
    imageLoader.x = (master_mc.width - Number(rawW)) / 2;
    imageLoader.y = (master_mc.height - Number(rawH)) / 2;
    imageLoader.alpha = 0;
    myTween = new Tween(imageLoader,"alpha", Strong.easeOut, imageLoader.alpha, 1, 2, true);
    //fadeOut();
    myTween.addEventListener(TweenEvent.MOTION_FINISH, TimerIgnite);
function TimerIgnite(e:Event):void{
    delay.start();
    delay.addEventListener(TimerEvent.TIMER, nextImgF);
    //fadeOut();
function checkerF(event:TimerEvent):void{
    if(imgNum == 0){
        packagedF();
    }else if(imgNum < numberOfChildren){
//        fadeOut();
        //imageLoader.unload();
        packagedF();
    }else{
//        fadeOut();
        //imageLoader.unload();
        imgNum = 0;
        packagedF();
function nextImgF(e:Event): void {
    delay.stop();
    checkSec.addEventListener(TimerEvent.TIMER, checkerF);
    //fadeOut();
    imgNum++;
function fadeOut():void{
    delay.stop();
    imageLoader.alpha = 0;

OK, the error was coming from me not putting the master_mc in.  clbeech posted that while I was typing in my response. (thank you)
Once I put that in, the error went away and the code sort of works.  It will dump the image but not immediately.  There is a real delay on the doOldLoader leaving the stage. I have the removeChild as the first thing in the TimerIgnite function so where is there a delay coming from?
Here's the code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var myTween:Tween;
var xmlRequest:URLRequest = new URLRequest("imageData.xml");
var xmlLoader:URLLoader = new URLLoader(xmlRequest);
var imgData:XML;
var imageLoader:Loader;
var rawImage:String;
var rawH:String;
var rawW:String;
var imgNum:Number = 0;
var checkSec:Timer = new Timer(100);
var delay:Timer = new Timer(1000);
var numberOfChildren:Number;
var doOldLoader: Loader;
xmlLoader.addEventListener(Event.COMPLETE, xmlLoadedF);
function xmlLoadedF(event:Event):void {
    checkSec.start();
    checkSec.addEventListener(TimerEvent.TIMER, checkerF);
    imgData = new XML(event.target.data);
function packagedF():void{ 
    checkSec.removeEventListener(TimerEvent.TIMER, checkerF);
    rawImage = imgData.image[imgNum].imgURL;
    numberOfChildren = imgData.*.length();
    rawW = imgData.image[imgNum].imgW;
    rawH = imgData.image[imgNum].imgH;
    if ( null != imageLoader )
    doOldLoader = imageLoader ;
        imageLoader = new Loader;
        imageLoader.load(new URLRequest(rawImage));
        master_mc.addChild(imageLoader);
        imageLoader.x = (master_mc.width - Number(rawW)) / 2;
        imageLoader.y = (master_mc.height - Number(rawH)) / 2;
        imageLoader.alpha = 0;
        myTween = new Tween(imageLoader,"alpha", Strong.easeOut, imageLoader.alpha, 1, 2, true);
        myTween.addEventListener(TweenEvent.MOTION_FINISH, TimerIgnite);
function TimerIgnite(e:Event):void{
    if (null != doOldLoader)
        master_mc.removeChild(doOldLoader);
    delay.start();
    delay.addEventListener(TimerEvent.TIMER, nextImgF);
function checkerF(event:TimerEvent):void{
    if(imgNum == 0){
        packagedF();
    }else if(imgNum < numberOfChildren){
        packagedF();
    }else{
        imgNum = 0;
        packagedF();
function nextImgF(e:Event): void {
    delay.stop();
    checkSec.addEventListener(TimerEvent.TIMER, checkerF);
    imgNum++;

Similar Messages

  • How to use Load XML Data (Home Utilities Data Load/Unload Load)

    How is Load XML Data (Home>Utilities>Data Load/Unload>Load) supposed to work? Where is this documented?
    What table type/structure is required?
    How does this related to XDB functionality?

    It's not really documented that well in the XE redux documents (or even the base Apex Documents)- see http://download-west.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25309/sql_utl.htm#sthref2530
    However, it's reasonably easy to use - you can export a table to XML format, and then reload the table with the data by importing the XML document. It has nothing to do with XDB, it's just a different flat file representation for unloaded data than CSV

  • How to xml file load in actionscript 3.0

    Hi surfers,
    How to xml file load in actionscript 3.0, How to get xml data.
    Thanks in Advance.
    Pls give me ASAP, i'm struggle here.

    Search Google using "AS3 XML tutorial".

  • Load / unload numerous images in air application (memory leak?)

    Hi,
    after struggling for a few days with this, I realized I need help!
    I am trying to make an application load and display A LOT (hundreds) of images thumbnails at various position in a big area. The problem is that when I try to unload and reload images, I end up with an increasing memory, that does not get collected by the garbage collector.
    My first challenge was to load images from anywhere in the computer (I am quite new to flex), which I solved by using a File reference and a Loader using the url extracted from the file:
                   private function createImage():void {
                             var img_:String = "1905_a_mondrian.jpg";
                             var imageFile:File = new File();
                             imageFile.nativePath = imagesPath + "/" + img_;
                             var imageLoader:Loader = new Loader();
                             // useWeakReference permits the GC to collect the memory when the eventListener is dropped
                             imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded, false, 0, true);
                             imageLoader.load(new URLRequest(imageFile.url));
                             imageFile = null;
    I make sure I remove the eventListener in the loaded method:
         e.target.content.removeEventListener(Event.COMPLETE, loaded);
    And then Populate an external component:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
              xmlns:s="library://ns.adobe.com/flex/spark"
              xmlns:mx="library://ns.adobe.com/flex/halo"
              x="-100" y="-100"  width="200" height="200" >
         <!-- The trick is right above this line: offset the anchor point to center the component around -->
         <fx:Script>
              <![CDATA[
                   import mx.controls.Image;
                   [Bindable]
                   public var image:Image;
              ]]>
         </fx:Script>
         <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <mx:Image id="img_" source="{image}" horizontalCenter="0" verticalCenter="0" autoLoad="true" />
         <!-- impair width and height results in problems for centering the ellipse (e.g. for rotation) -->
         <s:Ellipse height="4" width="4"  horizontalCenter="0" verticalCenter="0" >
              <s:fill>
                   <s:SolidColor color="0x00FF00"/>
              </s:fill>
         </s:Ellipse>
    </s:Group>
    I populate a Dictionary to keep a track of all the component created. Finally I nullify all that I can to hint the garbage collector.
    Now I have a function to empty the Dictionary (componentBag below) when we want to unload the images:
                   protected function button1_clickHandler(event:MouseEvent):void
                             for each ( var g : Group in componentBag )
                                       ((ImgPanel)(g.getChildAt(0))).img_.unloadAndStop(false);
                                       ((ImgPanel)(g.getChildAt(0))).image = null;
                                       delete componentBag[g.uid];
                                       g.removeElementAt(0);
                                       this.removeElement(g);
                                       g = null;
         triggerGC();
    PROBLEM: using profiler, the loading/unloading works once or twice and after the memory keeps increasing... And if I launch the application, wait for a while and do a load/unload, the garbage collection only recovers a few megabytes, far from what was allocated for displaying the images.
    What am I missing? Is there a problem with loading a lot of images? Has anyone done this?
    In attachment is the full test code, the ImgPanel goes inside a 'views' package

    Thanks to Anton_AL, I finally solved this problem by using an URLLoader AND a plain Loader:
    var loader: URLLoader = new URLLoader( );
    loader.dataFormat = URLLoaderDataFormat.BINARY;
    loader.addEventListener(Event.COMPLETE, onLoadingComplete );
    loader.load( new URLRequest(file.url) );
    private function onLoadingComplete( e: Event ):void
         var loader: Loader = new Loader( );
         loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onParsingComplete );
         loader.loadBytes( e.target.data );
    private function onParsingComplete( e: Event ):void
         var img: BitmapImage = new BitmapImage( );
         img.source = (e.target.content as Bitmap).bitmapData;
         _images.push( img );
    private function onImageLoaded( e:Event ):void
         var img: Image = e.target as Image;
         img.removeEventListener( Event.COMPLETE, onImageLoaded );
         _images.push( img );
    See Anton's thread here: http://forums.adobe.com/message/2358653#2358653

  • XML AS3 Problem

    I'm developing an elearning course for learning MS EXCEL.
    In the course, I have Next and Back Buttons to navigate between lessons.
    Each lesson has number of tasks (maximum of 3), which are buttons at the left side.
    and here is part of the XML file:
    <excel>
         <chapter id="1" title="">
         <screen title="lesson">
         <swf>EXCEL/CH01/CH01_S01.swf</swf>
         <ltitle>Chapter 1</ltitle>
         <rtitle>Setting Up a Workbook</rtitle>
         <prompt>Choose a lesson</prompt>
         </screen>
         <screen title="lesson" tasks="3">
         <swf>EXCEL/CH01/CH01_S02.swf</swf>
         <ltitle>Chapter 1</ltitle>
         <rtitle>Setting Up a Workbook</rtitle>
         <prompt>Click Next to continue</prompt>
         </screen>
         <screen title="lesson01task01">
         <swf>EXCEL/CH01/CH01_S03.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>What's Excel?</rtitle>
         <prompt>Click Next to continue</prompt>
         </screen>
         <screen title="lesson01task02">
         <swf>EXCEL/CH01/CH01_S04.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>What's Excel?</rtitle>
         <prompt>Click Next to continue</prompt>
         </screen>
         <screen title="lesson01task03">
         <swf>EXCEL/CH01/CH01_S05.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>What's Excel?</rtitle>
         <prompt>Open the Microsoft Excel</prompt>
         </screen>
         <screen title="lesson" tasks="1">
         <swf>EXCEL/CH01/CH01_S06.swf</swf>
         <ltitle>Chapter 1</ltitle>
         <rtitle>Setting Up a Workbook</rtitle>
         <prompt>Click Next to continue</prompt>
         </screen>
         <screen title="lesson02task01">
         <swf>EXCEL/CH01/CH01_S07.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Become Familiar with Excel</rtitle>
         <prompt> Roll mouse over each icon to recognize its name</prompt>
         </screen>
         <screen title="lesson" tasks="1">
         <swf>EXCEL/CH01/CH01_S08.swf</swf>
         <ltitle>Chapter 1</ltitle>
         <rtitle>Setting Up a Workbook</rtitle>
         <prompt>Click Next to continue</prompt>
         </screen>
         <screen title="lesson03task01">
         <swf>EXCEL/CH01/CH01_S09.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Create a workbook</rtitle>
         <prompt> Follow the following Instructions</prompt>
         </screen>
         <screen title="lesson" tasks="1">
         <swf>EXCEL/CH01/CH01_S10.swf</swf>
         <ltitle>Chapter 1</ltitle>
         <rtitle>Setting Up a Workbook</rtitle>
         <prompt>Click Next to continue</prompt>
         </screen>
         <screen title="lesson04task01">
         <swf>EXCEL/CH01/CH01_S11.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Modify a workbook</rtitle>
         <prompt> Create a new workbook</prompt>
         </screen>
         <screen title="lesson" tasks="1">
         <swf>EXCEL/CH01/CH01_S12.swf</swf>
         <ltitle>Chapter 1</ltitle>
         <rtitle>Setting Up a Workbook</rtitle>
         <prompt>Click Next to continue</prompt>
         </screen>
         <screen title="lesson05task01">
         <swf>EXCEL/CH01/CH01_S13.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Modify a worksheet</rtitle>
         <prompt> Follow the Instructions</prompt>
         </screen>
         <screen title="lesson" tasks="3">
         <swf>EXCEL/CH01/CH01_S14.swf</swf>
         <ltitle>Chapter 1</ltitle>
         <rtitle>Setting Up a Workbook</rtitle>
         <prompt>Click Next to continue</prompt>
         </screen>
         <screen title="lesson06task01">
         <swf>EXCEL/CH01/CH01_S15.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Customizing the Excel Window</rtitle>
         <prompt></prompt>
         </screen>
         <screen title="lesson06task02">
         <swf>EXCEL/CH01/CH01_S16.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Customizing the Excel Window</rtitle>
         <prompt>Follow the Instructions</prompt>
         </screen>
         <screen title="lesson06task03">
         <swf>EXCEL/CH01/CH01_S17.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Customizing the Excel Window</rtitle>
         <prompt>Follow the Instructions</prompt>
         </screen>
         <screen title="">
         <swf>EXCEL/CH01/CH01_S18.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Customizing the Excel Window</rtitle>
         <prompt>Follow the Instructions</prompt>
         </screen>
         <screen title="lesson">
         <swf>EXCEL/CH01/CH01_S19.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Test yourself</rtitle>
         <prompt>Follow the Instructions</prompt>
         </screen>
         <screen title="lesson">
         <swf>EXCEL/CH01/CH01_S19.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Test yourself</rtitle>
         <prompt>Follow the Instructions</prompt>
         </screen>              
         </chapter>
         <chapter id="2" title="">
    I load the info and swf files from XML into arrays.
    I'd like when the user click on Next and Back buttons, he navigate only between screens that has title of "lesson".
    and when the screen has attribute of tasks,  tasks buttons appear (number of task buttons is determined by the number in the tasks attribute).
    When the user click on the tasks button, he navigate to screens that comes after the lesson.
    I handled some of them but I can't handle the others.
    Here is the code:
    page.task1.visible = false;
    page.task2.visible = false;
    page.task3.visible = false;
    var excel:XML;
    var len:Number;
    var swfArray:Array=new Array();
    var leftArray:Array = new Array();
    var rightArray:Array = new Array();
    var promptArray:Array = new Array();
    var xmlLoader:URLLoader = new URLLoader();
    var xmlReq:URLRequest = new URLRequest("excel.xml");
    xmlLoader.load(xmlReq);
    xmlLoader.addEventListener(Event.COMPLETE, onXMLLoad);
    var task:Array = new Array(page.task1, page.task2, page.task3);
    function onXMLLoad(e:Event):void
         excel = new XML(xmlLoader.data);
         len = excel.chapter.screen.length();
         //trace(excel.chapter.screen.length());
         for(var i:Number = 0; i < len; i++)
              swfArray.push(excel.chapter.screen.swf[i].text());
              leftArray.push(excel.chapter.screen.ltitle[i].text());
              rightArray.push(excel.chapter.screen.rtitle[i].text());
              promptArray.push(excel.chapter.screen.prompt[i].text());
         page.left_txt.text = leftArray[0];
         page.right_txt.text = rightArray[0];
         page.prompt_txt.text = promptArray[0];
         //trace(leftArray.length);
    //trace(swfArray);
    var swfLoader:Loader = new Loader();
    swfLoader.load(new URLRequest("EXCEL/CH01/CH01_S01.swf"));
    swfLoader.x = 105;
    swfLoader.y = 130;
    page.addChild(swfLoader);
    var n:Number = 0;
    function loadScreen(strURL:String):void
         swfLoader.unload();
         swfLoader.load(new URLRequest(strURL));
         swfLoader.x = 105;
         swfLoader.y = 130;
         page.addChild(swfLoader);
         page.left_txt.text = leftArray[n];
         page.right_txt.text = rightArray[n];
         page.prompt_txt.text = promptArray[n];
         if(excel.chapter.screen[n].@tasks != undefined)
              for(var m:Number = 0; m < excel.chapter.screen[n].@tasks; m++)
                   task[m].visible = true;
                   task[m].addEventListener(MouseEvent.CLICK, onTask_btns);
         else
              for(var t:Number = 0; t < task.length; t++)
                   task[t].visible = false;
    function onTask_btns(e:MouseEvent):void
         if(e.target == task[0])
              loadScreen(swfArray[n+1]);
         else if(e.target == task[1])
              loadScreen(swfArray[n+2]);
         else if(e.target == task[2])
              loadScreen(swfArray[n+3]);
    function onNextButton(e:MouseEvent):void
         if(n < (swfArray.length - 1))
              n += 1;
         else
              n = 0
         loadScreen(swfArray[n]);
    function onPrevButton(e:MouseEvent):void
         if(n > 0)
              n -= 1;
         else
              n = (swfArray.length - 1);
         loadScreen(swfArray[n]);
    page.next_btn.addEventListener(MouseEvent.CLICK, onNextButton);
    page.prev_btn.addEventListener(MouseEvent.CLICK, onPrevButton);
    Waiting for your help.

    I'm developing an elearning course for learning MS EXCEL.
    In the course, I have Next and Back Buttons to navigate between lessons.
    Each lesson has number of tasks (maximum of 3), which are buttons at the left side.
    and here is part of the XML file:
    <excel>
         <chapter id="1" title="">
         <screen title="lesson">
         <swf>EXCEL/CH01/CH01_S01.swf</swf>
         <ltitle>Chapter 1</ltitle>
         <rtitle>Setting Up a Workbook</rtitle>
         <prompt>Choose a lesson</prompt>
         </screen>
         <screen title="lesson" tasks="3">
         <swf>EXCEL/CH01/CH01_S02.swf</swf>
         <ltitle>Chapter 1</ltitle>
         <rtitle>Setting Up a Workbook</rtitle>
         <prompt>Click Next to continue</prompt>
         </screen>
         <screen title="lesson01task01">
         <swf>EXCEL/CH01/CH01_S03.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>What's Excel?</rtitle>
         <prompt>Click Next to continue</prompt>
         </screen>
         <screen title="lesson01task02">
         <swf>EXCEL/CH01/CH01_S04.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>What's Excel?</rtitle>
         <prompt>Click Next to continue</prompt>
         </screen>
         <screen title="lesson01task03">
         <swf>EXCEL/CH01/CH01_S05.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>What's Excel?</rtitle>
         <prompt>Open the Microsoft Excel</prompt>
         </screen>
         <screen title="lesson" tasks="1">
         <swf>EXCEL/CH01/CH01_S06.swf</swf>
         <ltitle>Chapter 1</ltitle>
         <rtitle>Setting Up a Workbook</rtitle>
         <prompt>Click Next to continue</prompt>
         </screen>
         <screen title="lesson02task01">
         <swf>EXCEL/CH01/CH01_S07.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Become Familiar with Excel</rtitle>
         <prompt> Roll mouse over each icon to recognize its name</prompt>
         </screen>
         <screen title="lesson" tasks="1">
         <swf>EXCEL/CH01/CH01_S08.swf</swf>
         <ltitle>Chapter 1</ltitle>
         <rtitle>Setting Up a Workbook</rtitle>
         <prompt>Click Next to continue</prompt>
         </screen>
         <screen title="lesson03task01">
         <swf>EXCEL/CH01/CH01_S09.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Create a workbook</rtitle>
         <prompt> Follow the following Instructions</prompt>
         </screen>
         <screen title="lesson" tasks="1">
         <swf>EXCEL/CH01/CH01_S10.swf</swf>
         <ltitle>Chapter 1</ltitle>
         <rtitle>Setting Up a Workbook</rtitle>
         <prompt>Click Next to continue</prompt>
         </screen>
         <screen title="lesson04task01">
         <swf>EXCEL/CH01/CH01_S11.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Modify a workbook</rtitle>
         <prompt> Create a new workbook</prompt>
         </screen>
         <screen title="lesson" tasks="1">
         <swf>EXCEL/CH01/CH01_S12.swf</swf>
         <ltitle>Chapter 1</ltitle>
         <rtitle>Setting Up a Workbook</rtitle>
         <prompt>Click Next to continue</prompt>
         </screen>
         <screen title="lesson05task01">
         <swf>EXCEL/CH01/CH01_S13.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Modify a worksheet</rtitle>
         <prompt> Follow the Instructions</prompt>
         </screen>
         <screen title="lesson" tasks="3">
         <swf>EXCEL/CH01/CH01_S14.swf</swf>
         <ltitle>Chapter 1</ltitle>
         <rtitle>Setting Up a Workbook</rtitle>
         <prompt>Click Next to continue</prompt>
         </screen>
         <screen title="lesson06task01">
         <swf>EXCEL/CH01/CH01_S15.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Customizing the Excel Window</rtitle>
         <prompt></prompt>
         </screen>
         <screen title="lesson06task02">
         <swf>EXCEL/CH01/CH01_S16.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Customizing the Excel Window</rtitle>
         <prompt>Follow the Instructions</prompt>
         </screen>
         <screen title="lesson06task03">
         <swf>EXCEL/CH01/CH01_S17.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Customizing the Excel Window</rtitle>
         <prompt>Follow the Instructions</prompt>
         </screen>
         <screen title="">
         <swf>EXCEL/CH01/CH01_S18.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Customizing the Excel Window</rtitle>
         <prompt>Follow the Instructions</prompt>
         </screen>
         <screen title="lesson">
         <swf>EXCEL/CH01/CH01_S19.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Test yourself</rtitle>
         <prompt>Follow the Instructions</prompt>
         </screen>
         <screen title="lesson">
         <swf>EXCEL/CH01/CH01_S19.swf</swf>
         <ltitle>Setting Up a Workbook</ltitle>
         <rtitle>Test yourself</rtitle>
         <prompt>Follow the Instructions</prompt>
         </screen>              
         </chapter>
         <chapter id="2" title="">
    I load the info and swf files from XML into arrays.
    I'd like when the user click on Next and Back buttons, he navigate only between screens that has title of "lesson".
    and when the screen has attribute of tasks,  tasks buttons appear (number of task buttons is determined by the number in the tasks attribute).
    When the user click on the tasks button, he navigate to screens that comes after the lesson.
    I handled some of them but I can't handle the others.
    Here is the code:
    page.task1.visible = false;
    page.task2.visible = false;
    page.task3.visible = false;
    var excel:XML;
    var len:Number;
    var swfArray:Array=new Array();
    var leftArray:Array = new Array();
    var rightArray:Array = new Array();
    var promptArray:Array = new Array();
    var xmlLoader:URLLoader = new URLLoader();
    var xmlReq:URLRequest = new URLRequest("excel.xml");
    xmlLoader.load(xmlReq);
    xmlLoader.addEventListener(Event.COMPLETE, onXMLLoad);
    var task:Array = new Array(page.task1, page.task2, page.task3);
    function onXMLLoad(e:Event):void
         excel = new XML(xmlLoader.data);
         len = excel.chapter.screen.length();
         //trace(excel.chapter.screen.length());
         for(var i:Number = 0; i < len; i++)
              swfArray.push(excel.chapter.screen.swf[i].text());
              leftArray.push(excel.chapter.screen.ltitle[i].text());
              rightArray.push(excel.chapter.screen.rtitle[i].text());
              promptArray.push(excel.chapter.screen.prompt[i].text());
         page.left_txt.text = leftArray[0];
         page.right_txt.text = rightArray[0];
         page.prompt_txt.text = promptArray[0];
         //trace(leftArray.length);
    //trace(swfArray);
    var swfLoader:Loader = new Loader();
    swfLoader.load(new URLRequest("EXCEL/CH01/CH01_S01.swf"));
    swfLoader.x = 105;
    swfLoader.y = 130;
    page.addChild(swfLoader);
    var n:Number = 0;
    function loadScreen(strURL:String):void
         swfLoader.unload();
         swfLoader.load(new URLRequest(strURL));
         swfLoader.x = 105;
         swfLoader.y = 130;
         page.addChild(swfLoader);
         page.left_txt.text = leftArray[n];
         page.right_txt.text = rightArray[n];
         page.prompt_txt.text = promptArray[n];
         if(excel.chapter.screen[n].@tasks != undefined)
              for(var m:Number = 0; m < excel.chapter.screen[n].@tasks; m++)
                   task[m].visible = true;
                   task[m].addEventListener(MouseEvent.CLICK, onTask_btns);
         else
              for(var t:Number = 0; t < task.length; t++)
                   task[t].visible = false;
    function onTask_btns(e:MouseEvent):void
         if(e.target == task[0])
              loadScreen(swfArray[n+1]);
         else if(e.target == task[1])
              loadScreen(swfArray[n+2]);
         else if(e.target == task[2])
              loadScreen(swfArray[n+3]);
    function onNextButton(e:MouseEvent):void
         if(n < (swfArray.length - 1))
              n += 1;
         else
              n = 0
         loadScreen(swfArray[n]);
    function onPrevButton(e:MouseEvent):void
         if(n > 0)
              n -= 1;
         else
              n = (swfArray.length - 1);
         loadScreen(swfArray[n]);
    page.next_btn.addEventListener(MouseEvent.CLICK, onNextButton);
    page.prev_btn.addEventListener(MouseEvent.CLICK, onPrevButton);
    Waiting for your help.

  • Load/ Unload external .swf

    ----------------------------------------
    vita | web | design | illustration
    "main" here
    I try to have external .swf on this "main" part of my flash
    design automatically using load actionscript.
    I have 3 different sets of actionscripts for load/unload.
    But, the problem is when I click vita or other menu on the
    top after loading "main" external .swf, they are overlapped.
    How can I unload the external .swf from the automatically
    loaded .swf?
    (As I know, there are mostly buttons to click on loading
    external .swf. But for my design, I want it loads automatically.)
    Thanks in advance for suggestions. Please let me know if my
    description/question is not clear to answer.

    Are you using AS2 or AS3. The approach is completely
    different for both.

  • How to create an xml to load swf files in sequence?

    hello everyone
    I'm new in web design... I know how to animate in flash, using timeline, frames, layers, twins and so on... But I want to move forward so I want to create a xml to load swf files in sequence and in loop. Each swf file has 8 seconds.You can see the example here in www.cm-seixal.pt.
    I'm not a programmer but I understand how actionscript works... I hope you can help me
    Cheers!
    Ana

    you can use the urlloader class to load your xml file.  use the loader's complete event and the loader's data property to retrieve the data in your xml file.

  • New HDD Load / Unload Cycle Count increasing extremely fast !

    Hi all
    I just upgrade my Pavilion dv5 HDD. The new model is Hitachi Travelstar 7K500 (HTS725050A9A364). However, I found my new HDD's Load / Unload Cycle Count increasing extremely fast!
    Until now the number of Load / Unload Cycle is 12,127. However, the new HDD only power on 137hours. (About 1 week of my use.)  The data below is my new HDD's SMART data (by EVEREST 5.50):
    ID   
    01    Raw Read Error Rate    62    100    100    0   
    02    Throughput Performance    40    100    100    0   
    03    Spinup Time    33    159    159    2  
    04    Start/Stop Count    0    100    100    14   
    05    Reallocated Sector Count    5    100    100    0  
    07    Seek Error Rate    67    100    100    0  
    08    Seek Time Performance    40    100    100    0  
    09    Power-On Time Count    0    100    100    137  
    0A    Spinup Retry Count    60    100    100    0   
    0C    Power Cycle Count    0    100    100    14  
    BF    Mechanical Shock    0    100    100    0   
    C0    Power-Off Retract Count    0    100    100    1 
    C1    Load/Unload Cycle Count    0    99    99    12127   
    C2    Temperature    0    152    152    19, 36  
    C4    Reallocation Event Count    0    100    100    0   
    C5    Current Pending Sector Count    0    100    100    0  
    C6    Offline Uncorrectable Sector Count    0    100    100    0  
    C7    Ultra ATA CRC Error Rate    0    200    200    0  
    DF    Load/Unload Retry Count    0    100    100    0   
    I'm pretty sure that the data is correct, because I can hear the HDD's Load / Unload sound very frequently. The C1 row increase about 2,000 per day.  However my previous Hitachi 5K320 has no problem. The running operating system are both Windows 7.
    I'm so worry about this. As you know, laptop HDD's L / UL Cycle is designed at 600,000. If my HDD continue increasing like this, it will reach this number in a very short time. Any one can help me?

    It's a feature of modern 2.5" harddisks , the disk parks the head when its been inactive for a while, to avoid damage , uses less power , and reduces the heat etc gives the harddisk a better looking spec sheet , its meant to park its head after being inactive for a long time around an hour with proper management from the bios/os of the head parking feature, because there is nothing to manage this feature in hp's bios or os the disk parks the head about every minute for no reason then after 1 second the head goes back on the disk thats 1 load/unload cycle , it also effects performance as the head has to find its place back on the disk , load times will decrease by alot , videos will stutter the first few secs, i have the same problem but not as bad after 130 hours i had a count of around 1,250 load/unloads , different brands of disk have different idle timers plus i use utorrent which stops the harddisk from idling so much, there are a couple of solutions, you can find a tool to update/mod the harddisk firmware to increase the idle timer ( i decided against this as you can permently brake the harddrive and void the warrenty) , contact hp and request a bios update with proper management or the harddisk head parking feature i.e tell the harddisk it is idle after an hour, the temperary solutions are download hd tune and run it all the time this stops the harddisk from parking its head as it doesn't let it go idle , or the solution i am using at the moment download a programme called HDD scan , everytime you turn on/off  you have to run the prog go to tasks/features/ide features set the advance power management from its default value to 254 then press set, no more unnessary load/unloads, downside is the disk runs a couple of 0c hotter mine still never goes above 40c even under full load thanks to a active cooling pad, also its less well protected against shock.

  • Which JAR file has the class weblogic.xml.domimpl.Loader ?

    when an Axis web-service WSDL is read and parsed using weblogic client - i get this error. which weblogic-10 jar file has this class "weblogic/xml/domimpl/Loader" ?
    java.lang.NoClassDefFoundError: weblogic/xml/domimpl/Loader
    at weblogic.wsee.util.dom.DOMParser.getWebLogicDocumentImpl(DOMParser.java:168)
    at weblogic.wsee.util.dom.DOMParser.getDocument(DOMParser.java:58)
    at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:311)
    at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:402)
    at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:388)
    at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:78)
    at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:65)
    at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:468)
    at weblogic.wsee.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:114)
    at com.qwest.assia.service.client.Provisioning_Info_Impl.<init>(Unknown Source)
    at com.qwest.assia.service.client.Provisioning_Info_Impl.<init>(Unknown Source)
    at com.qwest.iom.connector.adapter.webservice.qcontrol.AssiaWebServiceConnectionFactory.getWebServiceConnection(AssiaWebServiceConnectionFactory.java:64)
    at com.qwest.mdw.connector.webservice.WebServiceConnectionFactory.getConnection(WebServiceConnectionFactory.java:25)
    at com.qwest.iom.connector.adapter.webservice.qcontrol.AssiaWebServiceTestCase.test_MyAccountWebService(AssiaWebServiceTestCase.java:51)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)

    Hi,
    I found it in ADF 11g R2 documentation - http://docs.oracle.com/cd/E24382_01/web.1112/e16182/taskflows_regions.htm#insertedID10
    I guess this is 11g R2 feature.
    I have a requirement to display the multiple regions dynamically. This feature suits my requirement perfectly, but unfortunately it is not available in 11g R1.
    Can we achieve the similar functionality in 11g R1 through other means?
    Thanks
    Ravi

  • Load/Unload Component from Main Application

    I want to load in my main application 2 components. At this moment I load them with this:
    <components:loadProject id="loadPrj" visible="false" click="loadPrj_clickHandler(event)" verticalCenter="7" horizontalCenter="0"/>
    and I only set visible to true. Inside this component there is a canvas.
    But, is there any other way to do this using an AS class file? I would like to load/unload it on click, not only set true/false to visible.

    For dynamic creation and destruction of objects, you want to use ActionScript.
    So in your main app file, you might have a button that triggers a click handler that does this:
    private function myClickHandler()void {
                    var b1:CustomComponent = new CustomComponent();
                    var b2:CustomComponent = new CustomComponent();
                    /// Be sure to add them to the display list if they are visual components
                    myPanel.addElement(b1);
                    myPanel.addElement(b1);

  • Can an xml node load an external htm file?

    I wanted to know if i could have an xml node load in an
    external html page
    src="filefolder/@nodename" works with an image tag, but how
    would I accomplish this with a <div> and an html file
    I tried
    <div id="main" spry:detailregion="myviewer">
    <div>{@caption}</div>
    <div>{@fullimage}</div>
    <div>{filefolder/@nodename}</div> though get
    nothing because there is no src.
    </div>
    I have another strategy to use if not. However, it would be
    sweet if I could.

    Hello,
    I'm not sure this will work but you can give it a try to the
    following code based on the
    update
    content sample:
    <div id="main" spry:detailregion="myviewer">
    <div>{@caption}</div>
    <div>{@fullimage}</div>
    <div id="nodename"></div> though get nothing
    because there is no src.
    <script type="text/javascript">
    var element = document.getElementById('nodename');
    Spry.Utils.updateContent(element, '{filefolder/@nodename}');
    </div>
    Please note that any CSS and JS code within the loaded
    content will not execute correctly if you won't add the code in the
    current file instead of the loaded file. Also please make sure that
    the paths in the loaded HTML fragment are relative to the current
    file and not to the HTML Fragment.
    Regards,
    Cristian MARIN

  • Xml multi loader

    Hello I am working with a xml loader that i downloaded, the creator was unwilling to help me mod his design so i turn to the forums.
    Here is the flash code i am working with can any one help, as i may be able to load multiple xml files into the one content window frame, so that when each different button is pressed the window reloads with the new corresponding xml file.
    This is the code used to load the current single xml file. I already have separate individual buttons created, each button loads the same window just don't know how to change the content per which button is pressed.
    I there a way to set up var or something? like maybe a if() then() function? How would i go about this the easyiest way?
    Thanks for all your help guys.
    [AS]
    Scene1:
    // RELAUNCH BUTTON
    relaunchBttn2._visible = true;
    relaunchBttn2.bttn.onPress = function() {
        window_mc.showContent();
        relaunchBttn2._visible = true;
    relaunchBttn._visible = true;
    relaunchBttn.bttn.onPress = function() {
        window_mc.showContent();
        relaunchBttn._visible = true;
    //window_mc
    // Once content and XML loaded, start transition
    onEnterFrame = function () {
         if (content_mc.xmlData.loaded) {
              showContent();
              delete onEnterFrame;
    stop();
    //content_mc// Where the As for the XML is
    // LOAD XML
    loadXML = function (loaded) {
         if (loaded) {
              xmlNode = this.firstChild;
              contentBorder = Number(xmlNode.childNodes[0].attributes.Border);
              contentWidth = Number(xmlNode.childNodes[0].attributes.Width);
              contentHeight = Number(xmlNode.childNodes[0].attributes.Height);
              txt_mc.txt.htmlText = xmlNode.childNodes[0].firstChild.nodeValue;
              headerName.text = xmlNode.attributes.Name;
              setContents();
         } else {
              trace("Error loading XML");
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("content/content.xml");
    stop();
    [/AS]

    Thanks Jeff!  That worked!  I've been working on this all day....
    Thanks a lot!
    Ricky

  • Load & Unload Movie Issue

    Hi Guys:
    Have 2 unable solve issues, would be much appreciated if anyone could help.
    // ISSUE 1 //
    I am experiencing an issue with Load & Unload Movie.  What happen is that I am trying to load an external SWF into a movie clip call movieContainer in my main website.  This external SWF file has timeline that perform a animation when it's loaded into the movieContainer.
    I can load and unload the movie with no problem...the issue is that after I unload the SWF and then at any point of the movie on the main website I click to load the SWF back to the stage.....the timeframe of the SWF file stay at where it get left off(when it's unloaded).  I am trying to make it play start all over again.
    I try the movieContainer.content.gotoAndPlay(1); but it doesn't do anything. Any idea how I could make this work?
    Here is my code:
    var content:Loader = new Loader();
    content.load(new URLRequest("externalSwf/content.swf"));
    loadMovieButton.addEventListener(MouseEvent.CLICK, loadMovieButtonClicked);
    function loadMovieButtonClicked(e:MouseEvent):void{
        movieContainer.addChild(content);
    // ISSUE 2 //
    In my external SWF file, I have create a loading loader at the 1st frame.  But it doesn't play all the time when I testing on the server.  It works just fine when I test locally with TEST MOVIE.  Not only it doesn't play all the time.....it suppose to play from 2nd frame of the movie after the loading is finished (I have a short animation play between frame 2 - frame 20)  Instead of playing from frame 2 to frame 20, the animation just jump straight to frame 20...which mean the user won't see the animation between frame 2 - frame 20.
    import flash.events.ProgressEvent;
    function update(e:ProgressEvent):void
    var percent:Number = Math.floor( (e.bytesLoaded*100)/e.bytesTotal );
    if(preloaderMC is MovieClip){
    preloaderMC.gotoAndStop(percent);
    //preload_txt.text = String(percent);
    if(percent == 100){
    gotoAndPlay(2);
    loaderInfo.addEventListener(ProgressEvent.PROGRESS, update);
    // Extra test for IE
    var percent:Number = Math.floor( (this.loaderInfo.bytesLoaded*100)/this.loaderInfo.bytesTotal );
    if(percent == 100){
    nextFrame();
    stop();
    Many Thanks!

    Thanks for the reply, the code I use to load the external SWF is:
    The button is within a movieClip: commercialScrollBar_mc
    The button instance name is: stackPancakeBar
    The external SWF get to load into a movieClip container call: projectDetailsContainer_mc
    var ldr:Loader = new Loader();
    ldr.load(new URLRequest("projectsCommercial/stackPancakeBar.swf"));
    commercialScrollBar_mc.stackPancakeBar.addEventListener(MouseEvent.CLICK, stackPancakeBarClicked);
    function stackPancakeBarClicked(e:MouseEvent):void{
        MovieClip(ldr.content).gotoAndPlay(1);
        projectDetailsContainer_mc.addChild(ldr);
    I was thinking does it has anything to do with the UNLOAD script I have on the external SWF file? Below are the code for removing the child.
    back_btn.addEventListener(MouseEvent.CLICK, removeProjectDetails);
    function removeProjectDetails(e:MouseEvent):void{
        this.parent.parent.removeChild(this.parent);
    Thanks Heaps, by the way, do you have any idea why the loading sequence doesn't get to play every time?  Or perhape the file size is too small?

  • Crossdomain.xml Not Loading

    This may be a newb question. I’m trying to figure out why my swf file, running from localhost, is bypassing the crossdomain.xml when loading a xml file from a remote domain.
    I stored the crossdomain.xml at the root of the domain.
    http://www.mydomain.com/crossdomain.xml
    When I checked the HTTP headers, there’s no request sent out to get the crossdomain.xml file.
    Another issue is that the Security.sandboxType is always localTruested. Could that be the reason that the swf file is not checking the crossdomain.xml? If so, how can i change the sandboxType.
    Any help is appreciated!
    Thanks

    Can you look at the name of the file you're loading before you load it? So, if it contains .swf don't load? Aside from that, you can get the content type before the image/file is finished loading. You do it with the LoaderInfo object... something like this:
    var loader:Loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
    function initHandler(event:Event):void {
        var loader:Loader = Loader(event.target.loader);
        var info:LoaderInfo = LoaderInfo(loader.contentLoaderInfo);
        trace(info.contentType);
    If you load a jpeg you will see: image/jpeg
    If you load a .swf you will see: application/x-shockwave-flash

  • RSRV Load/Unload of indexes

    Not important topic, but may be someone from SAP will be interested with this observation.
    Loading and unloading (i.e. deleting) from memory of the huuuge single BIA index with RSRV I noticed incremental increase of memory consumption on the blade where this index is assigned. After couple of repetitive loads/unloads I incresed memory consumption from 6GB to 13GB. (Then I decided to stop, otherwise I would might crash my 16GB blade).
    Regards,
    -Vitaliy

    Hi Satyam,
    It was an issue with memory leak in that Revision of BWA. Current revisions (like 50+) are much-much better with that.
    Regards,
    -Vitaliy

Maybe you are looking for