Skip to main content
Known Participant
January 13, 2010
Answered

bar dont change anymore?

  • January 13, 2010
  • 1 reply
  • 623 views

I have a function created to listen to the stage and adjust the bar width to the stage width. (frame 1 maintimeline)

this works perfectly tho, until i go to other labels on the main time line. then if i resize the window the bar width dont adjust anymore and leaves to the last width.... why is that? i tried mostly what i could think of... placed the events between the init function, put extra keyframes etc...

what am i actually missing? i really want the bar width  changed where-ever i go in my content and whenever i am changing the window...

stage.addEventListener(Event.RESIZE, changeBar);

stage.dispatchEvent(new Event(Event.RESIZE));

function changeBar(e:Event) {

barH_mc.width = stage.stageWidth;

barH_mc.x = 0;

}

This topic has been closed for replies.
Correct answer kglad

i'm not sure you have to put that bar movieclip on every frame but i am sure that if you navigate to frame when bar does not exist all code that previously applied to bar will no longer apply.

and using the visible property is a good way to hide a displayobject when you don't want it to be seen.   removing it from the displaylist is another good way to hide it.

1 reply

kglad
Community Expert
Community Expert
January 13, 2010

is there any frame where barH_mc doesn't exist?  if yes, that's probably the problem.

Known Participant
January 14, 2010

thanks for the reply.

If i am correct, I have to put everthing from frame1 till the end of the maintimeline to make this work.

so for other contents i dont wanna see I have to use the .visible value to hide/show unwanted content/movieclips...

is there maybe some other tricks to orden it , then just using .visible ?

tnx again

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
January 14, 2010

i'm not sure you have to put that bar movieclip on every frame but i am sure that if you navigate to frame when bar does not exist all code that previously applied to bar will no longer apply.

and using the visible property is a good way to hide a displayobject when you don't want it to be seen.   removing it from the displaylist is another good way to hide it.