I have problem, Please check this code..

  • mikaxx
  • Born
  • Born
  • mikaxx
  • Posts: 1

Post 3+ Months Ago

Hello. I have AS code in my Fla. I found this code in flashkit ale I change it a little and I adapted it to my needs. But, I have a request. Could you check it for me? or could you simplify it? I think that this code is little too complicate to me...

and If you can, please explain me this code . I will be grateful :)


Code: [ Select ]
var funcName = forward ;
function loadPic(item) {
  if (!pictures[currentItem].loaded) {
   mcNext.enabled = mcContainer._visible = !(mcWait._visible = true);
  }
  this.onEnterFrame = function() {
   var bl = this.mcContainer.getBytesLoaded();
   var bt = this.mcContainer.getBytesTotal();
   if (bl == bt && bt > 0) {
     this.mcNext.enabled = this.mcContainer._visible =
     !(this.mcWait._visible = false);
     this.pictures[this.currentItem].loaded = true;
    
     delete this.onEnterFrame;
   }
  };
  mcContainer.loadMovie(item.name);
}

mcNext.onPress = function() {
  var p = this._parent;
  p.forward = true;
  p.loadPic(p.pictures[p.currentItem =
  (p.currentItem == (p.pictures.length-1)) ? 0 : (p.currentItem+1)]);
};
pictures = [{name: 'julitka.swf', loaded: false},
{name: 'brutus.swf', loaded: false},
{name: 'julitka.swf', loaded: false}];
currentItem = 0;
forward = true;
loadPic(pictures[currentItem]);
  1. var funcName = forward ;
  2. function loadPic(item) {
  3.   if (!pictures[currentItem].loaded) {
  4.    mcNext.enabled = mcContainer._visible = !(mcWait._visible = true);
  5.   }
  6.   this.onEnterFrame = function() {
  7.    var bl = this.mcContainer.getBytesLoaded();
  8.    var bt = this.mcContainer.getBytesTotal();
  9.    if (bl == bt && bt > 0) {
  10.      this.mcNext.enabled = this.mcContainer._visible =
  11.      !(this.mcWait._visible = false);
  12.      this.pictures[this.currentItem].loaded = true;
  13.     
  14.      delete this.onEnterFrame;
  15.    }
  16.   };
  17.   mcContainer.loadMovie(item.name);
  18. }
  19. mcNext.onPress = function() {
  20.   var p = this._parent;
  21.   p.forward = true;
  22.   p.loadPic(p.pictures[p.currentItem =
  23.   (p.currentItem == (p.pictures.length-1)) ? 0 : (p.currentItem+1)]);
  24. };
  25. pictures = [{name: 'julitka.swf', loaded: false},
  26. {name: 'brutus.swf', loaded: false},
  27. {name: 'julitka.swf', loaded: false}];
  28. currentItem = 0;
  29. forward = true;
  30. loadPic(pictures[currentItem]);


and now I tell you what I want to do. I have a few movieclips in SWF and I would like to load these MC's in sequence every time when I click on the button. So when i click first time on button i loading first MC. when i click second time on a button I loading second MC. etc.


I have question:

Code: [ Select ]
p.currentItem == (p.pictures.length-1)) ? 0 : (p.currentItem+1)]);


-- what's that means and what is this: "? 0:" . I know that "?:" is a condition but what a condition is in this line of code?

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 7 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.