I downloaded a great component from http://www.quietlyscheming.com/blog/ and
I am trying to customize it and I am coming across a problem. The example
uses
<mx:XML and if understand that is acompile time tag. I want to load the xml
at runtime so I changed the code. Here is my code and this is the error I
keep getting. Does anyone
know what I am doing wrong?

ERROR
[SWF] /*****/bin-debug/ElginAds.swf - 765,388 bytes after decompression
TypeError: Error #1009: Cannot access a property or method of a null object
reference.
    at qs.controls::FlexBook/fillPage()[C:\Program
Files\Apache\htdocs\*****\src\qs\controls\FlexBook.as:656]
    at qs.controls::FlexBook/commitProperties()[C:\Program
Files\Apache\htdocs\*****\src\qs\controls\FlexBook.as:771]
    at mx.core::UIComponent/validateProperties
()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:5660]
    at mx.managers::LayoutManager/validateProperties
()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\managers\LayoutManager.as:517]
    at mx.managers::LayoutManager/doPhasedInstantiation
()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\managers\LayoutManager.as:637]
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at mx.core::UIComponent/callLaterDispatcher2
()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:8450]
    at mx.core::UIComponent/callLaterDispatcher
()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:8393]




<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; xmlns:l="*"
layout="absolute"
    xmlns:controls="qs.controls.*"
    creationComplete="initApp();" xmlns:containers="qs.containers.*"
xmlns:effects="qs.effects.*"
    width="720" height="430">

    <mx:Style>
        FlexBook {

            color: #000000;
            textRollOverColor:     #000000;

            border-thickness: 0;
            border-style: none;
            page-slope: .6;
            active-grab-area: page;
            page-shadow-strength: 1;
            curve-shadow-strength: 1;
            auto-turn-duration: 1500;
        }

        Application {
            color: #F1F1CC;
            textRollOverColor:     #000;
            backgroundColor: #ffffff;
        }

        SuperImage {
            border-thickness: 0;
            border-style: none;
        }
    </mx:Style>

    <mx:Script>
        <![CDATA[
            //imports
            import qs.caching.ContentCache;
            import qs.controls.flexBookClasses.FlexBookEvent;
            import mx.core.UIComponent;

            //bindable variables
            [Bindable]
            private var dataSet:XMLList;

            //variables
            private var loader:URLLoader;

            private function initApp():void    {
                loader = new URLLoader();
                loader.addEventListener(Event.COMPLETE,onComplete);
                loader.load(new URLRequest('data/images.xml'));
            }
            private function next():void {
                if(book.currentPageIndex+1 < book.pageCount)
                    book.turnToPage(book.currentPageIndex + 1);
            }
            private function previous():void {
                if(book.currentPageIndex > 0)
                    book.turnToPage(book.currentPageIndex -12);
            }

            private function onComplete(e:Event):void {
                var xml:XML = new XML(e.target.data);
                var thumbs:XMLList = [EMAIL PROTECTED];
                dataSet = xml..image;
            }
            private function loadContent(event:FlexBookEvent):void {
                var page:ImagePage = ImagePage(event.renderer);
                page.load();
            }
        ]]>
    </mx:Script>

    <controls:FlexBook id="book" y="47" width="600" top="40" height="400"
horizontalCenter="0"
        animateCurrentPageIndex="true"
        showCornerTease="true"
        edgeAndCornerSize="150"
        itemRenderer="ImagePage"
        content="{dataSet}"
        turnStart="loadContent(event)"
        animatePagesOnTurn="true"
        turnEnd="loadContent(event)"
        />

</mx:Application>


-- 
Thank You
Dan Vega
[EMAIL PROTECTED]
http://www.danvega.org

Reply via email to