//put this in the main time line on a frame
//change "thumb" to the path to your thumb
thumb.onRelease = function() {
preload("ProjectFrame.swf", dream1);
};
function preload(clip, vari) {
var temp = this.createEmptyMovieClip("temp", 999);
blank.loadMovie(clip);
temp.onEnterFrame = function() {
if (blank._width) {
//this will set variable 'thumb' inside ProjectFrame.swf
blank.thumb = vari;
delete this.onEnterFrame;
}
};
}
Oh man scotty that looks great the thumbnails currently have rollovers in them as their basically just movieclips is there a way i can target the rollover from this code as well. The label inside is called “over”
};
function preload(clip, vari) {
var temp = this.createEmptyMovieClip(“temp”, 999);
blank.loadMovie(clip);
temp.onEnterFrame = function() {
if (blank._width) {
//this will set variable ‘thumb’ inside ProjectFrame.swf
blank.thumb = vari;
delete this.onEnterFrame;
}
};
}
Okay it works perfectly as far as opening up the movieclip projectframe.swf but its still telling me the variable is undefined.
Where in the code do I put where it sets the var THUMB when the button is clicked im assuming its this spot:
preload(“ProjectFrame.swf”, [COLOR=darkred]tech1[/COLOR]);
Now [COLOR=darkred]tech1[/COLOR] is the variable Im trying to pass but its not passing it.
Scotty please dont hate me forever cause im so lame at this stuff but It still is telling me the variable is undefined when I export it.
In the Main.swf I have this Actionscript:
tech.main2.buttech1.onRelease = function() {
preload(“ProjectFrame.swf”, “tech1”);
};
function preload(clip, vari) {
var temp = this.createEmptyMovieClip(“temp”, 999);
blank.loadMovie(clip);
temp.onEnterFrame = function() {
if (blank._width) {
blank.setvar(vari);
delete this.onEnterFrame;
}
};
}
And then in frame 15 of projectframe.swf I have this:
Now I could just be completely dumb but should I be changing somewhere that I am setting the variable Vari to equal tech1 when the button: buttech1is pressed. Cause right now I dont see where its defining either the variable “vari” or the variable “thumb”??
iIn Projects fla, skip all actions you have on the (tech) buttons and rename buttech1 to tech1.
Change the code in frame 64 (main timeline) like this
stop();
if (_global.project == 1) {
tech.gotoAndPlay(2);
}
if (_global.project == 2) {
dream.gotoAndPlay(2);
}
for (var i = 1; i<=6; i++) {
var btn = tech.main2["tech"+i];
btn.id = i;
btn.onRollOver = function() {
this.gotoAndPlay("over");
};
btn.onRelease = function() {
preload("ProjectFrame.swf", "tech"+this.id);
};
}
function preload(clip, vari) {
var temp = this.createEmptyMovieClip("temp", 999);
blank.loadMovie(clip);
temp.onEnterFrame = function() {
if (blank._width) {
blank.setvar(vari);
delete this.onEnterFrame;
}
};
}
In ProjectFrame in make an empty mc (instance name ‘container’) and put it where you want the topleft of your picture (it’s now in a masked layer called container)
In frame1
var pic;
function setvar(vari) {
pic = vari+".jpg";
}