flash actionscript:
Hi, I have a movie clip with 3 keyframes of code that allows it to move around randomly on the stage. I want the main movie to advance to a particular part of the timeline when the mc is clicked. I put a button inside the mc with this code on it. on(release) { _root.gotoAndPlay(141); } My button is not working however. Any theories or do you need more info? Thanks. tc
Thanks. Here is the code that's on the movie clip. First keyframe: speed = 5; craziness = 5 + random(5); movie_width = 650; movie_height= 500; radians_per_degree = (2 * Math.PI) / 360; counter = 0; 2nd keyframe: if (counter >= craziness) { // change direction //bug._rotation += (90 - random(180)); rotation_amount = (90 - random(180)) / craziness; counter = 0; } // Get the bugs global position globalBugPoint = new Object; globalBugPoint.x = bug._x; globalBugPoint.y = bug._y; localToGlobal(globalBugPoint); if (globalBugPoint.x <= 0) { bug._rotation = 45 + random(90); counter = 0; } else if (globalBugPoint.x >= movie_width) { bug._rotation = 225 + random(90); counter = 0; } else if (globalBugPoint.y <= 0) { bug._rotation = 135 + random(90); counter = 0; } else if (globalBugPoint.y >= movie_height) { bug._rotation = 315 + random(90); } bug._rotation += rotation_amount; dx = Math.cos((bug._rotation+270) * radians_per_degree) * speed; dy = Math.sin((bug._rotation+270) * radians_per_degree) * speed; bug._x += dx; bug._y += dy; counter++; 3rd keyframe: gotoAndPlay (2); Does this help at all?
no, it doesnt even look like the button is being recognized at all(i.e. cursor doesnt change when it is moved over mc). It worked fine before when I had a simpler mc with the button in it. I dont know if something in the new code is overriding the button code or what.
Thanks for your help jrh. I think I figured out what the problem is. Somewhere along the line it looks like a 2nd mc was put in that was more or less between the mc and the button. Not sure how this happened but anyhow it works fine now. Thanks again!!!
Don't see what you're looking for? Try a search.
|