divinedesigns1 Posted May 9, 2012 Share Posted May 9, 2012 hey sup guys, i have a quick question, isnt it possible to link a button inside of a movieclip using this script btn1.addEventListener(MouseEvent.CLICK, button1);function button1(event:MouseEvent):void{gotoAndStop(1);} or do i have to do something else to get that button to work inside of the movieclip? Link to comment Share on other sites More sharing options...
justsomeguy Posted May 10, 2012 Share Posted May 10, 2012 The code is generally fine, assuming btn1 is set to the correct object. gotoAndStop may need a different scope depending on what you're trying to do. Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 11, 2012 Author Share Posted May 11, 2012 pretty much what im trying to do is, link btn1 which is in a model movie then in another movie, and when you click on btn1 it takes you to another frame which pulls up a page of some kind, but for some reason that doesnt work Link to comment Share on other sites More sharing options...
justsomeguy Posted May 11, 2012 Share Posted May 11, 2012 Unless that code is running in the scope of the movie that you want to advance then you'll need to tell it which movie you want to control. You should also add some trace statements there to make sure it is calling that function when the button is clicked if you haven't done that. Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 12, 2012 Author Share Posted May 12, 2012 ok thanks, ill try that now Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 14, 2012 Author Share Posted May 14, 2012 ok, i did btn1.addEventListener(MouseEvent.CLICK, button1);function Object(this).mymovie.btn_mc.btn1(MouseEvent){gotoAndStop(20);} and it didnt work pssssh, can you tell me what im doing wrong? Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 14, 2012 Author Share Posted May 14, 2012 ok so i got the links working but now im getting this error TypeError: Error #1010: A term is undefined and has no properties. at office2_fla::mymovie_1/frame1() problem here is i dont have any movie that is named mymovie_1 on frame1, but i have a movie called mymovie on frame1 thohow do i fix this error? Link to comment Share on other sites More sharing options...
justsomeguy Posted May 14, 2012 Share Posted May 14, 2012 What code is generating that error? Why are you using mymovie_1? Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 15, 2012 Author Share Posted May 15, 2012 the output is generating the error, and im not using mymovie_1 im using mymovie, and imma have to look at it later today to see sup with it Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 15, 2012 Author Share Posted May 15, 2012 this is the code that is causing the output error import flash.events.MouseEvent;cable_mc.cable_btn.addEventListener(MouseEvent.CLICK, cable_btn);function cable_btn(event:MouseEvent){gotoAndStop("20")}access_mc.access_btn.addEventListener(MouseEvent.CLICK, access_btn);function access_btn(event:MouseEvent){gotoAndStop("10")}access2_mc.access2_btn.addEventListener(MouseEvent.CLICK,access2_btn);function access2_btn(event:MouseEvent){gotoAndStop("17")}cctv_mc.cctv_btn.addEventListener(MouseEvent.CLICK, cctv_btn);function cctv_btn(event:MouseEvent){gotoAndStop("14")}snom_mc.snom_btn.addEventListener(MouseEvent.CLICK, snom_btn);function snom_btn(event:MouseEvent){gotoAndStop("5")}office_mc.office_btn.addEventListener(MouseEvent.CLICK, office_btn);function office_btn(event:MouseEvent){gotoAndStop("1")} im not sure why thats happening, but its messing up the rotation of the model Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 15, 2012 Author Share Posted May 15, 2012 i found the problem, the problem was with this piece of code access2_mc.access2_btn.addEventListener(MouseEvent.CLICK,access2_btn);function access2_btn(event:MouseEvent){gotoAndStop("17")} for some reason its doesnt acknowledge that, that button have an instense name Link to comment Share on other sites More sharing options...
justsomeguy Posted May 15, 2012 Share Posted May 15, 2012 I would recommend against using the same function names that you're using for instance names. Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 16, 2012 Author Share Posted May 16, 2012 yea i change it to something else and it worked perfectly, thanks thesci Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.