Graph Opinion

Well you have a nice holiday too :flower:

Thanks for all your help, now don’t go and change your username on me while I am gone so that I can’t find you when I get back…

Well I am back to work, :upset: and reality. Anyway I am not ready to bombard you with questions, but according to your profile, today is your birthday so I wanted to wish you Happy Birthday. :party: Enjoy!

Thankyou
I had forgotten until i logged in to the forums!

LOL well I hope you were not trying to forget and then I had to go and spoil things by reminding you, because I am to the point where I have decided that I am no longer going to acknowledge mine :wink:
anyway…I suppose I really should be working…

No, not deliberate.
People of my age just don`t care + our memories are poor anyway.

Well your memory can’t be that bad considering all the information you bring to the forum!

You said that when I am trying load the fancy graphics and make them invisible, I only need one function to do that, and then possibly put the swf’s in an array and loop through it. I think I can tackle that part, but where I get really messed up is the idea of the empty movie clips that the swf’s are loaded in to. I know that each one will need it’s own, so that will be an array of it’s own, correct? I will set up a loop to create the amount of emptymc’s I need, then another array that loads an swf into each clip, and have the function which sets them all to invisible looping through the correct amount of times as well.

Then, when some one chooses a question, I will have to have assigned each clip an ivar that can be used to load the correct image with the correct question, as you did with the actual questions.

if you put the fancy graphics into swfs on the second frame(with a stop action on the first), you could just load them in and tell them to gotoAndStop(2) whenever needed.
Not sure you need a seperate array
while you are looping through your states you could do something like this
for(blahblah…)
createEmptyMovieClip(“clip”+i, i+500);
this[“mystate”+i].ivar = i;
this[“mystate”+i].Klip = this[“mystate”+i]._parent[“clip”+i];

so then if you put inside the state.onPress function
trace(this.klip) you may be able to see how it works.

alright when I do that it returns undefined, is that correct or should it be returning a value? (of the emptyMovieClip)

I think you know the answer to that.

Soryy Jillymo but i have sort of lost the plot a little with this (+ being another year older doesn`t help).Can you copy/paste what you have on the main timeline so maybe i can see what is happening.

No need for apologies. Here is what I have, it is a big mess. I also have one state that is not doing anything which adds to my huge frustration at this point I am feeling like I just can’t do this. I am definately the one who should be apologizing for asking you to hold my hand through every single step I try to make with this thing!!

//setting color property for color buttons
color0.col = 0xFF0000;
color1.col = 0x4646D1;
color2.col = 0xFFFF66;
color3.col = 0x009900;
color4.col = 0xFF9900;
wronganswercolour = 0x999999;
//defining arrays referred to later on
questions = [];
answers = [];
myArray = [];
myOpponentsArray = [];
pressedArray = [];
correctanswer = [];
images = [];
//load artwork swf’s
//yes you have got the right idea.its actually possible to load them all
//sequentially but then if a user chooses a question while loading then
//the order change and that “fancy graphic” will load first.Probably
//better just to see how you get on. You only need the one function to make
//invisible,maybe put all the swfs into an array and loop through that.

function loader(clip) {
if (clip.getBytesLoaded()>=clip.getBytesTotal() && clip.getBytesLoaded()>1) {
clip._visible = false;
clearInterval(myInterval);
}
}
createEmptyMovieClip(“clip1”, 1);
clip1._x = 168.5;
clip1._y = 176;
loadMovie(“image29.swf”, clip1);
myInterval = setInterval(loader, 50, clip1);

