mikeandike22 18 Nearly a Posting Virtuoso

Ok Right Now I have a preloader that setup that loads the intro. and then a button in the intro loads another movie clip and everything seems fine until I add the actionscrip to load the text and buttons.

here is the error I get
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Bio/::frame1()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Bio/onLoader()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()

and here is the action script in the movieclip that I think is causing the trouble:

//Text Box
var myLoader:URLLoader = new URLLoader();
myLoader.dataFormat = URLLoaderDataFormat.TEXT;
myLoader.load(new URLRequest("text/bio.txt"));
myLoader.addEventListener(Event.COMPLETE, onLoader);

function onLoader(ev:Event){
    contents.htmlText = String(myLoader.data);
}

contents.multiline = true;
contents.wordWrap = true;
//contents.autoSize = TextFieldAutoSize.LEFT;

function upscrolltext(evt:MouseEvent):void{
   trace(contents.scrollV);
   contents.scrollV -= 1;
    }
bscrollup.addEventListener(MouseEvent.CLICK, upscrolltext);

function dwnscrolltext(evt:MouseEvent):void{
   trace(contents.scrollV);
   contents.scrollV += 1;
    }
bscrolldwn.addEventListener(MouseEvent.CLICK, dwnscrolltext);

var bounds:Rectangle = new Rectangle(bscrolldrag.x, bscrolldrag.y,0,160);
var dragging:Boolean = false;

function dragscroll(evt:MouseEvent):void{
    bscrolldrag.startDrag(false,bounds);
    dragging = true;
}

function dropscroll(evt:MouseEvent):void{
    bscrolldrag.stopDrag();
    dragging = false;
}
bscrolldrag.addEventListener(MouseEvent.MOUSE_DOWN, dragscroll );
stage.addEventListener(MouseEvent.MOUSE_UP, dropscroll );

function checkslider(evt:Event):void{
    if(dragging){
        //trace("scroll");
        contents.scrollV = Math.round((bscrolldrag.y - bounds.y)*contents.maxScrollV/160 );
    }
}
stage.addEventListener(Event.ENTER_FRAME, checkslider);

**** FIGURED out that the actions were on frames were those entities didnt exist that was dumb*****


I Found a new problem..I am going from one movieclip to another using this code

biobtn.addEventListener(MouseEvent.CLICK, bio);
function bio(evt:MouseEvent):void{
    gotoAndStop(35);
    var home:MovieClip = new Home();
    var display:MovieClip = new MovieClip();
    display.addChild(home);
    addChild(display);
}

and it gives me a warning of a null object or method which usually from what I can tell means there is an element being referenced in code but is not on the stage at the time. The only thing I cant understand is that it gives me when I first load the movie and not when it gets to where the element would be loaded. Is there a better way I should be linking different flash pages besides putting them into movie clips and telling the btn to goto a blank frame and display a certain movieclip.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.