slideshow MC's in my array

  • theman
  • Graduate
  • Graduate
  • User avatar
  • Joined: Sep 15, 2004
  • Posts: 124
  • Status: Offline

Post September 19th, 2007, 5:08 pm

I already have an array set up with a navigation and tween on the MC's when the navigation is pressed. My question is, how would I apply a simple automated play to it.

The functions are already there that make the navigation bring up my corresponding MC, i just need some autoplay to it.

here is my source:

Code: [ Select ]
this.scrollIcons = function(p_offset:Number) {
  // Scrolls the icon list
  this.setIcon(this.currentIcon + p_offset);
};

this.setIcon = function(p_icon:Number) {
  // Set the currently selected icon
  if (p_icon != undefined) {
    if (p_icon < 0) p_icon = 0;
    if (p_icon > this.icons.length - 1) p_icon = this.icons.length - 1;
    if (p_icon != this.currentIcon) {
      this.currentIcon = p_icon;
      this.redraw(false);
    }
  }
};
  1. this.scrollIcons = function(p_offset:Number) {
  2.   // Scrolls the icon list
  3.   this.setIcon(this.currentIcon + p_offset);
  4. };
  5. this.setIcon = function(p_icon:Number) {
  6.   // Set the currently selected icon
  7.   if (p_icon != undefined) {
  8.     if (p_icon < 0) p_icon = 0;
  9.     if (p_icon > this.icons.length - 1) p_icon = this.icons.length - 1;
  10.     if (p_icon != this.currentIcon) {
  11.       this.currentIcon = p_icon;
  12.       this.redraw(false);
  13.     }
  14.   }
  15. };
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post September 19th, 2007, 5:08 pm

  • theman
  • Graduate
  • Graduate
  • User avatar
  • Joined: Sep 15, 2004
  • Posts: 124
  • Status: Offline

Post September 20th, 2007, 9:42 am

anyone use this place? LOL
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post September 21st, 2007, 10:06 pm

setInterval is flash's version of a timer. I typically use one with a test for mouse movement so that it gets canceled if there is a user interaction.

http://www.actionscript.org/resources/articles/120/1/Intervals-in-Flash-with-setInterval/Page1.html
  • classified
  • Expert
  • Expert
  • User avatar
  • Joined: Dec 23, 2005
  • Posts: 540
  • Loc: Bahrain
  • Status: Offline

Post September 24th, 2007, 8:30 am

theman wrote:
anyone use this place? LOL

:shock:
m0o , where <<Less is More>>
http://www.zainals.com
http://www.zainals.com/blog
  • krismeister
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Oct 21, 2006
  • Posts: 202
  • Status: Offline

Post September 24th, 2007, 3:03 pm

the only array I see you using is:
this.icons

so maybe you're looking to
Code: [ Select ]
this.setIcon = function(p_icon:Number) {
  // Set the currently selected icon
  if (p_icon != undefined) {
    if (p_icon < 0) p_icon = 0;
    if (p_icon > this.icons.length - 1) p_icon = this.icons.length - 1;
    if (p_icon != this.currentIcon) {
      this.currentIcon = p_icon;
      this.redraw(false);
    }
  this.icons[p_icons].play();
  }
};
  1. this.setIcon = function(p_icon:Number) {
  2.   // Set the currently selected icon
  3.   if (p_icon != undefined) {
  4.     if (p_icon < 0) p_icon = 0;
  5.     if (p_icon > this.icons.length - 1) p_icon = this.icons.length - 1;
  6.     if (p_icon != this.currentIcon) {
  7.       this.currentIcon = p_icon;
  8.       this.redraw(false);
  9.     }
  10.   this.icons[p_icons].play();
  11.   }
  12. };

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 33 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.