Hello all gurus,
Please help if you can,
I have used some of Lee’s tutorials to create elements on this site I am developing. This is my first time ever programming anything with any language so maybe I am missing something. But my issue is as follows:
I have created MCs with createEmptyMovieClip this works great, I use XML in conjunction with that, also works great, the problem I am having is that that when I press the buttons sometime (most of the time) they will flicker and the actions associated will not work, I have no idea why that is happening. To see what I mean please go here http://74.100.154.206/testing/mc/index.html, go to the WHAT section then play around with the PUMA logos (by clicking them) marked 1-9, and see what I mean. What I want to happen is onRollover (if not the first time) fade out the rolledover MC and then when clicked fade out the rest and set that one to 100%, whichc generally works, except sometimes when I click it flickers than sets all the MC’s to a faded state.
I have attached the code as a txt file so you can see it. I hope it is not too confusing.
Thank you in advance for any help you can give.
FLASH GORDON
**Code:**
whatbtn.onRelease = whatLoad;
whatbtn.onPress = introUnload;
//loads COMPANY logos
function whatLoad() {
delete whatbtn.onRelease;
delete whatbtn.onPress;
delete menull.mclogo.onRelease;
_root.onEnterFrame = whoUnload;
var twhat:Tween = new Tween(what_title, "_alpha", Strong.easeOut, 0, 100, 30, false);
twhat.onMotionFinished = function() {
//positioning of movieclips
whatgrad._visible = true;
//var myXMLURL = "http://67.70.9.238/mediacravin/mcwhat.xml";
//create a new xml object
WHATXML = new XML();
// ignore any whitespace without this the xml file loading may fail due to small spacing errors
WHATXML.ignoreWhite = true;
//function performed once the loading is complete.
WHATXML.load("newmcwhat1.xml");
WHATXML.onLoad = function() {
//calculate the number of nodes in the XML
numimages = this.firstChild.childNodes.length;
//sets the spacing variable for use later on
logospacing = 70;
// create a loop which repeats it self for the total number of images.
for (i=0; i<numimages; i++) {
logos._x = 25;
//logos._y = 25;
// assign a temporary name for each of the childNodes so that they can be referenced later on in the loop.
picHolder = this.firstChild.childNodes*;
//create a unique movie clip for each thumbnail, assign a temporary reference thumbholder for the movieclips
this.logoHolder = home.logos.createEmptyMovieClip("logo"+i, i+1);
//set the x vaues for each newly created movieclip.
this.logoHolder._x = i*logospacing;
this.logoHolder.logo = picHolder.attributes.logo;
this.logoLoader = this.logoHolder.createEmptyMovieClip("logo_image"+i, i+1);
//sep1._visible = true;
//var twsep:Tween = new Tween(sep1, "_y", Regular.easeOut, 0, 92, 1, true);
this.logoLoader.loadMovie(picHolder.attributes.logo);
//animation effects for the new movieclips
var twlh:Tween = new Tween(logos, "_y", Strong.easeOut, 0, 25, 1, true);
var tlogo:Tween = new Tween(logos, "_alpha", Strong.easeOut, 0, 100, 2, true);
//create new movie and then load the logos into it.
this.logoHolder.onRelease = campainsLoad;
this.logoHolder.onRollOver = logoRollOver;
this.logoHolder.onRollOut = logoRollOut;
//this.logoHolder.onRelease = thumbscroller;
}
};
menull.mclogo.onRelease = backtomain;
function logoRollOver() {
delete this.logoHolder.onRollOver;
delete this.logoHolder.onRollOut;
//delete this.logoHolder.onRollOut;
for (var i = 0; i<numimages; i++) {
var r_over = home.logos["logo"+i];
//l.theAlpha = l._alpha;
//delete this.logoHolder.onRelease;
//delete _root.onEnterFrame;
if (r_over != this) {
//var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
//var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
var twrov:Tween = new Tween(r_over, "_alpha", Strong.easeOut, r_over._alpha, 100, 1, true);
twrov.onMotionFinished = function() {
r_over._alpha = 100;
};
}
}
this.logoHolder.onRollOut = logoRollOut;
}
function logoRollOut() {
delete this.logoHolder.onRollOver;
delete this.logoHolder.onRollOut;
for (var i = 0; i<numimages; i++) {
var r_out = home.logos["logo"+i];
r_out.theAlpha = r_out._alpha;
//delete this.logoHolder.onRelease;
//delete _root.onEnterFrame;
if (r_out != this) {
//var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
//var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
var twrou:Tween = new Tween(r_out, "_alpha", Strong.easeOut, r_out._alpha, 25, 1, true);
} else {
}
}
this.logoHolder.onRollOver = logoRollOver;
}
//loads CAMPAINS
function campainsLoad() {
delete this.logoHolder.onRelease;
for (var i = 0; i<numimages; i++) {
var t = home.logos["logo"+i];
//delete this.logoHolder.onRelease;
//delete _root.onEnterFrame;
if (t != this) {
//var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
//var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
var twal:Tween = new Tween(t, "_alpha", Strong.easeOut, 100, 25, 1, true);
} else {
t._alpha = 100;
}
}
cmp_stat._x = 25;
cmp_stat._y = 30;
cmpspacing = 70;
WHATXML.load("newmcwhat2.xml");
WHATXML.onLoad = function() {
numcamps = this.firstChild.childNodes.length;
for (i=0; i<numcamps; i++) {
cmpNodes = this.firstChild.childNodes*;
this.cmpHolder = _root.cmp_stat.createEmptyMovieClip("cmp"+i, i);
this.cmpHolder._x = i*cmpspacing;
this.cmpHolder.campain = cmpNodes.attributes.campain;
this.cmpLoader = this.cmpHolder.createEmptyMovieClip("cmp_mc"+i, i);
campains_txt = this.cmpHolder.createTextField("cmp_txt"+i, i, 3, 55, 140, 16.1);
campains_txt.text = (cmpNodes.attributes.campain);
var tcamp:Tween = new Tween(campains_txt, "_alpha", Strong.easeOut, 0, 100, 30, false);
campains_txt.embedFonts = true;
campains_txt.antiAliasType = "advanced";
var campains_fmt:TextFormat = new TextFormat();
campains_fmt.color = 0x828282;
campains_fmt.size = 11;
campains_fmt.font = "Verdana";
campains_fmt.align = "left";
campains_txt.setTextFormat(campains_fmt);
this.cmpHolder.onRelease = thumbscroller;
}
};
this.logoHolder.onRelease = campainsLoad;
}