Skip to main content
StoneChameleon
Inspiring
September 16, 2011
Answered

Help with arrangement and which section is throwing 2044 error.

  • September 16, 2011
  • 2 replies
  • 1738 views

Hi, guys,

I'm hoping someone has an answer for me. First, I can't figure out which section of my code is throwing the Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found. I tried tracing the swf, image, and xml but nothing is returned. Second, I can't get my swf files to load in, nor can I get my image files to load in (from the xml).

This is already late and I'm stressing hard core, maybe that's half my problem. Can anyone help? Please??

import flash.display.Stage;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.*;
import flash.events.MouseEvent;
import flash.text.*;
import flash.xml.*;
import fl.transitions.*;
import fl.transitions.easing.*;

stage.scaleMode = StageScaleMode.NO_SCALE; // Set stage scale mode
stage.align = StageAlign.TOP_LEFT; // Set stage alignment
stage.addEventListener(Event.RESIZE, whenStageResize); // Add a stage resize event listener

// Background variables
var interactiveMenuBgSpr:Sprite = new Sprite();
var bgSwitchMenuSpr:Sprite = new Sprite();
var footerBgSpr:Sprite = new Sprite();

// Variables for mp3 controls
var volIcoMC:VolumeIconMC = new VolumeIconMC(); // Volume Icon
var volUpMC:VolumeUpMC = new VolumeUpMC(); // Volume Up
var volDownMC:VolumeDownMC = new VolumeDownMC(); // Volume Down
var artistTxtBGMC:TxtBGMC = new TxtBGMC(); // Artist Textbox Background
var songTxtBGMC:TxtBGMC = new TxtBGMC(); // Song Textbox Background
var prevBtnMC:PreviousBtnMC = new PreviousBtnMC(); // Previous Button
var rewindBtnMC:RewindBtnMC = new RewindBtnMC(); // Rewind Button
var stopBtnMC:StopBtnMC = new StopBtnMC(); // Stop Button
var playBtnMC:PlayBtnMC = new PlayBtnMC(); // Play Button
var fforwardBtnMC:FastforwardBtnMC = new FastforwardBtnMC(); // Fastforward Button
var nextBtnMC:NextBtnMC = new NextBtnMC(); // Next Button

// Array for menu list
var menuArray:Array = new Array("Home",
                          "Mission",
                          "Transplant Statistics",
                          "Transplant Details",
                          "Understanding Donations",
                          "Your Part",
                          "Specialists",
                          "Contact",
                          "Terms",
                          "Sitemap");
   
// Hold the x position for next menu item
var xPos:Number = 0;
// Menu container
var menuHolder:Sprite = new Sprite();

// Menu text field format
var titleFace:Font = new ParkAvenue();
var siteLogoTxt:TextFormat = new TextFormat();
    siteLogoTxt.font = titleFace.fontName;
    siteLogoTxt.color = 0x260f26;
    siteLogoTxt.size = 36;
    siteLogoTxt.align = "left";

// Text Formats
var txtFace:Font = new Myriad();
var menuTxt:TextFormat = new TextFormat();
    menuTxt.font = txtFace.fontName;
    menuTxt.color = 0xe1c58d;
    menuTxt.size = 14;
    menuTxt.align = "left";
   
var bodyTxt:TextFormat = new TextFormat();
    bodyTxt.font = txtFace.fontName;
    bodyTxt.color = 0x333333;
    bodyTxt.size = 14;
    bodyTxt.align = "left";
   
var headingFormat:TextFormat = new TextFormat();
    headingFormat.font = txtFace.fontName;
    headingFormat.color = 0x701b2e;
    headingFormat.size = 14;
    headingFormat.align = "left";
    headingFormat.bold = true;
   
// Text Fields
var headingTxt = new TextField();
    headingTxt.condenseWhite = true;
    headingTxt.autoSize = TextFieldAutoSize.LEFT;
    headingTxt.selectable = false;
    headingTxt.defaultTextFormat = headingFormat;
    headingTxt.wordWrap = true;
    headingTxt.width = 490;
    headingTxt.height = 18;
    headingTxt.x = 5;
    headingTxt.y = 0;

