Slideshow Autostart, Button And Music
I am about as new to Flash MX 2004 as you can get and need some help. I don't know much about code. Here is what I am trying to do: I created a slideshow using the template provided with Flash MX 2004 Profesisonal and placing it inside a web page. I would like to: 1. Have the slideshow start automatically2. Have music play automatically3. Eliminate the big start button that comes with the slideshow Can someone help me? As Sargent Shultz said, "I know nothing, nothing!" Thanks, Big Mike
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 07-05-2007, 06:08 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Music Loop Autostart Problem
Hi.
I created a player in Flash MX that loops an external MP3. However, this looping only starts playing automatically in Flash Mx test environment. When I put the SWF in the browser the music loop does not start automatically; I have to press my play button to get it started. Here's the actions frame.
myMusic = new Sound();
myMusic.loadSound("sample.mp3");
myMusic.start(0, 0);
myMusic.onSoundComplete = function() {
myMusic.start(.1, 0);
};
Any help is much appreciated.
Ivan
Playing Music In Slideshow
My english is not so good but i really hope you will understand me.
I want to play to diferent sound in mp3 file. I have them named sound1 and sound 2 in my library.They are playing in background of slideshow (slideshow template in flash MX)
music = new Sound(this);
music.attachSound("sound1");
music.start(0,999);
this is how first starts but how can i make that when this is finished the sound2 will start an so on to infinity.
Thanks
Slideshow Music Playing Over *PROBLEM* HELP PLEASE
Hello guys,
I'm having an extreme problem doing this slideshow with music. first of all I'm using my friends domain to show you guys what happens. it's www.keremsuer.com . Ok as you see, when I click on the ABOUT button, a paper appears, which I want that way, but then I want to click on the paper and then it should disappear. It disappears, but I did it by gotoandstop frame1 which reloads the movie and makes the music play over and then the music mixes up. also all the navigation disappears and then appears just like it should do when you first launched the site. Ok what I want to do is this:
The site launches, everything fades in, music starts.
When you click on the ABOUT button, a paper appears. (We're fine through here)
Then when I click on that paper, the only thing is the paper should disappear (MUSIC SHOULDNT RELOAD, AND NAVIGATION SHOULDNT RELOAD)
But my actionscript knowledge is not enough for this
I used xml for the image gallery and the music, but basically my friend did it, and right now he is out of country and nobody can help.
I also put the flash file and xml and everything on a zip folder and uploaded it to the domain. here it is www.keremsuer.com/SLIDE.zip
PLEASE SOMEBODY HELP ME THROUGH THIS. I WILL GET OFFLINE COZ I GOTTA go to a class, but please respond me and also consider that my flash actionscript knowledge is really low. I'm a newbie.
Thanks
ps: it's flash 8
Slideshow Similar To Sony Music
hi,
im a newbie. i'm trying to create a slideshow similar to Sony Music and i'm having problems.
The movieclip.tweening extension can be downloaded at laco.wz.cz/tween
my slideshow images are read from xml.
i keep getting an error trying to upload my .zip. you can get the file here:
slideshow.zip
1. i want to have my logo slide in and out at the start of each slide.
2. then i want the artist name to tween.slide into view, at the top, above the artist slide then slide out before the end of the artist slide.
3 i also want the caption to tween.scale into into view, at the bottom, above the artist slide then scale out before the end of the artist slide.
ActionScript Code:
#include "lmc_tween.as"
mc_spinning_logo.loadMovie("otb_logo.swf", 1);
mc_spinning_logo._xscale = 15;
mc_spinning_logo._yscale = 15;
delay = 4500;
mc_caption.tween(["_xscale", "_yscale"], [100, 0], 1.5);
_level0.caption_txt._visible = false;
//-----------------------
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
artistname = [];
path = [];
caption = [];
url = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
artistname[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
path[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
caption[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
url[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("homepage_slideshow.xml");
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 5;
if (picture._alpha>95) {
mc_slidinglogo.slideTo(-225, (338.6/2), 1.8, "easeOutCirc");
mc_slidinglogo.alphaTo(50, 1, "linear");
}
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
mc_slidinglogo.slideTo(290, (338.6/2), 2.3, "linear");
mc_slidinglogo.alphaTo(100, 1, "linear");
artist_caption();
picture._alpha = 0;
picture.loadMovie(path[p], 1);
_level0.caption_txt = caption[p];
slideshow();
}
}
}
function firstImage() {
if (loaded == filesize) {
mc_slidinglogo.slideTo(290, (338.6/2), 2.3, "linear");
mc_slidinglogo.alphaTo(100, 1, "linear");
artist_caption();
picture._alpha = 0;
picture.loadMovie(path[0], 1);
_level0.caption_txt = caption[0];
artistinfo();
slideshow();
}
}
function artistinfo() {
myArtistInterval = setInterval(pause_artistinfo, 1000);
mc_artistname.slideTo(290, (15/2), 1.8, "linear");
function pause_artistinfo() {
clearInterval(myArtistInterval);
}
}
function artist_caption() {
myCaptionInterval = setInterval(pause_artist_caption, 2000);
mc_caption.alphaTo(0, 1, "linear");
mc_caption.tween(["_xscale", "_yscale"], [100, 100], 1.5);
_level0.caption_txt._visible = true;
function pause_artist_caption() {
clearInterval(myCaptionInterval);
}
}
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
trace("delay = "+delay);
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
firstImage();
} else {
nextImage();
}
}
}
Autostart CD ROM
HI,
I wonder if anyone can help me. I've created a flash movie which I want to burn onto a cd rom. I've saved the projector file and everything, but I want it to start automatically when you insert the cd, is there a FS command or some actionscript to do this? It's for use on a mac and I am using a mac.
Thanks in advance for any help.
Autostart CD In OSX?
hi all
is there a way you can make a CD autostart a projector in OSX ????????
i can do it for OS9 in toast and PC with autorun.inf but not OSX, any help would be great
Cheers
Autostart
okay this should be easy.... i am creating a flash movie and publishing it as a projector for a mac platform... how to initial an autostart so the program automatically starts when placed in the cd rom drive....
thank you in advance
Autostart Cd-rom
I need to autostart a CD with a mac projecter file and a PC exe file on it.
I would like the relevent file to automaticly open when you insert it into the drive.
Can anyone tell me how to go about doing this?
Autostart Cd Help
how can i make a pc cd that autostarts using flash mx?
i need it to automatically starts the flash movie, and the movie will have a password script in it.
thanks sooo much for your help.
aleloop
Autostart
When someone puts a cd (my movie) into their cd drive, does anyone know how to make it autostart?
XML Autostart
Howdy I was wondering if anybody in this forums could help me auto start my videos and lead in right into the next video i've pasted the code and attached the "sample"........
Thanks Chuck
var playlistXML:XML = new XML();
playlistXML.ignoreWhite = true;
var currentVideo:String;
var currentFLV:String;
playlistXML.onLoad = function() {
var tempArray = new Array();
for (var i = 0; i<this.firstChild.childNodes.length; ++i) {
tempArray[i] = new Object();
tempArray[i].label = this.firstChild.childNodes[i].attributes.vdate+newline+this.firstChild.childNod es[i].firstChild.nodeValue;
tempArray[i].data = this.firstChild.childNodes[i].attributes.flv_url;
}
playlist_lb.dataProvider = tempArray;
};
playlistXML.load("video_list.xml");
playBut._visible = false;
pauseBut._visible = true;
playlist_lbListener = {};
var playlist_lbListener:Object = new Object();
playlist_lbListener.change = function() {
currentVideo = playlist_lb.selectedItem.label;
currentFLV = playlist_lb.selectedItem.data;
playBut._visible = false;
pauseBut._visible = true;
nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
ns.setBufferTime(0);
ns.onStatus = function(object) {
// rewind and pause on stop
};
// Attach the NetStream video feed to the Video object
the_video.attachVideo(ns);
// Set the buffer time
ns.setBufferTime(5);
// Begin playing the FLV file
ns.play(currentFLV);
// build sound object
this.createEmptyMovieClip("snd", 0);
snd.attachAudio(ns);
audio = new Sound(snd);
};
playlist_lb.addEventListener("change", playlist_lbListener);
CD Rom Autostart
I'm thinking about making a CD Rom with Flash and I was wondering about how to make the autostart on the CD. Is it difficult? Probably not. Can anybody tell me how?
Tx
Autostart Help
Hello all. I've been trying to learn more about sound and flash lately and have an existing mp3 player that I need help with.
I've built my own simple mp3 player so far, but this one is a bit more complicated and I'm stuck on one thing...
What needs to be added/changed so that this player will not autostart?
I have tried changing this.sound_obj.loadSound(file,true) to this.sound_obj.loadSound(file,false) but it still autostarts.
I'm still a newbie when it comes to Flash and I've tried searching on this topic for something that will answer my questions for this particular player, but no luck.
So, any help is greatly appreciated. Source code is below.
Thanks,
Opusmx
---------------
stop();
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;
//trace(songname[i]+" "+songfile[i]+" "+songband[i]);
}
}
_root.createEmptyMovieClip("sound_mc",1);
_global.song_nr = random(songfile.length);
_root.sound_mc.songStarter(songfile[song_nr],songname[song_nr],songband[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;
}
MovieClip.prototype.songStarter = function (file, name, band) {
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.onEnterFrame = function () {
if(this.sound_obj.position>0) {
delete this.onEnterFrame;
this._parent.display_txt.text=name+" - "+band;
timeInterval = setInterval(timer, 1000, this.sound_obj);
} else {
this._parent.display_txt.text="loading..."
}
}
this.sound_obj.onSoundComplete = function () {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text="00:00";
(song_nr==songfile.length-1)? _global.song_nr=0 : _global.song_nr++;
_root.sound_mc.songStarter(songfile[song_nr],songname[song_nr],songband[song_nr]);
}
this._parent.volume1.dragger.onPress = function() {
startDrag(this, true, 0, this._y, this._parent.volBG._width, this._y);
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() {
stopDrag();
};
}
btn_play.onRelease = function () {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text="00:00";
this._parent.sound_mc.songStarter(songfile[song_nr],songname[song_nr],songband[song_nr]);
}
btn_stop.onRelease = function() {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text="00:00";
this._parent.sound_mc.sound_obj.stop();
}
btn_fw.onRelease = function () {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text="00:00";
(song_nr==songfile.length-1)? _global.song_nr=0 : _global.song_nr++;
_root.sound_mc.songStarter(songfile[song_nr],songname[song_nr],songband[song_nr]);
}
btn_rev.onRelease = function () {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text="00:00";
(song_nr==0)? _global.song_nr=songfile.length-1 : _global.song_nr--;
_root.sound_mc.songStarter(songfile[song_nr],songname[song_nr],songband[song_nr])
}
playlist.load("jukebox.xml");
Anyway To Autostart From CD?
Well you know, I am making a interactive cd rom & I am looking for a way for it to start when someone inserts the cd, on mac & pc. I guess I need 1 exe file & something for mac?? If you guys have any idea or know of any software that does this please let me know. Thanks & happy holidays (love the theme)
Help With Autostart
I am a total n00bie with this so I apologize in advance for my ignorance.
I have this animation that refuses to start rotating unless I click on the animation and then hit the spacebar...
What can I do in order to get this stuff going?
Since i'm a new user the forum wont allow me to post the URL... PM if you have any ideas PLZ.
woodallcreative.com/proofs/strong/index.php
P
AUTOSTART IN MACINTOSH
AUTOSTART IN MACINTOSH
This has been put into the Newbies and Mac forum.
I read how to autostart a pc flash file.
How do I autostart a macintosh flash file?!
Autostart With Certain Program
hi there,
is it possible to create an autostart with a certain
program on a cd?
if so, how does it work?
as usual every help appreciated
Mac Autostart With Application
hi there,
my problem is to create an autorun for a cd-rom which
starts a html file with a browser.
autorun itself is working fine, unless u use os X. I think
they just skipped it, so it will work only on os 9 or earlier.
well, if i e.g. create a html file with dreamweaver, autrun will
open the html file NOT in a browser BUT in dreamweaver.
the windows autorun for the same thing works fine, if u use stuff
like runfile.exe in addition.
so does any1 have a clue, how to solve this or if there's a similar
utility for mac??
as usual every help appreciated
Autostart File For CD
How can I create a file that autostarts a flash movie called start.exe on a CD when the CD is inserted into the computer?
Thanks,
Jason
Loadmovie Must NOT Autostart. How To Do This?
Hello :-)
Maybe one of u knows the answer to this problem.
I have a swf, lets name it swf1. In swf1 a movieclip is playing. During the playing of swf1(the user is watching the movie) I load a second swf (lets name it swf2) with the ‘loadmovie’ action. I only want to do this because on the next page of my website swf2 is needed. So by ‘preloading’ it, it’s already in the browsers cache and the user doesn’t have to wait for swf2 to download when he surfs on. Now the problem. Swf2 is a movie clip with video and sound. When swf1 is playing and swf2 is fully loaded, swf2 begins playing to. I know this is the normal behaviour of AS and the loadmovie command. The result is that swf1 and swf2 are playing over each other. That’s not what I want.
1. Is it possible to give a loadmovie command the option NOT to start playing when it is loaded? When yes, how to do this?
2. If 1 is not possible, can i mute the sound of a loaded movie?
3. If 1 and 2 are not possible, are there other ways to ‘preload’ swf’s in the background (without playing them) for later use on the website?
Thanks in advance for the help.
Greetings, Luut.
Autostart For Macs (please Help)
creating a cd for co., and I was wondering if there is a code which would auostart a mac projecor file when the cd is put in the computer.
[F8] As 2.0 Video Autostart
Hello,
I have embedded a video in flash, and I do not want it to automatically start playing when the swf file loads. I want the rest of the movie to play though. Is there a way to do this ?
best,
Aaron
Want To Get FLV NOT To Autostart And NOT Loop
I clipped this code from a tutorial at gotoandlearn and am trying to figure out how to have the FLV NOT automatically start playing and once it completes, NOT loop but go back to first frame. Please help or offer suggestions. Thanks.
PHP Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
ns.setBufferTime(10);
ns.onStatus = function(info) {
trace(info.code);
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
}
if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
}
if(info.code == "NetStream.Play.Stop") {
ns.seek(0);
}
}
ns.play("flv/#.flv");
playButt.onRelease = function() {
ns.play();
playPaus.play(1);
}
playButt.onRelease = function() {
ns.pause();
playPaus.play();
}
stopButt.onRelease = function() {
ns.seek(0);
ns.pause(true);
}
var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function(obj) {
duration = obj.duration;
}
function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * 238.6;
loader.scrub._x = ns.time / duration * 238.6;
}
var scrubInterval;
loader.scrub.onPress = function() {
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);
this.startDrag(false,0,this._y,238,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);
this.stopDrag();
}
function scrubit() {
ns.seek(Math.floor((loader.scrub._x/238)*duration));
}
Autostart Mp3 Player
Hi, I have a flash mp3 player that only starts if I hit the play button. Is there a way to make it automatically start playing as soon as the movie loads?
Here is all the actionscript.
PHP Code:
stop();
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;
// trace(songname[i]+" "+songfile[i]+" "+songband[i]);
}
}
_root.createEmptyMovieClip("sound_mc", 1);
_global.song_nr = random(songfile.length);
};
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;
}
MovieClip.prototype.songStarter = function(file, name, band) {
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.onEnterFrame = function() {
if (this.sound_obj.position>0) {
delete this.onEnterFrame;
this._parent.display_txt.text = name+" / "+band;
timeInterval = setInterval(timer, 1000, this.sound_obj);
} else {
this._parent.display_txt.text = "loading...";
}
};
this.sound_obj.onSoundComplete = function() {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text = "00:00";
(song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
_root.sound_mc.songStarter(songfile[song_nr], songname[song_nr], songband[song_nr]);
};
this._parent.volume1.dragger.onPress = function() {
startDrag(this, true, 0, this._y, this._parent.volBG._width, this._y);
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() {
stopDrag();
};
};
btn_play.onRelease = function() {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text = "00:00";
this._parent.sound_mc.songStarter(songfile[song_nr], songname[song_nr], songband[song_nr]);
};
btn_stop.onRelease = function() {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text = "00:00";
this._parent.sound_mc.sound_obj.stop();
};
btn_fw.onRelease = function() {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text = "00:00";
(song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
_root.sound_mc.songStarter(songfile[song_nr], songname[song_nr], songband[song_nr]);
};
btn_rev.onRelease = function() {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text = "00:00";
(song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;
_root.sound_mc.songStarter(songfile[song_nr], songname[song_nr], songband[song_nr]);
};
playlist.load("playlist.xml");
Thanks for any solutions.
Disable Autostart
This is probably one of those things that is so simple and staring me in the face that I just don't see it however,
How do you disable the autostart on a flash clip? We are placing a flash clip on a website and want to have the flash clip default autostart setting set to disabled so that users who are not interested in the clip are not forced to listen to it against their will, while users who are interested can simply select the play button.
(Using Macromedia Flash Professional 8)
Thanks.
Edited: 05/15/2007 at 07:36:49 AM by bytbb
Can't Turn Off Autostart
I'm using MX 2004 Pro.
I've created an .flv file from a QuickTime movie, audio only.
When I created the .fla and .swf, I UNCHECKED "Automatically Play" in the Media Playback Window of the Component Inspector - but the audio ALWAYS starts playing when the page loads, even though the controller says, "Paused."
I've tried all of these parameters in the code on the HTML page, to no avail:
<param name="play" value="false" />
<param name="autoplay" value="false" />
<param name="autostart" value="false" />
What's going on here, and how do I fix it?
Thanks,
How Do I Edit This To Not Autostart?
Code:
/***********************************************************************************
***********************************basic setup**************************************
***********************************************************************************/
//setup sound object
var s:Sound = new Sound();
s.onSoundComplete = playSong;
s.setVolume(75);
//array of songs
var sa:Array = new Array();
//currently playing song
var cps:Number = -1;
//position of music at pausing
var pos:Number;
//position of the volume loadBar
var nlp:Number = 75;
volume.loadBar.gotoAndStop(nlp);
//pausePlay state
var songPlaying:Boolean = false;
//load the songs xml
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function() {
var nodes:Array = this.firstChild.childNodes;
for(var i=0;i<nodes.length;i++) {
sa.push(new Song(nodes[i].attributes.url,nodes[i].attributes.track,nodes[i].attributes.artist,nodes[i].attributes.link)); //keep an eye on this bit here
}
playSong();
songPlaying = true;
}
xml.load("xml/songs.xml");
//play the mp3 file
function playSong():Void {
s = new Sound(sHolder); //wipes out the current sound object and creates a new one
s.onSoundComplete = playSong; //this function is recursive, but needs to be adapted to implement shuffle mode
s.setVolume(75);
//mute.gotoAndStop("on");
if(cps == sa.length-1) { //if the song array is at the end, set it back to the beginning
cps = 0; //this section will be the best to adapt for shuffle mode
s.loadSound(sa[cps].url, true);
}
else {
s.loadSound(sa[++cps].url, true);
}
trackInfo.text = sa[cps].artist + sa[cps].track;
playPause.gotoAndStop("pause");
textPos = 0;
//numSongs.cpSong.text = cps+1;
//numSongs.saLength.text = sa.length;
}
/***********************************************************************************
****************************transport controls**************************************
***********************************************************************************/
//button functionality*******************************************
playPause.onRollOver = function():Void
{
if(this._currentframe == 1)
{
this.gotoAndPlay("pauseOver");
}
else if(this._currentframe == 10)
{
this.gotoAndPlay("playOver");
}
}
playPause.onRollOut = function():Void
{
if(this._currentframe != 1 && this._currentframe < 10)
{
this.gotoAndStop("pause");
}
else if(this._currentframe >= 11)
{
this.gotoAndStop("play");
}
}
playPause.onRelease = function()
{
if(songPlaying == true)
{
this.gotoAndStop("play");
this._parent.pauseIt();
songPlaying = false;
}
else
{
this.gotoAndStop("pause");
this._parent.unPauseIt();
songPlaying = true;
}
}
nextSong.onRollOver = over;
nextSong.onRollOut = out;
nextSong.onRelease = function() {
this._parent.playSong();
songPlaying = true;
playPause.gotoAndStop("pause");
}
prevSong.onRollOver = over;
prevSong.onRollOut = out;
prevSong.onRelease = function() { //this is the function that takes the songlist from the 1st song to the last
if(cps == 0) {
cps = sa.length - 2;
} else {
cps -= 2;
}
this._parent.playSong();
songPlaying = true;
playPause.gotoAndStop("pause");
}
// Mute Button
mute.onRollOver = function()
{
if(this._currentframe == 1) this.gotoAndStop("onOver");
else this.gotoAndStop("offOver");
}
mute.onRollOut = mute.onReleaseOutside = function()
{
if(this._currentframe == 10) this.gotoAndStop("on");
else this.gotoAndStop("off");
}
mute.onRelease = function()
{
if(this._currentframe == 10)
{
this.gotoAndStop("offOver");
s.setVolume(0);
}
else
{
this.gotoAndStop("onOver");
s.setVolume(75);
}
}
//button functions*************************************************
function over():Void
{
this.gotoAndPlay("over");
}
function out():Void
{
this.gotoAndPlay("out");
}
function pauseIt():Void
{
pos = s.position;
s.stop();
songPlaying = false;
}
function unPauseIt():Void
{
s.start(pos/1000);
songPlaying = true;
}
/***********************************************************************************
*********************volume slider**************************************************
***********************************************************************************/
volume.scrub.left = 0;
volume.scrub.right = 100;
volume.scrub.top = volume.scrub._y;
volume.scrub.bottom = volume.scrub._y;
volume.scrub.onRollOver = function() {
this.gotoAndPlay("rollOver");
}
volume.scrub.onRollOut = function() {
this.gotoAndPlay("rollOut");
}
volume.scrub.onPress = volume.scrub.onReleaseOutside = function() {
this.startDrag(false, volume.scrub.left, volume.scrub.top, volume.scrub.right, volume.scrub.bottom);
this.isDragging = true;
}
volume.scrub.onMouseMove = function() {
if (this.isDragging) {
s.setVolume(this._x);
currentVolume = this._x;
nlp = this._x;
volume.loadBar.gotoAndStop(nlp);
}
}
volume.scrub.onRelease = volume.scrub.onReleaseOutside = function() {
this.stopDrag();
this.isDragging = false;
s.setVolume(this._x);
nlp = this._x;
volume.loadBar.gotoAndStop(nlp);
currentVolume = this._x;
}
/***********************************************************************************
*********************track info**************************************************
***********************************************************************************/
var size:Number = 45; //how many character slots are displayed
var textPos:Number = 0;
var intervalId:Number = setInterval(scroller,1000);
function scroller():Void
{
var t:String = (sa[cps].artist + " - " + sa[cps].track);
if(textPos + size < t.length)
{
textPos++;
trackInfo.text = (sa[cps].artist + " - " + sa[cps].track).substring(textPos, textPos+size);
}else
{
clearInterval(intervalId);
intervalId = setInterval(scroller2,1000);
}
}
function scroller2():Void
{
var t:String = (sa[cps].artist + " - " + sa[cps].track);
if(textPos > 0)
{
textPos--;
trackInfo.text = (sa[cps].artist + " - " + sa[cps].track).substring(textPos, size);
}
else
{
clearInterval(intervalID);
intervalID = setInterval(scroller, 1000);
}
}
infoButton.onRollOver = over;
infoButton.onRollOut = out;
infoButton.onRelease = function():Void
{
this.gotoAndStop("up");
getURL(sa[cps].link,"_blank");
}
Looking For The Code To Create A Mac AutoStart?
I have a hqx file that I am trying to create a AutoStart program for. I know how to create the AutoRun for PC, just a little hung up on the Mac version any help would be greatly appreciated. Thanks
Autostart On Flash Movies?
I have made a flash movie and it works fine when i test it as I'm making it, but when I upload it to the server and view it on the webpage, the movie doesn't start automatically, I have to right click it then hit play. Is there something that I did wrong when I made the movie. Any help would be much appreciated.
Thanks in advance
Flash Buttons Don't Autostart
Sorry if the question doesn't make a lot of sense. I'm really really new to Flash.
I'm using IE 6 and 7 (2 different pc's) to test on.
If I view a swf file that has animation it starts as soon as the page loads however, if I load a swf with a button on it (like one with a hover effect) I can not get it to start unless I click on the control first and then hover over it.
When I hover over the button the tooltip says, "Click to activate and use this control"
So I have to click on the control and then it works, but animations do not require this action. They start up as soon as the page loads.
Is there a setting or something in IE or in flash itself that I should have enabled to allow the buttons or menu to autostart as soon as the page loads?
Thanks, and again sorry if this doesn't make sense.
-Dave
Autostart Issue-flv Player
I got this FLV player(click to download the source) and i ain't no genius in flash that's why I'll post this here if you please.
My problem is that the autostart won't work and i have no idea how to solve this problem.
I remember i tried, months ago, to put the code autostart=1 or true on the html code but that wasn't helpful at all so i guess there is something to do with the AS script to make this work
I know that the xml playlist is correct and there is nothing to change about it
Well,I hope ill get some help.
Pce folks
Script To Make Projector Autostart On Mac?
I was wondering if there was a script that would make a projector auto start from a mac platform. As in, the user inserts the CD into their computer, and the flash movie automatically launches and plays. (not in a browser window, just through the projector)
I've had no trouble finding the script for a PC, just haven't had the same luck for the mac.
Thanks.
-nic-
[CS3] Media Player Component No Autostart
Okay,
I'm going insane here - I have checked the option on the component (on the stage) to not autostart - yet it autostarts the download anyways (it is set to false in the HTML as well). Driving me crazy here. Anyways, what I want is like an embedded You Tube movie, it places an icon over the start image and once the user clicks it then it starts the stream.
If I need to use Actionscript please inform me of where to place it (on the button, on the frame, etc), also of what form of AS to use. Thanks for the help.
--
Greg
Query - Audio Track Autostart
Hi there,
A quick question, I am using an audio track for a website.
A movie clip sits on the main timeline and is linked a .wav file.
The movie clip contains a button in frame 1 that uses the following code to start the audio playing:
on (release) {
s.start(0,100);
gotoAndPlay (1);
}
Frame 1 actions has the following code:
s = new Sound(this);
s.attachSound("mySound");
s.setVolume(100);
It works perfectly, but takes a user clicking the button to start the track.
I want it to auststart. Using an OnClipEvent to start the audio makes a huge mess! Any ideas?
Query - Audio Track Autostart
Hi there,
A quick question, I am using an audio track for a website.
A movie clip sits on the main timeline and is linked a .wav file.
The movie clip contains a button in frame 1 that uses the following code to start the audio playing:
on (release) {
s.start(0,100);
gotoAndPlay (1);
}
Frame 1 actions has the following code:
s = new Sound(this);
s.attachSound("mySound");
s.setVolume(100);
It works perfectly, but takes a user clicking the button to start the track.
I want it to auststart. Using an OnClipEvent to start the audio makes a huge mess! Any ideas?
Scrolling Image Autostart? Code Included...Please Help
I am trying to make an image scroll from top to bottom. As ur mouse goes over it, you can scroll it back up or down. It stops at the top and bottom. But I can't get it to have a default scrolling speed and direction for when there is no mouse on it. Here is the code I have on the movie clip! Thanks!
onClipEvent (load)
{
ycenter=150;
speed=1/30;
}
onClipEvent (enterFrame)
{
var distance=_root._ymouse-ycenter;
_y+=(distance*speed);
if (_y > 800) _y=800;
if (_y < -535) _y=-535;
}
The if statements stop it at the top and bottom. I still need those to work after we get it to start scrolling. I need it to act as if the mouse is already at the top of the .swf file. Thank you!
-L
Slideshow Button Help
I want to make a total of 50 slides including a menu, buttons to skip forward and back, How would / shoul dI do this to have it look good and work best. any help is greatly appreciated
Next Button In The Slideshow
Well first off does anyone know a good site to read the basics of scripting?
Real question: I'm making a slideshow operated solely by the next and previous buttons. The difference is I'd like the images stored on my server space instead of nested within the flash file itself. This way the movie is smaller and I can more easily change the pictures later on. This is the code I currently have that loads the files from my server space.
imgbtn1.onRelease = function() {
infoField._visible = true;
startLoading("01.jpg");
};
imgbtn2.onRelease = function() {
infoField._visible = true;
startLoading("02.jpg");
};
imgbtn3.onRelease = function() {
infoField._visible = true;
startLoading("03.jpg");
};
function startLoading(whichImage) {
loadMovie(whichImage, "imageLoader");
_root.onEnterFrame = function() {
infoLoaded = imageLoader.getBytesLoaded();
infoTotal = imageLoader.getBytesTotal();
percentage = Math.floor(infoLoaded/infoTotal*100);
infoField.text = percentage+"%";
if (percentage>=100) {
delete this.onEnterFrame;
infoField._visible = false;
}
};
}
Now obviously this is three buttons but I copied this off of a tutorial so I could get a better understanding of what is going on. Now I want this down to two buttons and one will skip to the next image when pressed and the other button will do the opposite. I think I need to use an array or something but I don't know where to begin with this. Any help would be really appreciated.
Button Slideshow Help?
Attempting to make a slideshow banner, with a next button. When button is clicked, it scrolls to the next image, but attempting at getting the description to change with it (where the error is)
Similar Banner here: http://www.emadraad.com/cafe/
I'm getting the error:
TypeError: Error #1010: A term is undefined and has no properties.
at flash_fma_fla::MainTimeline/nextMenuItem()
The images scroll through correctly, the first description appears but it fails to load the other descriptions
This is the script..
THE FOLLOWING SECTIONS CONTAIN THE DATA FOR THE IMAGE (menuItem) DESCRIPTIONS
Code:
/*The following four sections contain the data
/*for each menu item.
/* 0 */
var image0title:String = "Glass";
var image0desc:String = "Insert description.";
var image0uri:String = "images/image0.jpg";
/* 1 */
var image1title:String = "Concrete";
var image1desc:String = "Insert description.";
var image1uri:String = "images/image1.jpg";
/* 2 */
var image2title:String = "Synthetic Mineral Fibres";
var image2desc:String = "Insert description.";
var image2uri:String = "images/image2.jpg";
/* 3 */
var image3title:String = "Metals";
var image3desc:String = "Insert description.";
var image3uri:String = "images/image3.jpg";
/* 4 */
var image4title:String = "Plastics";
var image4desc:String = "Insert description.";
var image4uri:String = "images/image4.jpg";
var currImage:Number = 0;
var totalImages:Number = 5;menu_mc.title_txt.text = this["image"+currImage+"title"];
menu_mc.description_txt.text = this["image"+currImage+"desc"];
AND THE SCRIPT FOR FUNCTIONING THE NEXT BUTTON (Where the problem is?)
It scrolls through the images, and loads the first title+description, but doesn't scroll through the rest of the titles+descriptions..
Code:
// function for the Next button
function nextMenuItem(eventObj:Object) {
slideShow_mc.gotoAndPlay("slide"+(currImage));
if ((currImage+1)>=totalImages) {
currImage = 0;
} else {
currImage++;
}
menu_mc.title_txt.text = this.DisplayObject.parent["image"+currImage+"title"];
menu_mc.description_txt.text = this.DisplayObject.parent["image"+currImage+"desc"];
}
// add the event listener for the button
next_btn.addEventListener("click", nextMenuItem);
Any help would be much appreciated
[F8] Slideshow/photo Button
hi all,
im having a problem sorting a previous and next button for a friend and i wondered if you guys might be able to help the slideshow code im using is. i understands the basics of it but adding a previous and next button has got me gazumped!!!
what im trying to do is add a next and previous button ive been trying all sorts and thought this might work
Code:
next_btn.onRelease = function() {
menuSlide(contentHold.photo+1);
};
previous_btn.onRelease = function() {
menuSlide(contentHold.photo-1);
};
main code
Code:
var currentPosition:Number = contentHold.content1._x;
var startFlag:Boolean = false;
menuSlide = function (input:MovieClip) {
if (startFlag == false) {
startFlag = true;
var finalDestination:Number = input._x;
var distanceMoved:Number = 0;
var distanceToMove:Number = Math.abs(finalDestination-currentPosition);
var finalSpeed:Number = .3;
var currentSpeed:Number = 0;
var dir:Number = 1;
if (currentPosition<=finalDestination) {
dir = -1;
} else if (currentPosition>finalDestination) {
dir = 1;
}
this.onEnterFrame = function() {
currentSpeed = Math.round((distanceToMove-distanceMoved+1)*finalSpeed);
distanceMoved += currentSpeed;
contentHold._x += dir*currentSpeed;
if (Math.abs(distanceMoved-distanceToMove)<=1) {
contentHold._x = maskMovie._x-currentPosition+dir*distanceToMove;
currentPosition = input._x;
startFlag = false;
delete this.onEnterFrame;
}
};
}
};
b1.onRelease = function() {
menuSlide(contentHold.photo1);
hold = "2";
};
b2.onRelease = function() {
menuSlide(contentHold.photo2);
};
b3.onRelease = function() {
menuSlide(contentHold.photo3);
};
b4.onRelease = function() {
menuSlide(contentHold.photo4);
};
b5.onRelease = function() {
menuSlide(contentHold.photo5);
};
b6.onRelease = function() {
menuSlide(contentHold.photo6);
};
b7.onRelease = function() {
menuSlide(contentHold.photo7);
};
b8.onRelease = function() {
menuSlide(contentHold.photo8);
};
b9.onRelease = function() {
menuSlide(contentHold.photo9);
};
b10.onRelease = function() {
menuSlide(contentHold.photo10);
};
b11.onRelease = function() {
menuSlide(contentHold.photo11);
};
b12.onRelease = function() {
menuSlide(contentHold.photo12);
};
b13.onRelease = function() {
menuSlide(contentHold.photo13);
};
b14.onRelease = function() {
menuSlide(contentHold.photo14);
};
b15.onRelease = function() {
menuSlide(contentHold.photo15);
};
b16.onRelease = function() {
menuSlide(contentHold.photo16);
};
but im afraid my AS is not that good
any help would be much appreciated
thanks
Charlie
Help With Slideshow And Toggle Button
I've made a menu for a cd using as3. in the menu there is a slideshow that uses xml. I found how to do it on a website and don't really know what I'm doing. Almost everything works as I want. I can't figure out the play/pause toggle button. I've got my different symbols ready to go, a play button, one for when it is pushed, a pause button, and one for when it is pushed. How do I make this happen? Right now the slideshow doesn't play (can't figure that out either). It will go from picture to picture using the left and right arrows but the left (back) arrow doesn't cycle around to the very last picture from the very first picture. Please help it's driving me nuts!!!!!!!!!!!!
Stop Button For Xml Slideshow
Hi,
I recently added this xml flash slideshow to my site "http://www.kirupa.com/developer/mx2004/xml_slideshow.htm".
I was wondering if anyone knows how to add a "stop/play" button to this?
Thanks,
N4th4N
XML Slideshow With Replay Button?
I have a simple xml slide show that ends after all the images are called in the xml. I'm completely stumped how to have a replay button reveal after the last image to replay the slideshow.
Any ideas are much O preciated!!!
Here is my AS..
// set random # variables - each must be 0 for first 'while' loop below
var randomNum = 0;
var randomNumLast = 0;
// parent container
var container_mc = this.createEmptyMovieClip("container",0);
// movie clip containers
container_mc.createEmptyMovieClip("loader1_mc",2);
container_mc.createEmptyMovieClip("loader2_mc",1);
// preload watcher
this.createEmptyMovieClip("watcher_mc",100);
// load xml
images_xml = new XML();
images_xml.ignoreWhite=true;
images_xml.onLoad = parse;
images_xml.load("images.xml");
function parse(success) {
if (success) {
imageArray = new Array();
var root = this.firstChild;
_global.numPause = Number(this.firstChild.attributes.timer * 1000);
_global.order = this.firstChild.attributes.order;
_global.looping = this.firstChild.attributes.looping;
_global.fadetime = Number(this.firstChild.attributes.fadetime);
_global.xpos = Number(this.firstChild.attributes.xpos);
_global.ypos = Number(this.firstChild.attributes.ypos);
var imageNode = root.lastChild;
var s=0;
while (imageNode.nodeName != null) {
imageData = new Object;
imageData.path = imageNode.attributes.path;
imageArray[s]=imageData;
imageNode = imageNode.previousSibling;
s++;
}
// place parent container
container_mc._x = 99;
container_mc._y = 144;
// parse array
imageArray.reverse();
imageGen(imageArray);
} else {
trace('problem');
}
}
// depth swapping
function swapPlace(clip,num) {
eval(clip).swapDepths(eval("container_mc.loader"+n um+"_mc"));
}
function loadImages(data,num) {
if (i==undefined || i == 2) {
i=2;
createLoader(i,data,num);
i=1;
} else if (i==1) {
createLoader(i,data,num);
i=2;
}
}
function createLoader(i,data,num) {
thisLoader=eval("container_mc.loader"+i+"_mc");
thisLoader._alpha=0;
thisLoader.loadMovie(data[num].path);
watcher_mc.onEnterFrame=function () {
var picLoaded = thisLoader.getBytesLoaded();
var picBytes = thisLoader.getBytesTotal();
if (isNaN(picBytes) || picBytes < 4) {
return;
}
if (picLoaded / picBytes >= 1) {
swapPlace("container_mc.loader2_mc",1);
alphaTween = new mx.transitions.Tween(thisLoader, "_alpha", mx.transitions.easing.Regular.easeOut,0,100,_globa l.fadetime,true);
timerInterval = setInterval(imageGen,_global.numPause,data);
delete this.onEnterFrame;
}
}
}
function imageGen(data) {
// random, or sequential?
if (_global.order=="random") {
// choose random # between 0 and total number of images
while (randomNum == randomNumLast) {
randomNum = Math.floor(Math.random() * data.length);
trace(randomNum);
}
loadImages(data,randomNum);
randomNumLast = randomNum;
} else if (_global.order=="sequential") {
// start at 0, increment to total number of images, then drop back to zero when done
if (p==undefined || p==data.length && _global.looping=="yes") { p=0; } else { break; }
loadImages(data,p);
p++;
} else {
trace ("order attribute in xml isn't correct - must specify either 'random' or 'sequential'");
}
clearInterval(timerInterval);
}
stop();
Add Pause Button To Xml Slideshow
Hi there,
So here is my code, How would I add a pause button to the slideshow to pause, then start it again?
Any help greatly appreciated!
Code:
//-----------------------
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
url = [];
delay = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
url[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
delay[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("http://www.onerutter.com/dlife/flash/images.xml?cachebuster=" + new Date().getTime());
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 5;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
url_btn = url[p];
picture_num();
slideshow();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
url_btn = url[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
url_btn = url[0];
picture_num();
slideshow();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function slideshow() {
myInterval = setInterval(fade_slideshow, delay[p]);
function fade_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
firstImage();
} else {
nextImage();
}
}
}
Slideshow Pause Button
I was wondering if anyone could help me out with this.
I am creating a flash slideshow like any normal slideshow. But this time I want to add a pause button. Does anyone have any examples or have the code I could drop into a button to pause it during the slide show and play where it paused at when clicked again?
-- Nate
Stop/play Button In Slideshow With Xml?
hi, is there a way to have a stop/pause and play button in a Flash slideshow using xml. Since there is only one frame in the .fla file, and all the content are loading externally from the xml, how could I pause/stop the slideshow? thanks.
|