-
Controlling MCs with JS
Hi all,
I'm trying to get my head around Toolkit for CreateJS and am having problems getting to grips with the facility that exists for writing JS code directly into the Flash environment (so that when it's all published via the Toolkit for CreateJS extension it's ready to run). Sooooooo... does anyone have any idea how I can control the play/stop of a mc on the main time using the following tags?
Everything seems to work fine if, say, I have a instance of 'btn_mc' on the main timeline and when it's clicked the main timeline plays at 'frame_whatever_label' e.g.
Code:
/* js
this.onClick = function() {
this.gotoAndPlay("frame_whatever_label");
}
*/
The above's no problem, runs like a dream. My difficulties lie in failing to grasp how to use a specific mc instance on the main timeline to control another mc instance on the main timeline. The normal way that it might have been targeted with actionscript doesn't seem to bear much relation to what the path should be in javascript... although this is probably down to me just being an ignoramus.
See what I tried doing was...
Code:
/* js
this.btn_mc.onClick = function() {
this.other_mc.gotoAndPlay("frame_whatever_label");
}
*/
Anyway, apparently what I wrote there is absolute cobblers 'cos the published output is having none of it.
I've obviously got a slash or a dot in the wrong place (or something!). Can anyone through an light on the matter?
Cheers in advance for any help x
-
Can anyone throw any light on the matter - not "Can anyone through an light on the matter"... sigh, it's been a long four days!
-
Originally Posted by Fran
Can anyone throw any light on the matter - not "Can anyone through an light on the matter"... sigh, it's been a long four days!
No. According to the times and dates when this part I was quoting when posted its been 32 minutes. -.-
-
Haha, I'd been working on it for four days before I even posted up! Lack of sleep, it's good if you learn to love it ;-)
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
|