onClipEvent HELL

hello people\ri’m having a bad time with the OnClipEvent, and was hoping you could -as always- provide the answer. i’m trying hard not to wear out my welcome card, but this one has me knocking at your door yet again!\r\rwhere do i place the onClipEvent code???\r\rmy book/the net/the cat says: on the movieclip instance. \r\ri’ve tried placing the code in the actions pnel of the mc; on the mc at the main time line and in various other unspeakable places… but i always get the same error warning me that this code can only be used in movieclip instances and that my stupidity levels are reaching dangerous levels. (error: ‘Symbol=stage_mc, Layer=actions, Frame=1: Line 5: Clip events are permitted only for movie clip instances\r onClipEvent(enterFrame){’\r\ri fear somebody will reply to this with:\r’the code goes on the movieclip instance’…\rat which point i will take up a career in knitting (i knew i shouldn’t have given up the course in the first place) \r\rthank you all

When you’re done with your 1st knitting project, upload the result :slight_smile: \r\rplace a clip on the main timeline form your library and you should be able to attach any ‘onClipEvent’ you want to it!?..\rselect clip/actions/beginner mode: check if the event is grayed out or not, if it still doesn’t work, reinstall Flash, or better, happily knit away :wink:

you have to actually put it on the movieClip. I think you maybe be putting it on a timeline, or something like that. Bring the MovieClip onto the main stage, rightclick on it, and select actions, and then put the code into the ACTIONS panel. If that doesn’t work, when you create the symbol, make sure that MovieClip is selected. If that doesn’t work then reinstall Flash, if that doesnt’ work knit me a sweater…

my god! is that what an OnClip event is?\rferocious bout of blushing beginiing to spread\r\rgee… i don’t know what to say… somebody advised me to use an onClipEvent to solve a prob, and they posted that code (onClipEvent(enterFrame){…)\rwhich i then tried to paste in the right place… with not very nice results…\r\rso i guess the onClip bit is there (invisible) because the mc has that type of event (like the button has the on(release)\r\rah…\r\rermm… sizes guys… what about sizes? sweaters, gloves, mittens, scarfs… whatever you want…\r\rheyu: anyone have the code for that nice twisty effect on woolly jumpers?\r:) \r\r\rthanks

Are we to understand it works now?\rI so, i’d like a woolen …erm…thingy warmer, you know, like the RedHotChiliPeppers used to wear, except their mam’s couldn’t stand their music, so they had to use their old socks :slight_smile: LOL\rSeriously, you know how the onClip works now?

any chance for some knitted swim trunks? its gettin hot here in vegas…

how about a knitted sweat suit. My friend jumped into a swimming pool wearing 4 pairs of sweat pants, and 4 hooded sweat shirts and they got so heavy that they almost dragged him under…what a dumazz

you chaps have boosted my confidence no end! i feel i could go into business… hey: knitting ain’t so bad!!\r:D \r\rwhat? that flash? no, of course it doesn’t work!! \r:( \r\ri hope you guys don’t mind if i post a link to what i’m trying to achieve (it’s just so much easier than explaining it!)\r\rok:\rwww.alt-student.co.uk/flash/hell.htm\r\rthat’s my gui. all i want is a short movie called ‘stage’ to play each time you click a navigation button BEFORE you’re taken to the coresponding screen (e.g. services, products… and so on)\r\rif you click the little button at the top, you’ll see the movieclip in question.\r\rif you click the ‘about us’ button you can see the prob right away!\rBTW: i cheated in the Services button: the start frame is on frame 10! but that’s bad, especially if i later change the length of the short movie or get rid of it (i’ll have ‘screens’ that take 10 seconds to load!)\r\rmy button code is:\ron(release){\r_root.stage.play(“start”);//play short movie\r_root.about_us.play(“start”); //play about us movie\r}\r(‘stage’ is the instance name for the short movieclip)\r\r\rthat code runs through and you get both things happening at once.\r\rso what i thought i could do is this:\r\r1\rservices button :\ron(release){ \rmyVariable = ‘services’\rpass variable to short movieclip\rgo play the short movie\r\r2\[email protected] frame of short movie: goto myVariable \r\rthat way, the movieclip is always finished before the ‘screen’ is loaded\r\rand that’s it!\r\ri can’t seem to get the variable working and somebody suggested i put the code in the onClip event (that’s how this can of worms happened)\r\ri have a feeling that it could be done even better (?) i don’t think putting the goto code at the end of the short mc is good programming (please slap me if i’m wrong). i.e. i might want the mc to play when the whole site loads, in which case, i don’t want any ‘screen’ to load afterward, but i haven’t come up with an alternative\r\rmy prob is mostly the syntax (as well as some of the logic etc) but i decided i want to do things effectively, and so i’m refusing to simply put an instance of the short movieclip in every ‘screen’ movie (because i just now the length will change one day and i’ll have to edit every button to adjust the starting point of the content)\r\rthanks for reading this\r

Ok, I haven’t read the whole thing so maybe I’m totally out of focus but here are my 2 eurocents : let’s say on the ‘about us’ button :

 on (press) {\r\r  _root.stage.gotoAndPlay ("start" ) ;\r\r  _root.toPlay = "aboutus" ;\r\r}\r\r\r\rThen at the end of the stage movie clip\r\r_root[toPlay].gotoAndPlay ("start" ) ;

Does that make sense ??\r\rpom 0]

right - that ain’t working for me but i think the movieclip is not receiving the variable:\r\rif i load the variable at the start of the mc(toPlay: “about_us”) then your code works, so obviously the value of the variable is getting lost between the button and the mc\r\rdo i have to declare the variable somewhere else (i.e. in the main time line?) all i’ve done is copy your code, so that the first apprearance of the variable is at the button(_root.toPlay = “about_us”)\r\rand does _root.(var_name) make it accessible to all objects?\r\rta!

Thanks Pom!!! your code was right!\r\ri switched the lines so that the variable gets loaded before the mc is called:\r\ron (press) {\r _root.toPlay = “mc1”;\r _root.stage.gotoAndPlay(“start”);\r}\r\rand it works!!\r\rthis is astounding!\r\r(you actually gave me the correct syntax for passing variables [x] in a different post with a slightly different question, but i was so miffed at this prob that i didn’t notice it!!\r\rso many thanks twice\r\rburn the jumpers, i say. no more wool!

Oh… So flash gotoAndPlays and therefore doesn’t send the variable ?? I didn’t know that…\rBy the way, I’m happy that it’s working for you. I hope you’ll show us what you did some day.\r\rpom 0]

when i finish it, it will be my first flash effort, which i will post because you chaps have done most of it!\r\rat the moment i’ve done 16 versions, lost track of everything, demoralised myself and ran out of inspiration (but that’s another issue)\r\r:)