Hello,
i think there is a loop in my head and i couldn't fix a simple problem.
I want to start a sound in a movieclip under a simple condition like here:
//Width = 600
onClipEvent(load){
a = 4;
this._x = -582;
this._y = 117;
}
onClipEvent(enterFrame){
this._x += a;
if (this._x > 171)[
a = 0]
}
so if this._x exceeds 171 or != the sound should start.
I tried a lot, but at all times the sound starts at the beginning of the MC.
Thank You for helping.
Best wishes from Germany
Bansche
Hmmmmm.....
I don't see where you load or play the sound. I see you setting a variable called "a" and the train stops incrementing the ._x when it exceeds 171 but that's all. But assuming you have a sound loaded in a sound object like:
but i tried al lot of things you suggest and i didn't hear sound all the times.
I think this is caused by less knowledge about AS, specially in terms of -_root and these things.
I found at least another way:
in the trainMC i added another frame. Then i added a new MC with a swf including the mp3) inside to this frame.
At first frame i put a stop
and the AS is the following:
onClipEvent(enterFrame){
_root.txt1.text=this._x
this._x += a;
if (this._x > 171){
a = 0
nextFrame()};
}
At this time my solution fits my problem.
Sorry for not understanding Your solution, but i am just an (unemployed) truckdriver in Germany, not a computer specialist
Best wishes from Germany
Bansche