var contentTxt = new TextField();
    contentTxt.condenseWhite = true;
    contentTxt.autoSize = TextFieldAutoSize.LEFT;
    contentTxt.selectable = false;
    contentTxt.defaultTextFormat = bodyTxt;
    contentTxt.wordWrap = true;
    contentTxt.multiline = true;
    contentTxt.width = 490;
    contentTxt.height = 618;
    contentTxt.x = 5;
    contentTxt.y = 25;

var contentRTopTxt = new TextField();
    contentRTopTxt.condenseWhite = true;
    contentRTopTxt.autoSize = TextFieldAutoSize.LEFT;
    contentRTopTxt.selectable = false;
    contentRTopTxt.defaultTextFormat = bodyTxt;
    contentRTopTxt.wordWrap = true;
    contentRTopTxt.multiline = true;
    contentRTopTxt.width = 465;
    contentRTopTxt.height = 295;
    contentRTopTxt.x = 530;
    contentRTopTxt.y = 0;

var contentRBottomTxt = new TextField();
    contentRBottomTxt.condenseWhite = true;
    contentRBottomTxt.autoSize = TextFieldAutoSize.LEFT;
    contentRBottomTxt.selectable = false;
    contentRBottomTxt.defaultTextFormat = bodyTxt;
    contentRBottomTxt.wordWrap = true;
    contentRBottomTxt.multiline = true;
    contentRBottomTxt.width = 465;
    contentRBottomTxt.height = 295;
    contentRBottomTxt.x = 530;
    contentRBottomTxt.y = 340;

// Variable for content container
var mcContent:Sprite = new Sprite();
    mcContent.x = 0;
    mcContent.y = 30;
    addChild(mcContent);

// Variables for pages
var pageContent:Sprite = new Sprite();

// Variable for content container
var pgContentBG:Sprite; // MCContentBG = new MCContentBG();

// Global tween variable
var pageTween:Tween;

// Intro page variables for title
var titleContainerLarge:Sprite = new Sprite();
var titleLargeLoader:Loader = new Loader();
var titleLargeUrl:URLRequest = new URLRequest("imgs/png/titleLarge.png");
var titleLargeImg:Bitmap;
var titleLarge:Bitmap;

var standardShadow:DropShadowFilter = new DropShadowFilter();
    standardShadow.distance = 2;
    standardShadow.angle = 0;
    standardShadow.color = 0x000000;
    standardShadow.blurX = 3;
    standardShadow.blurY = 3;
    standardShadow.quality = 10;
    standardShadow.alpha = .5;

// Iterative title (bottom left corner)

//var titleSmallLoader:Loader = new Loader();
//var titleSmallUrl:URLRequest = new URLRequest("imgs/png/titleSmall.png");
//var titleSmallImg:Bitmap;


titleLargeLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadTitle);
titleLargeLoader.load(titleLargeUrl);

//titleSmallLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadTitle);
//titleSmallLoader.load(titleSmallUrl);

//Specify the path to the XML file.
//You can use my path or your own.
//var xmlFilePath:String = "scripts/xml/content.xml";

//We save the loaded XML data into a variable
var pageXML:XML;

//Load the XML file.
//We call the pageXMLLoaded() function when the loading is complete.
var pageXMLLoader = new URLLoader();
pageXMLLoader.load(new URLRequest("scripts/xml/content.xml"));
pageXMLLoader.addEventListener(Event.COMPLETE, pageXMLLoaded);

/* STYLESHEET NOT FUNCTIONING PROPERLY
var CSSreq:URLRequest = new URLRequest("scripts/css/xmlStylesheet.css");
var CSSloader:URLLoader = new URLLoader();
var styleSheet:StyleSheet;
var CSSload;
*/

               
// Intro page variables for title
var swfContainer:Sprite = new Sprite();
var imgContainer:Sprite = new Sprite();
var imgLoader:Loader = new Loader();
var swfLoader:Loader = new Loader();

// Call init
init();

// Initialize functions
function init():void {
    //whenStageResize(null);
    drawMenus();
    positionAndAddMediaControls();
    loadTitleTxt();
}

//This function is called when the XML file is loaded
function pageXMLLoaded(e:Event):void {
   
    //Create a new XML object from the loaded XML data
    //pageXML = new XML(pageXMLLoader.data);
    pageXML = new XML(e.target.data);
    imgLoader.load(new URLRequest(pageXML.pages.page.image));
    swfLoader.load(new URLRequest(pageXML.pages.page.swfURL));
    trace(pageXML.pages.page.image);
   
}


