flash (macromedia):
Hello all. I am a FLASH 5 person and recently started working with FLASH MX Pro 2004 ED. The UI is definitely a bit different and as I go to tell a button to play movie clip, I find myself not able to. I have been out of development for about a year and I seem to recall using telltarget to load a movie clip that was on the stage. Is there a different way to do this in FLASH MX? Thanks.
you can still use tellTarget even though its not in the script. The new option is .root or _root.
adding _root to your path, and target that labeled frame rather than your old frame number...for example: on (press) { _root.gotoAndPlay("my_target"); } hope that helps.
Thanks for the quick response. I am still having problems with getting the button to call the movie. I know the movie is on the stage and I've checked the timeline and it's correct. Could someone refresh my memory on what the action would look like to call a movie on the stage with a button? Thanks.
use the code i sampled above...make sure you name the instance for that movie clip, and call that instance. In the example I used "my_target" so for example: you have created a movie clip that pops up. call the instance "popup" then you create a button to call that clip. on the button put the following action (if you still want to use tellTarget): on (press) { tellTarget(_root.popup.play()){ } } if not then use on (press) { _root.gotoAndPlay("popup"); }
I have used the example for TellTarget you posted and I got this message. on (press) { tellTarget(_root.topshutter.play(1)){ } } I got this message when I click the button. Target not found: Target="undefined" Base="_level0"
try this code instead on (press) { tellTarget("_root.topshutter"){ gotoAndPlay(2); }
used the last script you posted and got this right when it previewed **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Statement block must be terminated by '}' on (press) { **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 4: Syntax error. } Total ActionScript Errors: 2 Reported Errors: 2 I can send you the fla if you want.
1. give your button an instance name such as "myButt" 2. give your target an instance name such as "myTarget" 3. on frame 1 of your movie, NOT ON YOUR BUTTON place this code: myButt.onPress = function(){ myTarget.play(); } [quoted text, click to view] "TripapHoniC" <webforumsuser@macromedia.com> wrote in message news:bsvraf$3um$1@forums.macromedia.com... > used the last script you posted and got this right when it previewed > > **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Statement block must be terminated by '}' > on (press) { > > **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 4: Syntax error. > } > > Total ActionScript Errors: 2 Reported Errors: 2 > > > I can send you the fla if you want. > >
you have to put another } at the end of the code. so it should look like this on (press) { tellTarget("_root.topshutter"){ gotoAndPlay(2); } }
I got it to work with on (press) { tellTarget (_root.topshutter.play(1)) { } } however, when I preview it and click the button I get this error. Target not found: Target="undefined" Base="_level0" Target not found: Target="undefined" Base="_level0" It shoots both those errors up at the same time everytime I push the button. The shutter works great and I think it will not throw an error like that when it's used in the browser but I'd still like to know what causes it. Thanks for all the help guys. Jaysun
Don't see what you're looking for? Try a search.
|