
Welcome Guest
|
#1
|
|||
|
|||
|
dynamic image gallery
My wishes to Flash move for an awesome community. I am a New Media enthusiast and an Architect by profession.
While making my portfolio i am facing a few problems in As. This is an image gallery. I have placed 4 holder-movie clips on stage, and 16 buttons get loaded into each dynamically. my coding wont be as clean as yours, So plz bear..!! Script for holder-movieclips is Actionscript:
for (var i = 0; i<16; i++) {
newThumb = this.attachMovie("th_bl", this._name+"-"+i, i);
trace(this._name+"-"+i);
newThumb._x = ((i%4)*16)-26;
newThumb._y = (Math.floor(i/4)*16)-26;
}
this.hitArea = a_state;
stop();
this.onRollOver = function() {
if (!selected) {
for (var i = 1; i<6; i++) {
var ax = "a"+i;
_root[ax].selected = false;
trace(_root[ax]._xscale);
_root[ax]._xscale = _root[ax]._yscale=75;
_root[ax].gotoAndPlay("out");
_root[ax]._alpha = 50;
}
selected = true;
this._alpha = 100;
this.onEnterFrame = function() {
//if (this._xscale<199) {
this._xscale += (200-(this._xscale))/4;
this._yscale += (200-(this._yscale))/4;
//} else
if (this._xscale>199) {
this._xscale = this._yscale=200;
delete this.onEnterFrame;
}
};
}
//gotoAndPlay("over");
};
//----------------------Define rollout
this.onRollOut = this.onDragOut=function () {
for (var i = 1; i<6; i++) {
var ax = "a"+i;
_root[ax]._alpha = 100;
_root[ax].selected = false;
_root[ax]._xscale = _root[ax]._yscale=100;
_root[ax].onEnterFrame = function() {
if (_root[ax]._xscale<199) {
_root[ax]._xscale += (200-(_root[ax]._xscale))/4;
_root[ax]._yscale += (200-(_root[ax]._yscale))/4;
} else if (_root[ax]._xscale>199) {
_root[ax]._xscale = this._yscale=200;
delete _root[ax].onEnterFrame;
}
};
}
};The AS for the buttons is Actionscript:
stop();
//----------------------Define release
this.onRelease = function() {
if (!selected) {
for (var a = 1; a<5; a++) {
newSet = _root["a"+a];
//trace (newset);
for (var clip in newSet) {
newSet[clip].gotoAndStop("out");
newSet[clip].selected = false;
newSet[clip].useHandCursor = true;
}
}
state_mc.gotoAndStop("visited");
selected = true;
this.useHandCursor = false;
// create place holder movie clip
_root.createEmptyMovieClip("PH_mc", 0);
// create mc that image is loaded into
_root.PH_mc.createEmptyMovieClip("image_mc", 0);
// create mc that has enterFrame event the constantly checks the status of
// the image download and alpha
_root.PH_mc.createEmptyMovieClip("updater_mc", 1);
// load image into the image_mc
_root.PH_mc.image_mc.loadMovie("images/"+this._name+".jpg");
// set initial alpha of image_mc to zero
_root.PH_mc.image_mc._alpha = 0;
alph = 0;
_root.PH_mc.image_mc._alpha = alph;
_root.PH_mc.updater_mc.onEnterFrame = function() {
_root.PH_mc.image_mc._x = 100;
_root.PH_mc.image_mc._y = 100;
alph = alph+20;
_root.PH_mc.image_mc._alpha = alph;
if (alph>100) {
alph = 100;
delete this.onEnterFrame;
}
};
//_parent.content_mc.loadMovie("images/"+_imgLoad+".jpg");
gotoAndStop("selected");
}
};
//----------------------Define rollover
this.onRollOver = function() {
if (!selected) {
_parent.a_state.gotoAndStop (this._name);
gotoAndStop("over");
trace(this._name);
//state_mc.gotoAndStop(this._name);
}
};
//----------------------Define rollout
this.onRollOut = this.onDragOut=function () {
if (!selected) {
gotoAndStop("out");
}
};
//----------------------Define Mousedown
this.onPress = function() {
if (!selected) {
gotoAndStop("down");
}
};if i remove any interactivity(rollovers) from holderclips, the buttons wrok perfect. Also i would like to fade images into each other, i saw a few scripts but could not see any for dynamic loading of images. thanks a lot in advance.. Surdzz |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Dynamic Image Load Centre Issue | leelee | Flash MX ActionScript |
0 | 12-26-2008 01:05 PM |
| Weird Image Gallery problem | angelheart | Newbies |
1 | 02-13-2008 08:56 AM |
| newbie: actionscript image gallery reading from file, but how? | Maceo | Actionscript 2.0 |
5 | 03-18-2006 06:50 PM |
| Dynamic image gallery | pezmannen | Newbies |
20 | 06-14-2004 03:03 AM |
| image gallery | eideteker | Flash MX |
0 | 04-13-2004 12:25 PM |





