A couple of actionscript issues!

This is a discussion on "A couple of actionscript issues!" within the Flash & Multimedia Forum section. This forum, and the thread "A couple of actionscript issues! are both part of the Design Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Jul 2nd, 2008, 09:52
Up'n'Coming Member
Join Date: Jul 2006
Location: poole
Age: 26
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
A couple of actionscript issues!

I am currently building a multimedia app and have run into a couple of problems.

1) There is one "holder" movie that loads in others, ranging from flv's to mp3's and also swf's. I need to have a "global" mute button - ie one that will just mute the volume of the master movie and everything playing inside it. Can this be done without targetting the specific elements? Like something along the lines of

Code: Select all
on (release){
_root.setVolume(0);
}
2) One of the swf movies loaded in this app is an mp3 player. The animation loads up in frames 1-10, and then there are 20 mp3's on frames 11-21, loaded in using mediaDisplay. It needs to play random tracks, so on frame 10 I have thid code:

Code: Select all
function randRange(min, max) {
        var randomNum = Math.round(Math.random()*(max-min))+min;
        return randomNum;
    }
    var say;
    say = randRange(11, 21);
    gotoAndStop(say);
Which works absolutely fine, however I cannot figure out a way of playing other random tracks after that one has finished. I was thinking I'd either have to use cue points which would be fiddly, or possibly add some code to my progress bar so that when it reaches the end of a track, the playhead goes back to frame 10 to choose another random frame. Here's my progress bar code:

Code: Select all
var listenerObject:Object = new Object ();
listenerObject.change = function (eventObj:Object) {
    var percentPosition = (rock1_mc.playheadTime / rock1_mc.totalTime);
    var frame = Math.round (percentPosition * 999) + 1;
    rock1_slider_mc.gotoAndStop (frame);
};
rock1_mc.addEventListener ("change",listenerObject);

stop();
Above, rock1_mc is the mediaDisplay instance, and rock1_slider_mc is the progress bar.

Any help on this would be very much appreciated.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jul 2nd, 2008, 16:08
Up'n'Coming Member
Join Date: Jul 2006
Location: poole
Age: 26
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A couple of actionscript issues!

By the way guys if you think this isn't possible it would be useful to know that too, as I'll have to come up with a better solution and possibly rebuild. This is a live project so help would be greatly appreciated
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
flash, music, mute, random

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
a couple of problems ukstoner Web Page Design 1 Apr 29th, 2008 13:45
A couple of issues I need help with please Johnathan Web Page Design 7 Mar 15th, 2008 17:57
going beyond a couple of <br />'s cosmicbdog Web Page Design 15 May 25th, 2007 13:08
A couple of articles Ryan Fait Web Page Design 2 Oct 20th, 2006 07:57
Variable issues with Actionscript sourceworx Flash & Multimedia Forum 0 Dec 13th, 2005 20:24


All times are GMT. The time now is 22:25.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42