-
mind boggling
code: myMc.myBtn.onRelease = function() {
play();
}
ive got that applied to a frame on my main timeline and for some reason it just wont work..
Ive checked all instance names over and over for spelling mistakes etc..
if i use it inside the movie clip (dropping the myMC bit and adding _parent. before play) it works fine.. and if i use the same script on a different movie clip it also works fine..
what the hell is going on?
-
Humm not 100% sure what's wrong, your code looks ok. Things to try might be;
- make sure that your code is on the first frame where your 'myMC' movie clip appears (otherwise flash doesn't know where to find your myMC movie clip)
- try '_root.play()' instead of just 'play()', that makes sure you're playing the MAIN movie timeline
give those a shot and see if it fixes your problem
-
Originally Posted by EmileKelly
code: myMc.myBtn.onRelease = function() {
play();
}
ive got that applied to a frame on my main timeline and for some reason it just wont work..
Ive checked all instance names over and over for spelling mistakes etc..
if i use it inside the movie clip (dropping the myMC bit and adding _parent. before play) it works fine.. and if i use the same script on a different movie clip it also works fine..
what the hell is going on?
I use empty movie clips to play streamingSound . Are you playing a movie or an mp3?
You might want to change the code to "this." this.myMC.myBtn.OnRelease = etc
Just a thought.
TN
-
rabid_Delineator
yeah a good idea when using inline functions is to be sure to give yourself reference. I think your just losing scope. So one way to fix it would be to declare a variable outside of your event handler like
var ref:Object = this;
then in your function ,
someBtn.somemc.onRelease = function():Void{
ref.play();
};
a cleaner way would be to say
someBtn.somemc.onRelease = mx.utils.Delegate.create(this,mcClick);
function mcClick():Void{
play();
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|