Var Identification Question
Working on this function... and Im trying to replace the imageMC1variable with a variable that will increase by one automatically...
code: function display(thumbImages) {
len = thumbImages.length;
trace(len+" array length");
this.back_btn._alpha = 0;
i = 0;
if (len>=5) {
this.next_btn._alpha = 100;
this.next_btn.onPress = function() {
nextDisplay(thumbImages);
};
}
this.img_layer = 0;
this.img_layer++;
_root.createEmptyMovieClip("imageMC1", img_layer);
// thumbnails placement
imageMC1.loadImage(thumbImages[this.i], "thumb1", 654, 39.7, img_layer++);
this.i++;
_root.createEmptyMovieClip("imageMC2", img_layer++);
imageMC2.loadImage(thumbImages[this.i], "thumb2", 654, 112.3, img_layer++);
this.i++;
_root.createEmptyMovieClip("imageMC3", img_layer++);
imageMC3.loadImage(thumbImages[this.i], "thumb3", 654, 185, img_layer++);
this.i++;
_root.createEmptyMovieClip("imageMC4", img_layer++);
imageMC4.loadImage(thumbImages[this.i], "thumb4", 654, 257.6, img_layer++);
this.i++;
_root.createEmptyMovieClip("imageMC5", img_layer++);
imageMC5.loadImage(thumbImages[this.i], "thumb5", 654, 330.3, img_layer++);
what I am trying to do is get the "imageMC#" to increase by one (++) within the following statement...
_root.createEmptyMovieClip("imageMC1 ", img_layer);
I need to know how to increment the var name within the function automatically... instead of having to note it for each createEmptyMovieClip event.. ie. imageMC1, imageMC2, imageMC3 etc .. like I have done with the thumbImages[this.i], using the i++
but I'm having difficulty figuring this one out...
and if this can be done... I'd also love to know how to identify the increment var in the following statement where noted:
imageMC1.loadImage(thumbImages[this.i], "thumb5", 654, 330.3, img_layer++);
Any suggestions are greatly appreciated.
kim@frustrated-inc.com
Identification Text
I am making a website with a secure area. When the users log into the secure area I want a line of text to pop up that says hey "uername".
I am using actionscript.
onClipEvent (load) {
if (user.text eq "user 1") {
gotoAndStop(1);
} else if (user.text eq "user 2") {
gotoAndStop(2);
} else if (user.text eq "user 3") {
gotoAndStop(3);
} else if (user.text eq "user 4") {
gotoAndStop(4);
}
}
The user.text is an input text box from another scene. I saved the line of text i want to say hi, as a movie, and each frame has a different users name typed in. What do i need to add to make the movie work cause now when i log in, no matter what user the movie just keeps playing through and repeats itself, but i already tried putting in stop actions in the movies itself, and it just stopped at the first movie it came to. But i want it to jump to different frames according to what is typed in the user.text input box in scene 2.
VIN (Vehicle Identification Number) Verification Class
validate_us_vin.as => a VIN (Vehicle Identification Number) verification class.
This is a small class in AS2 that I wrote based on an existing JS example that can be found at SourceForge.net. It allows you to verify if a certain VIN is valid and also contains function that will return Make / Year info based on it.
*Note: it works only for the vehicles on the US market.
I think it would be a useful tool when developing a vehicle related site / app.
Usage:
Code:
var vin_class= new validate_us_vin(); // init class
var boo:Boolean= vin_class.validate_vin(VIN);// Boolean value retunred weather it is a valid VIN or not (true | false)
var _obj:Object= vin_class.make_model(VIN);// An objekt with string values of Year and Make returned: _obj.make | _obj.year
you can download the package with an example here:
http://flashmx.us/classes/USA_VIN_Check.zip
Hope you’ll like it.
Nick