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
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]);
- 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]);
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:
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?