function loadTitle(e:Event):void{
   
   
    var titleLargeImg:Bitmap = titleLargeLoader.content as Bitmap;
        titleLarge = new Bitmap(titleLargeImg.bitmapData);
        titleLarge.smoothing = true;
   
    titleContainerLarge.x = 183;
    titleContainerLarge.y = 214;
       
    titleContainerLarge.addChild(titleLarge);
    mcContent.addChildAt(titleContainerLarge, 0);
   
    var pageMoveTween:Tween = new Tween(mcContent, "y", Regular.easeInOut, stage.stageHeight + 20, 0, .5, true);
}


function drawMenus():void {
   
    // Clear prevents an instance of the interactiveMenuBg from remaining in its original position
    // Not so much a problem with the interactiveMenuBg, but it is with the bgSwitchMenu
    addChild(interactiveMenuBgSpr); // Add interactive menu background (full screen & mp3 controls)
        interactiveMenuBgSpr.graphics.clear();
        interactiveMenuBgSpr.graphics.beginBitmapFill(new InteractiveMenuBG(0, 0));
        interactiveMenuBgSpr.graphics.drawRect(0, 0, stage.stageWidth, 27);
        interactiveMenuBgSpr.graphics.endFill();
   
    // Background-Switch Menu Background
    addChild(bgSwitchMenuSpr); // Add background-switch menu background
        bgSwitchMenuSpr.graphics.clear();
        bgSwitchMenuSpr.graphics.beginBitmapFill(new BackgroundChangeMenuBG(0, 0));
        bgSwitchMenuSpr.graphics.drawRect(0, stage.stageHeight - 99, stage.stageWidth, 25);
        bgSwitchMenuSpr.graphics.endFill();
   
    // Footer background
    addChild(footerBgSpr); // Add footer background
        footerBgSpr.graphics.clear();
        footerBgSpr.graphics.beginBitmapFill(new FooterBG(0, 0));
        footerBgSpr.graphics.drawRect(0, stage.stageHeight - 74, stage.stageWidth, 74);
        footerBgSpr.graphics.endFill();

    // Add the interactiveMenuBg container to the display list

    // Loop the array and create each array item
    for (var i in menuArray) {

        // Create the menu navBtn.
        var navBtn:Sprite = new Sprite();
            navBtn.name = "navBtn" + i;
            // Disable mouse events of children within the navBtn.
            navBtn.mouseChildren = false;
            // Make the sprite behave as a button.
            navBtn.buttonMode = true;

        // Create the label for the down navBtn state.
        var label:TextField = new TextField();
            label.autoSize = TextFieldAutoSize.LEFT;
            label.selectable = false;
            label.defaultTextFormat = menuTxt;
            label.text = menuArray;
            // Add the label to the navBtn.
        navBtn.addChild(label);
            // Position the text in the center of the navBtn.
            label.x = (navBtn.width/2) - (label.width/2);
            label.y = (navBtn.height/2) - (label.height/2);

        // Add mouse events to the navBtn.
        navBtn.addEventListener(MouseEvent.CLICK, choosePageTransition);

        // Add the navBtn to the holder.
        menuHolder.addChild(navBtn);
            // Position the navBtn.
            navBtn.x = xPos;
            // Increase the x position for the next navBtn.
            xPos += navBtn.width + 12;
    }
   
    // Add menuHolder to display list
    addChild(menuHolder);
        // Postion The Menu.
        menuHolder.x = 140;
        menuHolder.y = ((stage.stageHeight - (menuHolder.height * 2)) - 10);
}
   