//testing createEmptyMC for onPress
for(var v = 19; v<48; v++) {
createEmptyMovieClip(“clip”+i, i+500);
this[“mystate”+v].ivar = v;
this[“mystate”+v].Klip = this[“mystate”+v]._parent[“clip”+v];
}
//gathering name information setting color
finalName = “Please enter your name”;
for (var c = 0; c<5; c++) {
this[“color”+c]._visible = false;
}
reset._visible = false;
submit.onRelease = function() {
finalName = “Hello “+inputName+”, Please choose your campaign color”;
input._visible = false;
reset._visible = true;
submit._visible = false;
for (var c = 0; c<5; c++) {
this._parent[“color”+c]._visible = true;
}
};
//in the following, i have just looped through to give values to questions answers etc
//when you come to make it properly, you can take there out of the loop and just type
//them in as we did before
//states 0 through 18 should not be affected by this
//because it is only set for 19 through 47
for (var i = 19; i<48; i++) {
questions.push(“This is question”+i);
correctanswer.push("answerA "+i);
myA = ["answerA "+i, "answerB "+i, "answerC "+i, "answerD "+i];
answers.push(myA);
this[“mystate”+i].ivar = i-19;
this[“mystate”+i].onRollover = function() {
this._alpha = 30;
};
this[“mystate”+i].onRollout = function() {
this._alpha = 100;
};
this[“mystate”+i].onPress = function() {
this._alpha = 100;
this.onRollOver = undefined;
this.onPress = undefined;
pressedArray.push(this);
myclip = _root.attachMovie(“mystatequestion”, “question”, i+10);
myclip.myText.text = questions[this.ivar];

    //the following lines are for the benefit of your components
	//may be a better way 
	_root.k = this.ivar;
	comp0var = answers[this.ivar][0];
	comp1var = answers[this.ivar][1];
	comp2var = answers[this.ivar][2];
	comp3var = answers[this.ivar][3];
	trace(comp3var);
	trace(this.klip);
	myclip = _root.attachMovie("mystatequestion", "question", i+10);
	_root.question._x = 600;
	_root.question._y = 400;
	_root.clip1._visible = true;
	for (var n = 19; n&lt;48; n++) {
		this._parent["mystate"+n].enabled = false;
	}
};

}
//questions = [“is this the first state chosen?”, “2.what shape is this?”, “3.what direction is this?”, “4.who lives here?”, “5.who lives here?”, “6.who lives here?”, “7.who lives here?”, “8.who lives here?”, “9.who lives here?”];
//answers = [[“this is the first state”, “this is not the first state”, “this is not the first state”, “this is not the first state”], [“square”, “oval”, “triangular”, “who cares”], [“North”, “South”, “East”, “West”], [“The president”, “The presidents fancy piece”, “nobody”, “don`t know”]];
//correctanswer = [“this is the first state”, “square”, “East”, “nobody”, “nobody”, “nobody”, “nobody”, “nobody”, “nobody”, “nobody”];
stop();
for (var s = 0; s<19; s++) {
myArray.push(this[“mystate”+s]);
}
for (var g = 0; g<myArray.length; g++) {
myArray[g][“myColour”+g] = new Color(myArray[g]);
myArray[g].col = myArray[g][“myColour”+g].getTransform();
}
for (var j = 0; j<5; j++) {
this[“color”+j].onPress = function() {
for (var i = 0; i<myArray.length; i++) {
myColour = new Color(myArray*);
myColour.setRGB(this.col);
_root.maincolor = this.col;
}
};
for (var l = 0; l<myArray.length; l++) {
myArray[l].onPress = function() {
myArray[l].enabled = false;
};
}
}
reset.onPress = function() {
input._visible = true;
inputName = ""
finalName = “Please enter your name”;
reset._visible = false;
submit._visible = true;
for (k=0; k<myArray.length; k++) {
myArray[k][“myColour”+k].setTransform(myArray[k].col);
}
};
//setting color of opponents states
for (var t = 19; t<48; t++) {
myOpponentsArray.push(this[“mystate”+t]);
}
for (var u = 0; u<myOpponentsArray.length; u++) {
myOpponentsArray[u].myColor = new Color(myOpponentsArray[u]);
myOpponentsArray[u].myColor.setRGB(0x999999);
};
_root.total = 0
_root.totalquestions = 0

for(var v = 19; v<48; v++) {
createEmptyMovieClip(“clip”+i, i+500);

the i should be a v.

perhaps you might be better just creating one movieclip to load into, it will be simpler.
If you want to email me the file,i`ll see if i can sort out any other bugs-its a little difficult just from looking at code.

oh my goodness how dumb can I be…please don’t answer that

I thought I had tried changing it all the v rather than “i” and I got so frustrated I did not even notice that I hadn’t changed it all.

It seems pretty simple with the concept of creating one emptymc, loading the swf into it, hiding it, then showing the clip when a question is clicked on and hiding it when an answer is chosen.

It’s all this doing it muliple times and then trying to coordinate what gets pulled with what gets click that gets complicated. Not that I even need to say that.

Well let me go on and see where I can go from here.

Thank you!!!

one more thing I forgot to say- how would it work if I create just one movie clip to load into? Once I load a new swf into that same holdermc, it replaces (unloads) the previous swf, correct? So that is why I think I cannot do that.

I make those type of mistakes too.
The hardest thing is changing the order of loading movies if the user clicks on a state which has not already loaded.It involves quite a bit of code.

If you load into one clip, it will mean not loading until the user presses on a state.Then you could make some sort of transition (most people just fade in/fade out but you could do something different).

Well that sounds much more managable from my standpoint, and so far the “fancy graphic” files have been small file sizes so they should not take that long to load. I think the largest one so far is 12k. I would use a preloader, but my boss does not like them.

There are tons of tutorials on this sort of thing but maybe this will help
http://www.gifsrus.com/testfile/fancyG.zip

Well I appreciate your fla because I did plenty of searching for a tut on this topic and was not able to locate such a thing…maybe I was trying to be too specific?

If and when you have time and if you choose to spend it doing so, could you please take a look at this fla? I am trying to figure out why South Carolina is not doing anything! It should be set to the dark gray color along with the rest of the states that are part of myOpponentsArray. I have looked at it and cannot figure it out.

South Carolina = mystate32
I have checked the linkage, the instance name…and myOpponents Array is supposed to be mystate19 through mystate47…so it seems strange that it is a middle number like that.

here is the fla

also, don’ t think I did not notice you showing off with your fancy graphics in your latest example :wink: Nice job!

My fancy graphics are just preset things-about as fancy as i get.

That took some tracking down. You have mystate44 labelled as mystate32.
Looks pretty good now.

when you come to load your external files in, you may want to move some of the code so that your questions appear after your fancy graphics.

Now you did not have to confess about your graphics, I would have never known the difference. I really appreciate you taking a look at the file. I swore up and down that I checked that things were labeled right…again one of those dumb mistakes!

About moving some of the code so that the questions come in after the fancy graphics- I really don’t mind that they come in right at the same time. (unless I am told any different) I think the problem may only occur if there is a delay with the loading of the graphic. You can see in this test file that the fancygraphic.swf loads rather quickly.(but this is with no fading, etc) I must have done something along the way to screw up the actual question text loading or showing up thought. But anyway you get the idea.
Thanks again

That sort of mistake, “typo” is often the most difficult to track. I found it by using the debug thing but took a little time.
The swf you uploaded looks and works fine. Are you feeling a little more confident about completing this project now?