FORUMS: list search recent posts

CS3 Actionscript w/ Preloader

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Richard Rodriguez
CS3 Actionscript w/ Preloader
on Mar 28, 2010 at 7:42:49 am

Hello Everyone -

I am needing some help with Actionscript in Flash CS3. Baicly, I am wanting to build a simple draggable map (which I created) with a preloader bar (which I also created) that loads before it.

In my fla file, I have two frames, an "actionscript" layer and an "image" layer, and both operations work perfectly, independent of each other. However, when I test the movie, I get an endless loop between the preloader and my map Movie Clip (not allowing me to click on it).

Here is Frame 1 actionscript:

stop();
this.onEnterFrame = function(){
total = _root.getBytesTotal();
loaded = _root.getBytesLoaded();
percent = int(loaded / total * 100);
percent_txt.text = percent + "%";
preloaderline_mc._width = loaded / total * 400;
if(loaded == total){
_root.gotoAndStop(2);
}
}

Here is Frame 2 actionscript:

map_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragIt);
map_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);

function dragIt(e:MouseEvent):void
{
var bounds:Rectangle = new Rectangle(stage.stageWidth - map_mc.width, stage.stageHeight - map_mc.height, map_mc.width - stage.stageWidth, map_mc.height - stage.stageHeight);
map_mc.startDrag(false, bounds);
}

function dropIt(e:MouseEvent):void
{
map_mc.stopDrag();
}

Flash file download: http://senduit.com/54bfc6


Any help would be greatly appreciated! Thanks!


Return to posts index

Adam Ashby
Re: CS3 Actionscript w/ Preloader
on Mar 29, 2010 at 10:27:58 pm

Did you try putting a stop() on frame 2?

Also, in frame 1, if your script is in the main timeline i don't think you need _root.gotoAndStop(2); Could be gotoAndStop(2); or this.gotoAndStop(2);

Adam Ashby
mutli-media artist
http://www.adamashby.com


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]