slideshow MC's in my array

  • theman
  • Graduate
  • Graduate
  • User avatar
  • Posts: 124

Post 3+ Months Ago

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. };
  • theman
  • Graduate
  • Graduate
  • User avatar
  • Posts: 124

Post 3+ Months Ago

anyone use this place? LOL
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

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
  • Posts: 540
  • Loc: Bahrain

Post 3+ Months Ago

theman wrote:
anyone use this place? LOL

:shock:
  • krismeister
  • Graduate
  • Graduate
  • krismeister
  • Posts: 202

Post 3+ Months Ago

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 10 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.