// Position on and add to stage all menu control buttons (interactivity controls)
function positionAndAddMediaControls():void {
       
    addChild(volIcoMC); // Volume Icon
        volIcoMC.x = interactiveMenuBgSpr.x + 5; // Volume Icon
        volIcoMC.y = interactiveMenuBgSpr.y + 6; // Volume Icon
   
    addChild(volUpMC); // Volume Up
        volUpMC.x = volIcoMC.x + volIcoMC.width + 6; // Volume Up Icon
        volUpMC.y = volIcoMC.y; // Volume Up Icon
   
    addChild(volDownMC); // Volume Down
        volDownMC.x = volUpMC.x; // Volume Down Icon
        volDownMC.y = volUpMC.y + 10; // Volume Down Icon
   
    addChild(artistTxtBGMC); // Artist Textbox Background
        artistTxtBGMC.x = volDownMC.x + volDownMC.width + 6; // Artist Textbox Background
        artistTxtBGMC.y = volIcoMC.y; // Artist Textbox Background
   
    addChild(songTxtBGMC); // Song Textbox Background
        songTxtBGMC.x = artistTxtBGMC.x + artistTxtBGMC.width + 6; // Song Textbox Background
        songTxtBGMC.y = volIcoMC.y; // Song Textbox Background
   
    addChild(prevBtnMC); // Previous Button
        prevBtnMC.x = songTxtBGMC.x + songTxtBGMC.width + 6; // Previous Button
        prevBtnMC.y = volIcoMC.y; // Previous Button
   
    addChild(rewindBtnMC); // Rewind Button
        rewindBtnMC.x = prevBtnMC.x + prevBtnMC.width + 6; // Rewind Button
        rewindBtnMC.y = volIcoMC.y; // Rewind Button
   
    addChild(stopBtnMC); // Stop Button
        stopBtnMC.x = rewindBtnMC.x + rewindBtnMC.width + 6; // Stop Button
        stopBtnMC.y = volIcoMC.y; // Stop Button
   
    addChild(playBtnMC); // Play Button
        playBtnMC.x = stopBtnMC.x + stopBtnMC.width + 6; // Play Button
        playBtnMC.y = volIcoMC.y; // Play Button
   
    addChild(fforwardBtnMC); // Fastforward Button
        fforwardBtnMC.x = playBtnMC.x + playBtnMC.width + 6; // Fastforward Button
        fforwardBtnMC.y = volIcoMC.y; // Fastforward Button
   
    addChild(nextBtnMC); // Next Button
        nextBtnMC.x = fforwardBtnMC.x + fforwardBtnMC.width + 6; // Next Button
        nextBtnMC.y = volIcoMC.y; // Next Button
}

function loadTitleTxt():void {
   
    var siteLogoTxtContainer:Sprite = new Sprite();
   
    var titleDropShadow:DropShadowFilter = new DropShadowFilter();
        titleDropShadow.distance = 2;
        titleDropShadow.angle = 90;
        titleDropShadow.color = 0x000000;
        titleDropShadow.blurX = 3;
        titleDropShadow.blurY = 3;
        titleDropShadow.quality = 10;
        titleDropShadow.alpha = .5;
   
   
    var titleSmall:TextField = new TextField();
        titleSmall.autoSize = TextFieldAutoSize.LEFT;
        titleSmall.selectable = false;
        titleSmall.defaultTextFormat = siteLogoTxt;
        titleSmall.wordWrap = true;
        titleSmall.width = 130;
        titleSmall.text = "Transplant the Heart";
        titleSmall.filters = [titleDropShadow];
   
   
   
    siteLogoTxtContainer.addChild(titleSmall);
    addChild(siteLogoTxtContainer);
        siteLogoTxtContainer.y = stage.stageHeight - siteLogoTxtContainer.height;
}
   
   
   
/* ----------------------------------------------------------------------------------*/
/* ----                                                                          ----*/
/* ----        < MOUSE EVENT: LOAD CONTENT BASED ON PAGE NUMBER (XML) >          ----*/
/* ----                                                                          ----*/
/* ----------------------------------------------------------------------------------*/

