flash actionscript:
I have added this code to my button that controls a small audio file, my
problem is that when you click play, it starts to play for a quick second, cuts
off and then plays the whole file. I have just added a very small part of the
song as i am still testing the site.
if you wish to see what i mean please click on the below link and then go to
production.
Can i also ask, when you log onto the site, while it is loading a white screen
appears then disapers when loaded!!!
Anyone know why this is, and what can i do to make it go away?
http://www.phuture-elements.com on (release) {
//Load Streaming mp3 behavior
if(_global.Behaviors == null)_global.Behaviors = {};
if(_global.Behaviors.Sound == null)_global.Behaviors.Sound = {};
if(typeof this.createEmptyMovieClip == 'undefined'){
this._parent.createEmptyMovieClip('BS_lost',new
Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.lost = new Sound(this._parent.BS_lost);
} else {
this.createEmptyMovieClip('_lost_',new Date().getTime()-(Math.floor((new
Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.lost = new Sound(this.BS_lost);
}
_global.Behaviors.Sound.lost.loadSound("
http://www.phuture-elements.com/lost.mp 3",true);
}
Now a small preloader problem, i made a preloader and put it onto scene 1,
then once data is loaded it plays from scene 2, frame 1. My issue is that it
seems to add longer for the site to load and also, the preloader does not
imdeiately start playing when you type in the URL and wait. You still get the
small bar from the normal windows loading status, one at bottom right of page,
then 3/4 way through the preloader plays for a quick second then loads the home
page which is correct but most sites in flash immediately play the prelodader
while loading the site.
Here is a small part of my code
//setting up variables to display
//percentage loaded in the text box.
loaded_bytes = Math.round(_root.getBytesLoaded());
loaded_total = Math.round(_root.getBytesTotal());
total_percent = (loaded_bytes/loaded_total)*100;
_root.loaded_text = Math.round(total_percent);
//We apply the code to make the text change its
//X position according to the position of progress
//bar.
startpoint = bar._x
_root.text._x = startpoint + (_root.bar._currentframe*2.5);
i then have the small tween play and
gotoAndPlay("Scene 2", 1);
any ideas on what im doing wrong