all groups > flash actionscript > november 2005 >
You're in the

flash actionscript

group:

Very urgent help - I don't know how to explain


Very urgent help - I don't know how to explain Pluda
11/9/2005 10:47:35 PM
flash actionscript:
Hello,

I'm facing a big problem here, I don't know very well how to explain, I know
the bug is in the posted code (for creating my details movieclip), since if I
don't run it everything works fine.

The situation:

I've one array and I create some movieclips.
If I dont click on any image everything works good, but

If I click one one I create another movieclip (details) and when I press on
the close button and then choose another category in the tree component my
previous choosed item remains in stage and the newer movieclips don't place in
_x in that line


Please visit this site, you will untherstand it better ,ok?

http://www.orcopom-uniformes.com/catalogo/catalogo.htm (play with it, you
will see my problem)

Many thanks!

with (_root) {
createEmptyMovieClip("mc_detalhes", 125000);
mc_detalhes._x = 7.5;
mc_detalhes._y = 145;
//
round_corners(mc_detalhes, 568, 240, 2.50, 0xA60F38, 100, 0xFFFFFF,
100, 12);
//
mc_detalhes.createEmptyMovieClip("imagem", 125001);
mc_detalhes.imagem._x = 336;
mc_detalhes.imagem._y = 29;
//
mc_detalhes.createEmptyMovieClip("mascara", 125002);
//
mc_detalhes.mascara._x = mc_detalhes.imagem._x;
mc_detalhes.mascara._y = mc_detalhes.imagem._y;
//
round_corners(mc_detalhes.mascara, 193, 193, 0.50, 0xA60F38, 0,
0x452E2E, 0, 12);
//
mc_detalhes.createEmptyMovieClip("contorno", 125003);
//
mc_detalhes.contorno._x = mc_detalhes.imagem._x;
mc_detalhes.contorno._y = mc_detalhes.imagem._y;
//
round_corners(mc_detalhes.contorno, 193, 193, 0.50, 0xA60F38, 50,
0x452E2E, 0, 12);
//
imagem = detalhes.imagem;
//
preload(mc_detalhes.imagem, "/pics/imagens/"+imagem, 125004, 1000,
(71.5), (92.5));
//
mc_detalhes.imagem.onEnterFrame = function() {
if (check_progressao == false) {
trace("Ainda n?o fiz o preload!");
} else {
delete (this.onEnterFrame);
}
};
// Importante esta coloca??o, o set mask tem de estar fora do
onEnterFrame
mc_detalhes.imagem.setMask(mc_detalhes.mascara);
//
mc_detalhes.createTextField("tit", 125005, 29, 29, 288, 30);
mc_detalhes.tit.text = detalhes.tit;
mc_detalhes.tit.selectable = false;
mc_detalhes.tit.setTextFormat(ft);
//
mc_detalhes.createTextField("descricao", 125006, 29, 69, 288, 182);
mc_detalhes.descricao.selectable = false;
mc_detalhes.descricao.multiline = true;
mc_detalhes.descricao.wordWrap = true;
mc_detalhes.descricao.html = true;
txt = unescape(detalhes.texto);
mc_detalhes.descricao.htmlText = "<font face='Arial' color='#990000'
size='14'>Refer?ncia: </FONT><font face='Arial' color='#000000'
size='12'>"+detalhes.ref+"</FONT><BR><font face='Arial' color='#990000'
size='14'>Descri??o: </FONT><font face='Arial' color='#000000'
size='12'>"+txt+"</FONT><font face='Arial' color='#990000' size='14'>Tamanhos:
</FONT><font face='Arial' color='#000000'
size='12'>"+detalhes.tamanhos+"</FONT><BR><font face='Arial' color='#990000'
size='14'>Cores: </FONT><font face='Arial' color='#000000'
size='12'>"+detalhes.cores+"</FONT><BR><font face='Arial' color='#990000'
size='14'>Materiais: </FONT><font face='Arial' color='#000000'
size='12'>"+detalhes.materiais+"</FONT><BR><font face='Arial' color='#990000'
size='14'>Norma(s) CE: </FONT><font face='Arial' color='#000000'
size='12'>"+detalhes.norma+"</FONT>";
//
mc_detalhes.createEmptyMovieClip("risco", 125007);
mc_detalhes.risco._x = 29;
mc_detalhes.risco._y = 59;
round_corners(mc_detalhes.risco, 288, 1, 0.50, 0xA60F38, 100,
0x452E2E, 0, 0);
//
mc_detalhes.createEmptyMovieClip("fechar", 125008);
mc_detalhes.fechar._x = 539;
mc_detalhes.fechar._y = 14.5;
round_corners(mc_detalhes.fechar, 10, 10, 0.50, 0xA60F38, 100,
0xA60F38, 100, 0);
//
mc_detalhes.fechar.createEmptyMovieClip("r_cruz", 125009);
mc_detalhes.fechar.r_cruz._x = 2;
mc_detalhes.fechar.r_cruz._y = 1.5;
round_corners(mc_detalhes.fechar.r_cruz, 9, 1, 0.50, 0xFFFFFF, 100,
0xFFFFFF, 100, 0);
mc_detalhes.fechar.r_cruz._rotation = 45;
//
mc_detalhes.fechar.r_cruz.duplicateMovieClip("rr_cruz", 125010);
mc_detalhes.fechar.rr_cruz._x = 1.8;
mc_detalhes.fechar.rr_cruz._y = 7.85;
mc_detalhes.fechar.rr_cruz._rotation = -45;
//
mc_detalhes.fechar.onRelease = function() {
mc_detalhes.swapDepths(1048575);
mc_detalhes.removeMovieClip();
//
_root.produto0.btn.enabled = true;
_root.produto1.btn.enabled = true;
_root.produto2.btn.enabled = true;
_root.produto3.btn.enabled = true;
_root.produto4.btn.enabled = true;
_root.produto5.btn.enabled = true;
_root.produto6.btn.enabled = true;
//
_root.mais.btn_mais.enabled = true;
_root.menos.btn_menos.enabled = true;
//
_root.menu.enabled = true;
};
Re: Very urgent help - I don't know how to explain Chip W.
11/9/2005 11:45:46 PM
Hey Pluda,

In messing with your menu system, I've noticed that when I click on a
thumbnail, I open up a detail picture, I then click on close, select another
menu item, and the thumbnail that gets stuck on top of the menu system will
have the same ID as the thumbnail of the detail picture I just closed. If I
select 5 details, all 5 thumbnails stick on top of the menu. There is also so a
wierd depth problem going on, i.e. - the detail picture appears underneath of
the thumbnails occassionally.

Looking though your code, the first bit that strikes me is this bit:

mc_detalhes.fechar.onRelease = function() {
mc_detalhes.swapDepths(1048575);
mc_detalhes.removeMovieClip();

I assume this is the close button for your detail picture. You are swapping
the depths of the detail picture to the absolute highest level and then
removing it afterwards? If this is the case, eliminate swapping and removing,
and just remove instead:

i.e. -

mc_detalhes.fechar.onRelease = function() {
//mc_detalhes.swapDepths(1048575); - this line doesn't seem to be needed,
unless I'm missing something crucial
mc_detalhes.removeMovieClip();

If this isn't the code for the close button, post the code for closing the
detail picture, seems that's where your problem lies.

~Chipley

BTW - That's a nice app you got goin on there



Re: Very urgent help - I don't know how to explain Pluda
11/10/2005 12:21:27 AM
Hello, thanks for reply :-)

Yes, that is the piece of code to close the details,
If I don't use the mc_detalhes.swapDepths(1048575); the remove does't work
because of the tree component (those components are very messy - hello
Macromedia?) :-(

I'm assuming the problem is indeed in that litle piece of code, but I just
don't know what else should I try...

Now I'm making one html popup to show the details, since my client is mad with
me...
That is why I say in the topic very urgent

I think I'm going to make the html work and then I will recode that again.

Have you see the entire site?
many flash there, thanks for cumpliment :-)
AddThis Social Bookmark Button