// Choose page transition function
function choosePageTransition(e:MouseEvent):void {

    function drawPgContentBG(shapeX:Number, shapeY:Number, shapeWidth:Number, shapeHeight:Number):void {
   
        pgContentBG = new Sprite();
            pageContent.addChild(pgContentBG);
                pgContentBG.graphics.lineStyle(0, 0xeeeeee, 1);
                pgContentBG.graphics.beginFill(0xffffff, .75);
                pgContentBG.graphics.drawRect(shapeX, shapeY, shapeWidth, shapeHeight);
                pgContentBG.graphics.endFill();
    }
   
   
    /* --------------------------------------------------------------------*/
    /* ----                                                            ----*/
    /* ----  < MOUSE EVENT: LOAD CONTENT BASED ON PAGE NUMBER (XML) >  ----*/
    /* ----                                                            ----*/
    /* --------------------------------------------------------------------*/
    // Set page number variable
    var pageNumber:uint;
   
    mcContent.y = 30; // Why do I need to reset the y position each time?
   
    // Set up if for mouse click
    if (e.type == MouseEvent.CLICK) {
       
        // Switch based on target name
        switch (e.currentTarget.name) {
            case "navBtn0" :
                trace(e.currentTarget.name);
                pageNumber = 1;
               
                mcContent.removeChildAt(0);
               
                mcContent.addChildAt(pageContent,0);
               
                pageContent.addChild(contentRBottomTxt);
                pageContent.addChild(contentRTopTxt);
                pageContent.addChild(contentTxt);
                pageContent.addChild(headingTxt);
               
                break;
               
            case "navBtn1" :
                trace(e.currentTarget.name);
                pageNumber = 2;
               
                mcContent.removeChildAt(0);
               
                mcContent.addChildAt(pageContent,0);
               
                pageContent.addChild(contentRBottomTxt);
                pageContent.addChild(contentRTopTxt);
                pageContent.addChild(contentTxt);
                pageContent.addChild(headingTxt);
               
                break;
               
            case "navBtn2" :
                trace(e.currentTarget.name);
                pageNumber = 3;
               
                mcContent.removeChildAt(0);
               
                mcContent.addChildAt(pageContent,0);
               
                pageContent.addChild(contentRBottomTxt);
                pageContent.addChild(contentRTopTxt);
                pageContent.addChild(contentTxt);
                pageContent.addChild(headingTxt);
               
                break;
               
            case "navBtn3" :
                trace(e.currentTarget.name);
                pageNumber = 4;
               
                mcContent.removeChildAt(0);
               
                mcContent.addChildAt(pageContent,0);
               
                pageContent.addChild(contentRBottomTxt);
                pageContent.addChild(contentRTopTxt);
                pageContent.addChild(contentTxt);
                pageContent.addChild(headingTxt);
               
                break;
               
            case "navBtn4" :
                trace(e.currentTarget.name);
                pageNumber = 5;
               
                mcContent.removeChildAt(0);
               
                mcContent.addChildAt(pageContent,0);
               
                pageContent.addChild(contentRBottomTxt);
                pageContent.addChild(contentRTopTxt);
                pageContent.addChild(contentTxt);
                pageContent.addChild(headingTxt);
               
                break;
               
            case "navBtn5" :
                trace(e.currentTarget.name);
                pageNumber = 6;
               
                mcContent.removeChildAt(0);
               
                mcContent.addChildAt(pageContent,0);
               
                pageContent.addChild(contentRBottomTxt);
                pageContent.addChild(contentRTopTxt);
                pageContent.addChild(contentTxt);
                pageContent.addChild(headingTxt);
               
                break;
               
            case "navBtn6" :
                trace(e.currentTarget.name);
                pageNumber = 7;
               
                mcContent.removeChildAt(0);
               
                mcContent.addChild(swfLoader);
               
                break;
               
            case "navBtn7" :
                trace(e.currentTarget.name);
                pageNumber = 8;
               
                mcContent.removeChildAt(0);
               
                mcContent.addChildAt(pageContent,0);
               
                pageContent.addChild(contentRBottomTxt);
                pageContent.addChild(contentRTopTxt);
                pageContent.addChild(contentTxt);
                pageContent.addChild(headingTxt);
               
                break;
               
            case "navBtn8" :
                trace(e.currentTarget.name);
                pageNumber = 9;
               
                mcContent.removeChildAt(0);
               
                mcContent.addChildAt(pageContent,0);
               
                pageContent.addChild(contentRBottomTxt);
                pageContent.addChild(contentRTopTxt);
                pageContent.addChild(contentTxt);
                pageContent.addChild(headingTxt);
               
                break;
               
            case "navBtn9" :
                trace(e.currentTarget.name);
                pageNumber = 10;
               
                mcContent.removeChildAt(0);
               
                mcContent.addChild(swfLoader);

                break;
        }
       
       
        // Loop through the XML file
        for each (var page:XML in pageXML.pages.page) {
            
            // "page.@pagenumber" points to "pagenumber" in the XML file.
            if (page.@pagenumber == pageNumber) {
                
                // Set the title
                headingTxt.htmlText = page.title;
                
                // Set the page content
                contentTxt.htmlText = page.content;
                contentRTopTxt.htmlText = page.contenttr;
                contentRBottomTxt.htmlText = page.contentbr;
               
               
                /* STYLESHEET NOT FUNCTIONING PROPERLY
                headingTxt.styleSheet = styleSheet;
                contentTxt.styleSheet = styleSheet;
                contentRTopTxt.styleSheet = styleSheet;
                contentRBottomTxt.styleSheet = styleSheet;
                */
                
                // Exit the loop
                break;
            }
        } // < /For Loop >
       
       
        // Have the mcContent tween out
        pageTween = new Tween(mcContent, "x", Regular.easeInOut, 0, stage.stageWidth + 20, .5, true);
        // Add the tween finished event listener to trigger runHomeTransition
        pageTween.addEventListener(TweenEvent.MOTION_FINISH, runPageTransition, false, 0, true);
       
       
       
       
       
   
        /* -------------------------------------------------------------*/
        /* ----                                                     ----*/
        /* ----    < TRACE MCCONTENT CHILDREN AND SUB CHILDREN >    ----*/
        /* ----                                                     ----*/
        /* -------------------------------------------------------------*/
        // Children check, placement seems off... are children added correctly?
        traceDisplayList(mcContent, "=>");
    
        function traceDisplayList(container:DisplayObjectContainer, indentString:String = ""):void {
            var child:DisplayObject;
            
            for (var i:uint=0; i < container.numChildren; i++) {
                child = container.getChildAt(i);
                trace(indentString, child.parent.name + " " + indentString + " " + child.name);
               
                if (container.getChildAt(i) is DisplayObjectContainer) {
                    traceDisplayList(DisplayObjectContainer(child), indentString + "");
                }
            }
        } // < /traceDisplayList();
       
    } // < /If Statement >
} // < /Function >

