Load All Before Start?
hi guys!
im sure this is an easy question, but how do a make a movie go to frame 2 and play only when it has compleated downloading the total file size
thanks
FlashKit > Flash Help > Flash ActionScript
Posted on: 08-23-2006, 12:35 AM
View Complete Forum Thread with Replies
Sponsored Links:
A Few Seconds Between Load Call And Load Start, Why?
hello people. I know that when you make a loadmovie call, the preload isnt immediate. You could be waiting miliseconds or seconds till flash starts receiving data.
I know this is a network issue. And this waiting time depends on your connection and the server aswell. But, do you know of any technical articles that explains this issue a bit better?
This is because i have to answer a client that wants to know why his sounds (the ones im calling with loadmovie) dont start preloading immediatelly.
Thanks for any help
View Replies !
View Related
How To Tell When The Load To Start
Hi,
don't even know where to look for the answer, so I apologize if this topic was already opened. Here's my case. In main flash movie load another flash movie, where different items come from left and right side of the screen (full screen window). After a click on one item, all the item go the sam eway off the screen and another movie loads. Question. How to tell the flash that first all the items must go off the screen and then unload that movie and load the new one?
THX for the help
View Replies !
View Related
30k Load At Start Of Movie
I have a strange 30kb frame at the start of my movie. There are no images embedded on that frame that I can see and I have not embedded any fonts or anything, I am completely stuck as to why this exists
I am using Flash MX, if you could take a look and offer any advice I would really appreciate it.
You can download the FLA at:
http://www.dtcinemas.co.nz/images/ad...ixReloaded.fla
View Replies !
View Related
Load 5 MCs At Start Of Movie
I have been working on this problem all day and have gone no where. I need to make 5 duplicates of the same moviclip "worldMap" and move each of them to a different point (frame) along their timelines. I can't even get one of the MC's up on the stage. This is one of the scripts that I have been working on.
stop();
for(i = 1; i < 6; i++) {
newMC = "worldMap" + i;
_root.duplicateMovieClip("worldMap", newMC,i);
trace("newMC = " + newMC);
trace("i = " + i);
}
View Replies !
View Related
Load Swf _root At Start
the answer to this question is probley already on here, but there are alot of posts ! LOL
any way, i have no problem loading external swf's from buttons
but for the life of me i cant get a external swf to load when
the main swf starts up
eg i have a site.swf file embedded in in a html doc.
and when i go to www.whatever.com and the site.swf file loads
i want it to load content.swf into a empty movie clip ive called
window.
ive tried
on the mc itself, loadmovie, and on the frame window
onload loadmovie window.swf _root.window
no luck
could one of you flash experts out there, give a fulla a hand?
would be great !
thanks
View Replies !
View Related
[F8] Why Does My Load Function Start At 30% ?
I have a preloader I have created from the Flash help files
http://livedocs.adobe.com/flash/8/main/00002461.html
Mine looks like this:
Frame 1
Code:
#include "generic.as"
#include "filters.as"
Frame 2
Code:
var pctLoaded:Number = Math.round(this.getBytesLoaded()/this.getBytesTotal()*100);
loading_txt.text = "Waiting for your luggage: "+pctLoaded+" % Loaded";
Frame 3
Code:
if (this._framesloaded<this._totalframes) {
this.gotoAndPlay(2);
} else {
this.gotoAndPlay(5);
}
And there are no graphics untill Frame 5 other that a dynamic text field.
Why is the loading not showing until the movie has loaded 30%?
What am I missing? have tried both "Load top down/bottom up" no difference
View Replies !
View Related
Start On Sound On Load
I have this script that loads a audio file but only starts it after hitting the play button. What do I need to add to this script in order for this to start when the movie loads?
ActionScript Code:
//----CODED BY CRAIG CAMPBELL AT SCHOOL OF FLASH--------//
//-------- [url]http://www.schoolofflash.com----------//[/url]
var music:Sound = new Sound(new URLRequest("walk.mp3"));
var sc:SoundChannel;
var isPlaying:Boolean = false;
var pos:Number = 0;
var soundVolume:Number = 1;
var muted:Boolean = false;
mute_mc.buttonMode = true;
volume_mc.slider_mc.buttonMode = true;
pause_btn.addEventListener(MouseEvent.CLICK, pauseMusic);
function pauseMusic(e:Event):void
{
if (isPlaying)
{
pos = sc.position;
sc.stop();
isPlaying = false;
}
}
stop_btn.addEventListener(MouseEvent.CLICK, stopMusic);
function stopMusic(e:Event):void
{
if(sc != null)
{
sc.stop();
pos = 0;
isPlaying = false;
}
}
play_btn.addEventListener(MouseEvent.CLICK, playMusic);
function playMusic(e:Event):void
{
if (!isPlaying)
{
sc = music.play(pos);
isPlaying = true;
}
}
//---VOLUME SLIDER---//
var dragging:Boolean = false;
var rectangle:Rectangle = new Rectangle(0,0,100,0);
volume_mc.slider_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragIt);
stage.addEventListener(MouseEvent.MOUSE_UP, dropIt);
function dragIt(e:Event):void
{
volume_mc.slider_mc.startDrag(false,rectangle);
dragging = true;
volume_mc.slider_mc.addEventListener(Event.ENTER_FRAME, adjustVolume);
}
function dropIt(e:Event):void
{
if (dragging)
{
volume_mc.slider_mc.stopDrag();
volume_mc.slider_mc.removeEventListener(Event.ENTER_FRAME, adjustVolume);
dragging = false;
}
}
function adjustVolume(e:Event):void
{
mute_mc.gotoAndPlay("On");
soundVolume = volume_mc.slider_mc.x / 100;
var st:SoundTransform = new SoundTransform(soundVolume);
if (sc != null)
{
sc.soundTransform = st;
muted = false;
}
}
mute_mc.addEventListener(MouseEvent.CLICK, mute);
function mute(e:MouseEvent):void
{
if (sc != null)
{
var st:SoundTransform;
if (muted)
{
st = new SoundTransform(soundVolume);
sc.soundTransform = st;
mute_mc.gotoAndStop("On");
muted = false;
}
else
{
st = new SoundTransform(0);
sc.soundTransform = st;
mute_mc.gotoAndStop("Mute");
muted = true;
}
}
}
View Replies !
View Related
Can't Get Start Up Movie To Load
Hi I'm building a flash website based around severval different movies which load into a base movie. I got all the individual movies working but I can't get the base movie to load the first one in at the start. I put the load movie on an onEnterFrame, am I doing something fundamentally wrong here:
stop();
onEnterFrame = function() {
_root.createEmptyMovieClip("container", 1);
loadMovie("home.swf", "container");
container._x = 0;
container._y = 0;
};
View Replies !
View Related
Getting Swf To Load At Start Of Movie?
Hey all,
I'm trying to figure out how I can load a swf at the start of this movie and still retain the ability to click on the buttons and load a new one. I'm sure this is probably something simple I'm missing.
At the moment I can get it to load but then after a second click on the other buttons I get an error:
"Error #2025: The supplied DisplayObject must be a child of the caller."
Files:
http://www.zoost.ie/case-studies.zip
Here's my code:
Code:
import fl.transitions.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
import fl.controls.ProgressBar;
//loader stuff//
//Assign CLICK listeners for each menu button
home_mc.addEventListener (MouseEvent.CLICK, buttonClicked);
work_mc.addEventListener (MouseEvent.CLICK, buttonClicked);
experience_mc.addEventListener (MouseEvent.CLICK, buttonClicked);
//Make the buttons look like buttons (hand cursor appears on hover)
home_mc.buttonMode = true;
work_mc.buttonMode = true;
experience_mc.buttonMode = true;
//This loader is used to load the external swf files
var loader:Loader;
//URLRequest stores the path to the file to be loaded
var urlRequest:URLRequest;
//This array holds all the tweens, so they
//don't get garbage collected
var tweens:Array = new Array();
//Stores the current page we are displaying
var currentPage:*;
//Stores the next page that we are going to display
var nextPage:*;
urlRequest = new URLRequest("case-studies-new.swf");
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, fileIn);
function fileIn(e:Event):void {
trace("Complete");
}
loader.load (urlRequest);
addChild(loader);
//This function is called when a menu button is clicked
function buttonClicked (e:Event):void {
/*removeChild(loader);
//Create a new loader instance
loader = new Loader();*/
if (e.target == home_mc) {
urlRequest = new URLRequest("http://www.zoost.ie/lgwxhtml/lgw3.html");
navigateToURL(urlRequest, "_self");
}
else if (e.target == experience_mc) {
urlRequest = new URLRequest("experience.swf");
loader.load (urlRequest);
gotoAndPlay("experience");
}
else if (e.target == work_mc) {
urlRequest = new URLRequest("case-studies-new.swf");
loader.load (urlRequest);
gotoAndPlay("case_studies");
}
//We want to know when the next page is finished loading
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, fileLoaded);
}
//This function is called, when we have finished loading a content page
function fileLoaded(e:Event):void {
//The loader contains the page we are going to display.
nextPage = e.target.content;
//Let's animate the current page away from the stage.
//First, we need to make sure there is a current page on the stage.
if(currentPage != null) {
//Tween the current page from bottom
var tweenY:Tween = new Tween(currentPage, "y", Regular.easeIn,
currentPage.y, 200, 1, true);
//Decrease the alpha to zero
var tweenAlpha:Tween = new Tween(currentPage, "alpha", Regular.easeIn,
1, 0, .5, true);
//Push the tweens into an array
tweens.push(tweenY);
tweens.push(tweenAlpha);
//currentPageGone will be called when the tween is finished
tweenY.addEventListener(TweenEvent.MOTION_FINISH, currentPageGone);
}
//There is no current page, so we can animate the next
//page to the stage. The animation is done in
//the showNextPage function.
else {
showNextPage();
}
}
//This function animates and displayes the next page
function showNextPage():void {
//Tween the next page from left to the center
var tweenY:Tween = new Tween(nextPage, "y", Regular.easeOut,
100, 80, 2, true);
//Tween the alpha to from 0 to 1
var tweenAlpha:Tween = new Tween(nextPage, "alpha", Regular.easeOut,
0, 1, .5, true);
//Push the tweens into an array
tweens.push(tweenY);
tweens.push(tweenAlpha);
//Add the next page to the stage
addChild(nextPage);
//Next page is now our current page
currentPage = nextPage;
}
//This function is called when the current page has been animated away
function currentPageGone(e:Event):void {
//Remove the current page completely
removeChild(currentPage);
//Let's show the next page
showNextPage();
}
I'm really stuck on this
View Replies !
View Related
IS It Possible To Load Gif Files Into Objects On Start?
Hey,
Im working on a project for a ditribution company. I would like to create a banner with animated objects. Here is the tricky part. I want each object to load a random gif file into itself at load. I have a folder of 1000 gif files. Each file is a indivigual product. I have created an banner that animates 12 different objects. I want it to use diffetrent pictures each time the swf is loaded. Im not sure if this can be done. If you konw a way to do this or with some kind of database please let me know.
Thanks,
Bryan Gauvin
View Replies !
View Related
Load 5 Movieclips On Start Of Movie
Hi all,
I have been working on this problem all day and have gone no where. I need to make 5 duplicates of the same moviclip "worldMap" and move each of them to a different point (frame) along their timelines.
I can't even get one of the MC's up on the stage. This is one of the scripts that I have been working on.
stop();
for(i = 1; i < 6; i++) {
newMC = "worldMap" + i;
_root.duplicateMovieClip("worldMap", newMC,i);
trace("newMC = " + newMC);
trace("i = " + i);
}
Thanks
Graham
View Replies !
View Related
Help Please... Load Movie But Sound Won't Start
Hi all,
I've read through Kenny Bellew's tutorial (See here ) and it's SO useful that helps me created a sync flash movie very precisely. However, I have encountered an issue but can't find any answer.
Let's say I have a BASE movie (BASE.swf), which is to LOAD another movie on top to play a background music ("BGM_Loop.swf") - because I need a non-stop BGM. I load that BGM movie to level 100.
To avoid confusion, the BGM is loaded into a frame directly without using any ActionScript in the BGM_Loop.swf. In the BASE.swf the code is -
"loadMovieNum("BGM_Loop.swf", 100);"
on frame #1 of it.
Then, from the BASE.swf movie, I need to load a third movie ("audios.swf") which has 10 audio files with 10 scenes.
I've loaded it into level #1 on frame #10 of "BASE.swf".
The code is -
loadMovieNum("audios.swf", 1);
This "audios.swf" movie has 10 pieces of audio which are using the ActionScript code in the tutorial to sync with the animation. here's a sample one:
myMusic = new Sound();
myMusic.attachSound("audio1");
myMusicVolume = 100;
myMusic.setVolume(myMusicVolume);
myMusic.start(0, 1);
playing = true;
All 10 audio files which linkage are set well and I changed the code above from "audio1" to "audio10" in every scene.
The problem now is, after published, the BGM ("BGM_Loop.swf") is playing very well, but the audio ("audios.swf") is not started at all.
If I played the "audios.swf" file individually, all 10 audio played very well, when it loads into this BASE.swf with the "BGM_Loop.swf movie, the 10 audio stopped.
Apparently there is a LEVEL issue which is similar to the "_root." concept in Kenny Bellew's tutorial, but I just can't figure out how.
If anybody has any idea, really appreciate!
View Replies !
View Related
How To Load A Ekstern Swf, But It Shall Not Start At Frame 1
I have a big project, with a lot of moviess. Now I have to jump to another movie, where I have made som frame labels with a stop action.
My problem is that I can make it jump to the new movie, if I use this code below, but then it starts at frame 1. How do I make it start fx in frame 10 ?
Code:
on (release) {
loadMovieNum("mbi3_vestjylland.swf", 1);
}
I dont know how to make it jump to a scene fx. at frame 10
I have tried to use this code, but it dos´nt work (I have placed a label called lemvig2 and I want the movie to start there and not in frame 1
Code:
gotoAndPlay("vestjylland", "lemvig2");
So my problem is, how to jump to a new movie and start fx in frame 10 ??
View Replies !
View Related
Get A Button To Load & Start A Movieclip
Hi, This may be basic, but... this is my first venture with actionscript. (FlashMX 2004)
I'm developing a flash app where the user plots points on the canvas, then clicks a button, which draws a tessellation based on the points, and stops drawing when the lines hit something other than the background. The user putting the points on the canvas is no problem, BUT, I can't get the button to start the movie clip ehich draws the tessellation (actually, just three lines radiating from a point to start with) All Ive managed to get a button to do is the following:
on(release) {
getUrl("http://www.edwardian-kitchen.co.uk");
}
which duly goes there.
Ideally I'd like to add other buttons to allow several layers of tessellations to be entered, and viewed separately, or overlaid on one another.
all help gratefully received
here's the Doughnuts, sorry I can't do the coffee or cola!
View Replies !
View Related
Load Movie And Start At Frame 10
I have a movie with 7 buttons. I would like my "home" button to go to the index1 page and start at frame 10. However, I don't know enough about action codes to know what to do next. I used behaviors to write the code below. This will get me to the index1 page however, it starts at frame 1. This is were i placed the loading bar. How can I start at another frame?
on (release) {
//load Movie Behavior
if(this == Number(this)){
loadMovieNum("index1.swf" ,this);
} else {
this.loadMovie("index1.swf");
}
//End Behavior
}
Thanks everyone.
View Replies !
View Related
Load Movie Clips On Swf Start...
Hello. I'm still using Flash MX, and I'm trying to do something very simple but I can't seem to locate the function.
I want to have an swf that loads up only movie clips when it starts. I'll have about 6 objects on different levels. But I want the entire screen to be movie clips only. What's the name of the event handler/function that kicks off when an swf starts?
Thanks!
View Replies !
View Related
Question About Load Image From Xml On Start
Hi I have been trying to make a xml gallery with reference from the link below, I could get everything to work just as fine but I would like to input something like,
on start or enterframe,
it loads the first image too when it is loading thumbnails and others too. so it will show the first image and the thumbnails to scroll when i start the file.
Sample: http://www.noponies.com/dev/simplegallery/
Source: http://www.blog.noponies.com/wp-cont...allery_v3a.zip
i would love help over this. i'm not great in actionscript but sincere thanks in advance!
View Replies !
View Related
Problem Getting Swf To Load At Start Of Movie?
Hey there,
I'm trying to figure out how I can load a swf at the start of this movie while still retaining the ability of clicking my buttons and loading multiple movies.
Any help would be really great?!
Here's what I'm thinking I need to do but it's not working. I wonder is there an "on start of movie" event?! ENTER_FRAME maybe?
Code:
function atStart (e:Event):void {
if(currentPage == null) {
e.target == galleries_mc;
urlRequest = new URLRequest("case-studies-new.swf");
loader.load (urlRequest);
nextPage = e.target.content;
var tweenY:Tween = new Tween(nextPage, "y", Regular.easeOut,
100, 80, 2, true);
//Tween the alpha to from 0 to 1
var tweenAlpha:Tween = new Tween(nextPage, "alpha", Regular.easeOut,
0, 1, .5, true);
//Push the tweens into an array
tweens.push(tweenY);
tweens.push(tweenAlpha);
//Add the next page to the stage
addChild(nextPage);
//target_mc.addChild(nextPage);
//Next page is now our current page
currentPage = nextPage;
}
}
View Replies !
View Related
Delay Start Of Movie Load
Hey folks,
here's my situation:
I've got a site i'm working on that is heavy on the graphics, that also has a fairly large flash movie loading up in the body (and I am well aware of the adverse effects of building a site like this, however it HAS to be this way).
Is there a way I can pause the loading of the movie for say 10 to 20 seconds so the graphics on the page have time to load up first?
Thanks!
View Replies !
View Related
FLV: Start Load When User Clicks Play?
Hello,
It would be nice if anybody could give me a little help on this subject.
How would I tell Flash to not to load the FLV unless the user clicks on the play button? An example would be on YouTube site. I want the movie to only start loading/progressive streaming if the play button is clicked by the user.
And which code should I use?:
Code:
var listenerObject:Object = new Object();
listenerObject.ready = function(eventObject:Object):Void {
myFlvPlayback.play();
};
myFlvPlayback.addEventListener("ready", listenerObject);
myFlvPlayback.contentPath = "myvideo.flv";
And this one:
Code:
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
my_video.attachVideo(stream_ns);
stream_ns.play("myvideo.flv");
I already have my own custom skin setup for the first code, so it would be awesome if I can figure out how to work it out with that one. Please help!
Thanks in advance.
View Replies !
View Related
Load Random Mc, Mc Doesn't Start In The Beginning
I'm having a problem with a little banner where i want 3 mc to load in randomly. I think I managed the random part. Now when i play my banner, the movieclips dos not start at the first frame of that mc... I don't know how to get this worked...
Here is my code so far:
// import the classes needed for the tweens
import fl.transitions.Tween;
import fl.transitions.easing.None;
import fl.transitions.TweenEvent;
stage.scaleMode = StageScaleMode.NO_SCALE; // set the stage scale to 'noScale'
stage.align = StageAlign.TOP_LEFT; // align the stage to TOP_LEFT
stage.showDefaultContextMenu = false; // hide the default context menu
var fadeAnimation:Tween; // Tween instance
var fadeSpeed:Number = .10; // set the fade speeds
var timerDelay:Number = 2700; // set the the timer delay
// create an instance for each quotation ( move clip )
var instanceMc1:MovieClip = new mc1();
var instanceMc2:MovieClip = new mc2();
var instanceMc3:MovieClip = new mc3();
// a container that will hold your quotations
var container:Sprite = new Sprite();
// hold all your quotations ( movie clips ) in an array
var mcArray:Array = [instanceMc1, instanceMc2, instanceMc3];
var customTimer:Timer = new Timer(timerDelay); // create a Timer instance
var rMcHolder:Number; // hold rMc in a variable
// create a new array that has the same values as mcArray
var newArray:Array = mcArray.slice();
// onTimer function ( called when tween ends )
function onTimer(event:TimerEvent):void
{
fadeOutAnimation(); // call the fadeOutAnimation function
customTimer.removeEventListener(TimerEvent.TIMER, onTimer); // remove the listener
} // end of onTimer
// the main function that call everything else
function init():void
{
// if mcArray is empty...
if (mcArray.length == 0)
{
mcArray = newArray.slice(); // asign newArray to mcArray
getRandomQuotation(); // call the getRandomQuotation function
}
// ...if it's not then get a random movie clip
else
{
getRandomQuotation(); // call the getRandomQuotation function
}
} // end of init
function getRandomQuotation():void
{
// pick a random movie clip from mcArray
var rMc:Number = Math.floor(Math.random() * mcArray.length);
container = mcArray[rMc]; // add the movie clip to the container
mcArray.splice(rMc, 1); // remove the movie clip from the array
addChild(container); // add the container to the stage
fadeInAnimation(); // call the fadeInAnimation function
// center the container
container.x = Math.round(stage.stageWidth / 0 - container.width / 1);
container.y = Math.round(stage.stageHeight / 1 - container.height / 0);
} // end of getRandomQuotation
function fadeInAnimation():void
{
// fade in the container
fadeAnimation = new Tween(container, "alpha", None.easeNone, 0, 1, fadeSpeed, true);
// listen for MOTION_FINISH, once the fade finishes call onFadeInFinish
fadeAnimation.addEventListener(TweenEvent.MOTION_F INISH, onFadeInFinish);
} // end of fadeInAnimation
function fadeOutAnimation():void
{
// fade out the container
fadeAnimation = new Tween(container, "alpha", None.easeNone, 1, 0, fadeSpeed, true);
// listen for MOTION_FINISH, once the fade finishes call onFadeOutFinish
fadeAnimation.addEventListener(TweenEvent.MOTION_F INISH, onFadeOutFinish);
} // end of fadeOutAnimation
function onFadeInFinish(event:TweenEvent):void
{
customTimer.addEventListener(TimerEvent.TIMER, onTimer); // add a TIMER listener
customTimer.start(); // start the customTimer
// remove the fadeAnimation listener
fadeAnimation.removeEventListener(TweenEvent.MOTIO N_FINISH, onFadeInFinish);
} // end of onFadeInFinish
function onFadeOutFinish(event:TweenEvent):void
{
// remove the fadeAnimation listener
fadeAnimation.removeEventListener(TweenEvent.MOTIO N_FINISH, onFadeOutFinish);
init(); // call the main function
} // end of onFadeOutFinish
stage.addEventListener(Event.RESIZE, onStageResize); // listen for stage RESIZE
function onStageResize(event:Event):void
{
// center the container
container.x = Math.round(stage.stageWidth / 2 - container.width / 2);
container.y = Math.round(stage.stageHeight / 2 - container.height / 2);
} // end of onStageResize
init(); // call the main function
View Replies !
View Related
Start Playing Swf In Empty MC Before Load Complete
Hello everyone, I am working on a movie that loads a SWF into an empty MC when it reaches a certain frame in the timeline. Everything works great; however, the file is large and I would like the swf to begin playing after 25% of it has loaded. The code I am using to load the SWF is below.
stop();
load = loader2_mc.loadMovie("ImageGallery1.swf");
I'm sure that this is probably easy but for some reason I can't figure it out. Any help would be greatly appreciated!
Thanks!
View Replies !
View Related
Load External Mp3 And Start Playing On A Certain Frame
I am trying to load an external mp3 and have it start playing on frame 430 of my movie. The code I've tried either starts playing the mp3 right away or not at all. Here is what I'm working with:
onClipEvent (load) {
// sets up a sound object
faTrack = new Sound();
// load the external sound
faTrack.loadSound("intro.mp3", true);
// play the sound
faTrack.start(430);
}
After using this code it started the movie right after the sound was loaded. What is the proper method to make this work?
View Replies !
View Related
I Would Like The Audio Player Not To Automatically Start On Load...
hi, i am trying to alter this audio player found at
http://www.pixel2life.com/twodded/t_create_a_full_streaming_flash_mp3_player_using_xml_part_iii/page8/
i would like to know what i need to change in the actionscript to the following:
1- i would like to stop this audio player from automatically starting on load.
2- to start on track 1, no repeat with auto start.
here is the actionscript:
stop();
title_txt.autoSize = "left";
timeDisplay_txt.autoSize = "left";
toolTip._visible = false;
var amountLoaded:Number;
var duration:Number;
playlist = new XML();
playlist.ignoreWhite = true;
playlist.onLoad = function(success) {
if (success) {
_global.songname = [];
_global.songband = [];
_global.songfile = [];
for (var i = 0; i<playlist.firstChild.childNodes.length; i++) {
_global.songname[i] = playlist.firstChild.childNodes[i].attributes.name;
_global.songband[i] = playlist.firstChild.childNodes[i].attributes.band;
_global.songfile[i] = playlist.firstChild.childNodes[i].attributes.file;
attachMovie("butTemp","but"+i,i+50);
eval("but"+i).id=i;
_root["but"+i]._x = 5;
_root["but"+i]._y = 40 + (i*15);
_root["but"+i].but_txt.text = songname[i];
if (i >= 4){ // adjust for how many list per left menu
_root["but"+i]._x = 160
_root["but"+i]._y = -20 + (i*15); // adjust -20 to align right table list
}
_root["but"+i].onRelease = function(){
clearInterval(timeInterval);
_root.timeDisplay_txt.text = "00:00/00:00";
_root.sound_mc.songStarter(songfile[this.id]);
}
}
}
_root.createEmptyMovieClip("sound_mc", 1);
_global.song_nr = random(songfile.length);
_root.sound_mc.songStarter(songfile[song_nr]);
};
function timer(sound_obj) {
time = sound_obj.position/1000;
min = Math.floor(time/60);
min = (min<10) ? "0"+min : min;
sec = Math.floor(time%60);
sec = (sec<10) ? "0"+sec : sec;
timeDisplay_txt.text = min+":"+sec+"/"+totalDuration;
}
function duration (){
timed = _root.sound_mc.sound_obj.duration/1000;
mind = Math.floor(timed/60);
mind = (mind<10) ? "0"+mind : mind;
secd = Math.floor(timed%60);
secd = (secd<10) ? "0"+secd : secd;
totalDuration = mind+":"+secd;
}
MovieClip.prototype.songStarter = function(file) {
if (this.sound_obj) {
this.sound_obj.stop();
delete this.sound_obj;
}
this.sound_obj = new Sound(this);
this.sound_obj.loadSound(file, true);
this.sound_obj.setVolume(0);
this.onEnterFrame = function() {
if (this.sound_obj.position>0) {
delete this.onEnterFrame;
timeInterval = setInterval(timer, 1000, this.sound_obj);
track = this.sound_obj.id3.songname;
artist = this.sound_obj.id3.artist;
this._parent.title_txt.text =artist+" - "+track;
} else {
this._parent.title_txt.text = "loading...";
}
};
this.sound_obj.onSoundComplete = function() {
clearInterval(timeInterval);
_root.timeDisplay_txt.text = "00:00/00:00";
(song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
_root.sound_mc.songStarter(songfile[song_nr]);
};
this._parent.volume1.dragger.onPress = function() {
startDrag(this, true, 0, this._y, this._parent.volBG._width, this._y);
_root.toolTip._visible = true;
setInterval(draggableTip,100);
function draggableTip(){
_root.toolTip._x = _root._xmouse;
}
this.onEnterFrame = function() {
var p = (this._x/this._parent.volBG._width)*100;
this._parent._parent.sound_mc.sound_obj.setVolume(p);
};
};
this._parent.volume1.dragger.onRelease = function() {
delete this.onEnterFrame;
stopDrag();
};
this._parent.volume1.dragger.onReleaseOutside = function() {
_root.toolTip._visible = false;
stopDrag();
};
};
function soundStatus(){
var amountLoaded = _root.sound_mc.sound_obj.getBytesLoaded() / _root.sound_mc.sound_obj.getBytesTotal();
_root.loader.loadBar._width = amountLoaded * 187;
duration = _root.sound_mc.sound_obj.duration;
position = _root.sound_mc.sound_obj.position;
_root.playHead._x = position / duration * 196 + 109;
}
btn_play.onRelease = function() {
clearInterval(timeInterval);
_root.timeDisplay_txt.text = "00:00/00:00";
this._parent.sound_mc.songStarter(songfile[song_nr]);
};
btn_stop.onRelease = function() {
clearInterval(timeInterval);
_root.timeDisplay_txt.text = "00:00/00:00";
this._parent.sound_mc.sound_obj.stop();
};
btn_fw.onRelease = function() {
clearInterval(timeInterval);
_root.timeDisplay_txt.text = "00:00/00:00";
(song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
_root.sound_mc.songStarter(songfile[song_nr]);
};
btn_rev.onRelease = function() {
clearInterval(timeInterval);
_root.timeDisplay_txt.text = "00:00/00:00";
(song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;
_root.sound_mc.songStarter(songfile[song_nr]);
};
playlist.load("playlist.xml");
setInterval(duration,100);
setInterval(soundStatus,100);
View Replies !
View Related
Scrolling Navigation Needs To Unload Sections And Load Up The Main Start
Hi,
I've got a scrolling menu on the left side of my swf. It gets loaded from the a swf underneath.
On the top banner I have 4 buttons.
The first is just a link, but the other three navigate into the main.swf that loads on the second level.
For some reason when I'm going through the site from the top menu and I want themain swf to come back I click on the scrolling nav to go back to the main start.
But the weird thing is that you have to jump through the timeline in order to get back to the start.
I attached the following so that you could look at what I'm talking about.
http://www.webinkgraphics.com/root/test/Brandon.zip
Thanks
View Replies !
View Related
Start And Stop Streaming Sounds (start Stopping Currently Playing)
Hi there
I am novice user of flash and have no real AS experience.
What I want to do is..
I have 18 songs from an album and have taken 30 sec from each and down sampled them ready for flash.
I want to be able preview them all from one flash file.
I will be streaming the songs in, so the initial download time is minimal.
With 18 start stop buttons for each one, but because customers are lazy, they are likely just going to click the next play button for the next preview, so I need the play buttons to stop 'this' preview before playing the next with stop control also being a stop control for those who have had enough or are well behaved browsers : )
I hope this makes sense and look forward to hearing from someone.
Cheers
Ian Hill
View Replies !
View Related
Start And Stop Streaming Sounds (start Stopping Currently Playing)
Hi there
I am novice user of flash and have no real AS experience.
What I want to do is..
I have 18 songs from an album and have taken 30 sec from each and down sampled them ready for flash.
I want to be able preview them all from one flash file.
I will be streaming the songs in, so the initial download time is minimal.
With 18 start stop buttons for each one, but because customers are lazy, they are likely just going to click the next play button for the next preview, so I need the play buttons to stop 'this' preview before playing the next with stop control also being a stop control for those who have had enough or are well behaved browsers : )
I hope this makes sense and look forward to hearing from someone.
Cheers
Ian Hill
View Replies !
View Related
How To Delay The Start Of External Swf(start From Say 10th Frame)
I am using the following code to load an external swf.Now I need to start the playing of the swf movie not from frame 1 but from say 10th frame.
Please help
Code:
var myMcl:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes, totalBytes) {
//swfToLoad._visible = false;
loadedPercent = Math.floor((loadedBytes/totalBytes)*100);
_root.bar_mc._xscale = loadedPercent;
//trace(bar_mc._xscale);
c.text = loadedPercent+"%";
//trace(loadAnim.percLoaded.text);
spacer.loadMovie("images/loadingss.jpg");
};
myListener.onLoadComplete = function(targetMC:MovieClip) {
swfToLoad._visible = true;
loadAnim._visible = false;
//swfToLoad._width=367;
//swfToLoad._height=255;
}
myMcl.addListener(myListener);
myMcl.loadClip("Jason_500.swf",swfToLoad);
View Replies !
View Related
FLV Start Time? Can I Start It Playing 2 Secs In?
Is there a way with actionscript to tell an FLV to start playing 2 seconds into the video. What I have is an FLV that has 2 seconds of black at the beginning, but I don't want that to play.
Or if anyone knows a way to re-encode an flv so that I can get rid of the 1st 2 seconds. I've tried re-encoding it with Riva Encoder but it just gets all screwed up. And the Flash encoder won't even let me add it to the que. Any help would be appreciated.
Thanks,
Lady
View Replies !
View Related
Random Sound Load And Start Is Speeding Up The Sound. Any Help?
Hello,
My first post here at Kirupa. I thought I'd give it a try.
I'm trying to load sound dynamically into a clip and then play it randomly. The AS I came up with works great if the sound is embedded and I use the .attachSound() method instead of loadSound(). Now, when I load it dynamically and use the code below, the sound plays very fast and at a higher pitch.
I'm new to AS. Any help or insight into the issue would be much appreciated!
Thanks everyone!
ActionScript Code:
var crows = new Sound(this); crows.loadSound("Raven.mp3", false); crows.setVolume(100);rNum = function(){ var i = 0; var randNum = Math.round(Math.random()*500); if (i>=randNum) { crows.start(0, 1); }};randSound = setInterval(rNum, 100);
View Replies !
View Related
Sound Start Doesn't Start
I've been experiencing this problem. Sound.start() doesn't always start. A lot of times, it does, sometimes, it doesn't start for me. Sometimes it happens even after sound load has just finished. Has anyone experienced the same? any suggestions?
Edited: 08/24/2007 at 01:26:57 AM by nehcdet
View Replies !
View Related
To Start Again, Or Not To Start Again, That Is The Question
help!
I know I'm a dumbass, no need to rub it in. Guess who just learned what a smart clip is. now here's the issue:
http://www.7inone.info/test4/
everything on this site that SHOULD be a smart clip, ISN'T. Every single button and movie clip and movie clip holder has been scripted individually. And now, this far along, I realize that the smarter thing to do would have been to use smart clips. So do you think I should start over, and do it right? or should I just leave it, and learn from my mistake for future work. I would love to start again and get it perfect, but the reality of the matter is that the boss want's the site ready to go - and SOON.
any additional comments on over all design, etc. would be appricated.
thanks guys
sid.
View Replies !
View Related
Immediate Start Instead Of Clic Start
I have a fla-file which almost is just perfect for my needs. The only thing I need to change is :
on (release, keyPress "<Enter>") {
gotoAndPlay ("start");
}
I would like the movie to start immediately instead of after the visitor clicking a key. No need for saying that I am totally new to flash, is there.
Roger
View Replies !
View Related
How To Start And Do Nothing
I have made it through the tutorials and now am trying to create my first flash movie. I don't want it to go from frame to frame. I want it to go the first frame and then stop. Then I am going to build some buttons for frame navigations.
My buttons are on one layer, the different frames I want to navigate to are on layer 2. 5 frames, 5 different pictures.
How do I stop the movie from just shooting from frame 1 to frame 5. I just see all 5 frames flash by when I play the movie.
Thanks,
Peace
View Replies !
View Related
Where To Start
If all you knew about FLASH is how to spell it, where would you start? What software must you have. Is there any freeware that one can use to learn?
I am older, and not wealthy. Thanks
View Replies !
View Related
Its Just A Start So Lz Help
well,im working on a construction site and they need a flash verison,so my question is how do i make a site simply like 2advanced projects,like loading the middle part from my movie from an external swf file,and load it in the middle and if i choosed another link another text"clip" is loaded in the middle with a preloader,i dont want to make my site into scenes,i think this a very old way,is there a way to preload a symbole or is it just that ther is a code that calls this movie clip,plz help me with the code.
View Replies !
View Related
Where To Start?
I am new to Flash and I am contemplating a nice starting book.. I am conflicting between Foundation Flash 5 and the Visual Start Guide for Flash 5. Anyone have an opinion, good or bad on these publications or perhaps another that I may have overlooked. Thanks
View Replies !
View Related
How To Start, Anyone?
Ok, planning to make a board game, anyone got any idea how to make one?
I am a real dummy in creating action script and therefore, i need advise. Example like for the things to move on the board, how to program the board etc...
What is recommended to program a board? Is there is special way? What about multi players? My board game is played up to 4 players. How to program a dice, any example?
I really know nothing much about it. Hope to get some help, thanks!!!
Rgds,
CL
View Replies !
View Related
Where Do I Start?
Hi - I would like to know how to do the kind of animations (quick, flickering and smooth as in this site: http://www.skvisual.com). Are the home box animations in actionscript? Does the smooth collapse and expand of the "more>" button also result from actionscript? How do I do this? I'm just getting started with actionscript, so any help is gratefully accepted!
View Replies !
View Related
Where Do I Start?
Hi
I'm fairly new to Flash, and I'd like to take it on as I've gotten bored of HTML.
Any help would be useful.
I would like to "write" a web page in Flash but I'm not sure if this is possible. Write back with suggestions - nice and slowly
TBo6
View Replies !
View Related
.start()
in sounds control i can't get the .start() funtion to do anything.
I have a sound clip playing and I have 2 buttons that can adjust the volume, they work
another stops the sound altogether, this works
another starts the sound, and i've been told from the reference that it can also start it form a certain position of the song.
I cannnot get this to work )=/
what the hell!?
help please =[...
View Replies !
View Related
|