PDA

View Full Version : Why must i select item twice?


Jean Jacques
05-12-2003, 09:31 PM
Problem: i must select twice the item in the ComboBox instead of once :(


stop();
// Place and Load Extern Picture
movieclip.prototype.loadPicture = function (obj,img,posx,posy) {
obj.loadMovie(img);
obj._x = posx;
obj._y = posy;
}

function loadGallery(gNr){
n = 0;
p = 0;
_root.place = _root["place"+gNr];
_root.shortplace = _root["shortplace"+gNr];
_root.number = _root["number"+gNr];
trace(_root.place);
for(i=1; i<=8; i++){
loadPicture(this["pict"+i],"url/gallery/"+_root.place+"/2003F3"+_root.shortplace+"00"+i+"klein.jpg",(185+n),(141+p));
//* buttons for gallery
attachMovie("gButton", "gButton"+i, i);
this["gButton"+i]._x=(185+n);
this["gButton"+i]._y=(141+p);

if(i < 4){
n = n + 80;
} else if(i==4) {
n = 0;
p = 50;
} else {
n = n + 80;
}
}
}
// call function gallery
loadGallery(_root.lg);

function loadContent(){
_root.lg = gallery.getSelectedItem().data;
loadGallery(_root.lg);
trace("lg = " + lg);
}

gallery.setChangeHandler("loadContent");


I get no error message when i select (once) an item from the comboBox. But the pictures were not shown. I select again an item and there it is!

Need some help to fix this.
Cheers

Jean Jacques
05-13-2003, 06:33 PM
No one has got seen this problem?

I'm still searching to fix this but can't see the solution.

Jean

magicwand
05-13-2003, 07:17 PM
if you post your fla someone might help you better.

Jean Jacques
05-15-2003, 07:51 PM
You're absolutely right, here is the FLA.
If anyone can see an other solution, your welcome.
But i can't fix the double select in the combobox.

gallery.fla (http://www.jeanjacques.nl/gallery_jean.zip)

Jean

Jean Jacques
05-16-2003, 06:50 AM
Did I find a bug? Or nobody knows?

Cheers,
Jean

CyanBlue
05-16-2003, 10:28 AM
Hm... I've been playing with your file for about an hour and I have no clue... I'd love to know who and how solves the problem...

I think the problem goes with the loadMovie() function call... But I am not sure... The problem was that loadMovie() gets fired every other times... It didn't matter if the previous selection and the next selection are the same or not...

Hm... :confused:

hangalot
05-16-2003, 11:33 AM
aaai, its those little things hey...

u load these movies, then load the image in them directly. now, i maybe wrong in how i intepret this, but when loading a jpeg directly i get the feeling the MC's behaviour internally changes. as a rule of thumb i would 99.9% of the time load an image into an empty MC, and changing your one function which loads the img to this cater for this yielded results


movieclip.prototype.loadPicture = function (obj,img,posx,posy) {
obj.createEmptyMovieClip("iMg",1);
obj.iMg.loadMovie(img);
obj._x = posx;
obj._y = posy;
}



the positions r now screwed but...;)

farafiro
05-19-2003, 09:24 AM
yeah, hangalot is right
so, either stick to his solution or make an if() statment to hold the code for a while

Jean Jacques
05-19-2003, 10:23 PM
Wowh! Thanks a lot guys, specially Hangalot!

CyanBlue
05-19-2003, 11:40 PM
I still don't get it... Hm...

farafiro
05-20-2003, 08:13 AM
hey Cyan
It's the basic rule, u can't give an action to an object unless it's on the stage
more like this
http://www.actionscript.org/forums/showthread.php3?s=&threadid=27555&highlight=farafiro