// Home page function
/*
Facing errors here or in the click event... likely the click event triggering content switch too soon... consider rewriting switch to if and include transition complete to trigger click event, content switch, and then the page's transition in (runPageTransition function)
*/
function runPageTransition (e:TweenEvent):void {
   
    pageTween = new Tween(mcContent, "x", Regular.easeInOut, stage.stageWidth + 20, 0, .5, true);
   
    pageTween.removeEventListener(TweenEvent.MOTION_FINISH, runPageTransition);
}


Below is the xml with the path as: scripts/xml/content.xml

<?xml version="1.0" encoding="utf-8"?>
<site>
       
    <!--<sitetitle><![CDATA[<strong>Transplant the Heart</strong>]]></sitetitle>-->
   
    <pages>

        <page pagenumber="1">
           
            <title><![CDATA[<h1>Page #1</h1>]]></title>
           
            <content><![CDATA[<p>Aliquam nec dui neque. Aenean rutrum suscipit turpis vel fringilla. Nam tortor lacus, sagittis sed pulvinar vitae, facilisis laoreet leo. Suspendisse interdum elit nulla, et tempor eros. Vestibulum rhoncus orci et ante lobortis nec pellentesque purus blandit.</p>]]></content>
           
            <contenttr><![CDATA[Cras non risus nisi. Nam tincidunt lacinia massa, vel interdum massa ultricies ultricies.]]></contenttr>
           
            <contentbr><![CDATA[Aliquam erat volutpat. Etiam eget mauris ante, sit amet placerat tortor. In consectetur consectetur orci.]]></contentbr>
           
            <image>imgs/png/titleLarge.png</image>
           
        </page>

        <page pagenumber="2">
           
            <title><![CDATA[Page #2]]></title>
           
            <content><![CDATA[Cras quis nisl id neque eleifend vehicula quis eget dolor. Proin ante lectus, tincidunt vitae sodales vel.]]></content>
           
            <contenttr><![CDATA[In eget magna diam, non interdum est. Donec aliquam, enim eu gravida vehicula, nulla massa vehicula nibh.]]></contenttr>
           
            <contentbr><![CDATA[Etiam posuere porttitor dignissim. Vestibulum nisi est, pharetra ac feugiat mattis, suscipit eu orci.]]></contentbr>
           
            <image>imgs/png/titleLarge.png</image>
           
        </page>

        <page pagenumber="3">
           
            <title><![CDATA[Page #3]]></title>
           
            <content><![CDATA[Maecenas ac est quis nulla mollis suscipit vulputate quis felis.]]></content>
           
            <contenttr><![CDATA[Sed augue felis, dictum ut suscipit in, pellentesque quis leo. Integer dui sem, accumsan sed iaculis nec.]]></contenttr>
           
            <contentbr><![CDATA[Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.]]></contentbr>
           
            <image>imgs/png/titleLarge.png</image>
           
        </page>

        <page pagenumber="4">
           
            <title><![CDATA[Page #4]]></title>
           
            <content><![CDATA[Vivamus neque turpis, sollicitudin ac consequat vel, faucibus non felis.]]></content>
           
            <contenttr><![CDATA[Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.]]></contenttr>
           
            <contentbr><![CDATA[Vivamus neque turpis, sollicitudin ac consequat vel, faucibus non felis.]]></contentbr>
           
            <image>imgs/png/titleLarge.png</image>
           
        </page>

        <page pagenumber="5">
           
            <title><![CDATA[Page #5]]></title>
           
            <content><![CDATA[Duis interdum justo nec felis semper vel pretium ligula volutpat. In consequat interdum mauris vitae pulvinar.]]></content>
           
            <contenttr><![CDATA[Aliquam ipsum eros, adipiscing ac volutpat eu, dictum id mauris. Vivamus rutrum ultricies metus.]]></contenttr>
           
            <contentbr><![CDATA[Pellentesque porttitor vulputate dui tincidunt scelerisque. Aenean quis orci non massa vulputate hendrerit non eu urna.]]></contentbr>
           
            <image>imgs/png/titleLarge.png</image>
           
        </page>

        <page pagenumber="6">
           
            <title><![CDATA[Page #6]]></title>
           
            <content><![CDATA[Pellentesque porttitor, ante nec ullamcorper vehicula, ante nulla elementum nulla.]]></content>
           
            <contenttr><![CDATA[Nunc eu ipsum ac massa semper ultrices in non leo. Maecenas malesuada enim sed dui sodales molestie.]]></contenttr>
           
            <contentbr><![CDATA[Maecenas at tortor a velit lobortis auctor. Quisque venenatis pellentesque quam non placerat.]]></contentbr>
           
            <image>imgs/png/titleLarge.png</image>
           
        </page>

        <page pagenumber="7">
           
            <title><![CDATA[Page #7]]></title>
           
            <content><![CDATA[Aliquam nec dui neque. Aenean rutrum suscipit turpis vel fringilla. Nam tortor lacus, sagittis sed pulvinar vitae.]]></content>
           
            <contenttr><![CDATA[Praesent sagittis dictum velit, at posuere nisl ultrices a. Maecenas gravida semper porttitor.]]></contenttr>
           
            <contentbr><![CDATA[Vivamus neque turpis, sollicitudin ac consequat vel, faucibus non felis.]]></contentbr>
           
            <image>imgs/png/titleLarge.png</image>
           
            <swfURL>transplantSpecialists.swf</swfURL>
           
        </page>

        <page pagenumber="8">
           
            <title><![CDATA[Page #8]]></title>
           
            <content><![CDATA[Ut interdum, urna ac accumsan sollicitudin, diam ante interdum est, at luctus magna nibh quis purus. ]]></content>
           
            <contenttr><![CDATA[Sed sed enim mauris, et consectetur dolor. ]]></contenttr>
           
            <contentbr><![CDATA[Nullam at quam et justo iaculis sagittis]]></contentbr>
           
            <image>imgs/png/titleLarge.png</image>
           
        </page>

        <page pagenumber="9">
           
            <title><![CDATA[Page #9]]></title>
           
            <content><![CDATA[Ut interdum, urna ac accumsan sollicitudin, diam ante interdum est, at luctus magna nibh quis purus.]]></content>
           
            <contenttr><![CDATA[Donec bibendum sapien iaculis neque volutpat varius. ]]></contenttr>
           
            <contentbr><![CDATA[Vivamus neque turpis, sollicitudin ac consequat vel, faucibus non felis. Nam mattis convallis eros eu tincidunt.]]></contentbr>
           
            <image>imgs/png/titleLarge.png</image>
           
        </page>

        <page pagenumber="10">
           
            <title><![CDATA[Page #10]]></title>
           
            <content><![CDATA[Cras non risus nisi. Nam tincidunt lacinia massa, vel interdum massa ultricies ultricies. Nulla aliquet vehicula purus facilisis posuere. ]]></content>
           
            <contenttr><![CDATA[Integer elementum, dolor fermentum aliquam gravida, eros augue posuere erat, quis gravida neque dui sed enim. Fusce tempus vulputate lobortis.]]></contenttr>
           
            <contentbr><![CDATA[Nunc vulputate elementum lectus, ac vehicula libero faucibus non. Mauris suscipit nibh sit amet enim eleifend sit amet scelerisque sem rutrum. ]]></contentbr>
           
            <image>imgs/png/titleLarge.png</image>
           
            <swfURL>thisSwf.swf</swfURL>
           
        </page>

    </pages>

</site>
This topic has been closed for replies.
Correct answer Andrei1-bKoviI

You don't have swfURL in every node.

You can directly get to swfURL nodes:

pageXML.pages.page.swfURL which will give you an XMLList f urls.

So you can read them:

pageXML.pages.page.swfURL[0]

or via loop.

pageXML.pages.page.swfURL

The same with images:

pageXML.pages.page.image[0], etc.

2 replies

Inspiring
September 18, 2011

1. You should post entire error.

2. These lines will not work with your xml structure:

imgLoader.load(new URLRequest(pageXML.pages.page.image));

swfLoader.load(new URLRequest(pageXML.pages.page.swfURL));

because you supply XMLlist to URLRequest where String is expected (and throw 2044).

This should work:

imgLoader.load(new URLRequest(pageXML.pages.page[0].image));

swfLoader.load(new URLRequest(pageXML.pages.page[0].swfURL));

I did not check all instances of load() you use though.

StoneChameleon
Inspiring
September 18, 2011

Okay, so using the page[0].image / swfURL I now only receive a kickback of one Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

Andrei, Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found. is the entire error I receive.

So, I'm guessing what happens is I'm looping through my xml to find these things, but of course, they don't exist in every section.

Then my question would be, how do you loop through a file to find the text when you need it, images when you need, text & images when needed, and swf files when needed?

Andrei1-bKoviICorrect answer
Inspiring
September 18, 2011

You don't have swfURL in every node.

You can directly get to swfURL nodes:

pageXML.pages.page.swfURL which will give you an XMLList f urls.

So you can read them:

pageXML.pages.page.swfURL[0]

or via loop.

pageXML.pages.page.swfURL

The same with images:

pageXML.pages.page.image[0], etc.

Inspiring
September 18, 2011

I suspect it's coming form either your titleLargeLoader or pageXMLLoader.

Unhandled IOErrorEvent:. text=Error #2035: URL Not Found. Usually indicates that the application is having trouble locating the item it is trying to load (either address/path is invalid or the SWF does not have permission to access it).

try adding these lines

(after: titleLargeLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadTitle); )

titleLargeLoader.addEventListener(IOErrorEvent.IO_ERROR, handleIOError);

(after: pageXMLLoader.addEventListener(Event.COMPLETE, pageXMLLoaded); )

pageXMLLoader.addEventListener(IOErrorEvent.IO_ERROR, handleIOError);

And:

public function handleIOError(e:IOErrorEvent):void

{

     trace("ioErrorHandler: " + e);
}

That should get rid of the 2044 and just kick out the 2035 error.

StoneChameleon
Inspiring
September 18, 2011

It's still throwing that 2044 error. It's strange. My professor says it's trying to access a second frame somewhere, which it shouldn't be. It's built on one frame.

I'm not sure. I think I may have to reattempt rewriting loading in all the content. Something is messed up somewhere and no one is sure where. I get different analysis results from different people, but so far no luck in fixing the issue.

It loads in the titleLarge, but it doesn't load in the swfs from the xml file, but it does load in the text. I've checked and rechecked the spelling and paths, I've changed the location, so forth and so on. It was working one day when I did a test. Then I closed it opened it the next day and here's this error.

kglad
Community Expert
Community Expert
September 18, 2011

you're trying to load a file that flash can't find.  use the trace() function to see which (if you're loading more than one) file path/name is causing the problem.  when you find that you can check your server for an incorrect path/name including case-mismatches.