ActionScript 2.0 :: Setting Various X And Y Co-ords For A Movieclip With Buttons?
Jul 2, 2003
I have a movie clip, behind a mask, and I am trying to control the position it moves to, dependent on the menu button pressed.
If I am honest I am trying to copy the effect used in www.lostinbeta.com when pages are loaded.I have got everything working, but currently I do not know how to set the finishing x position depending on the button pressed.
I think the issue is becuase I am trying to use the technique to make the movement slowdown as it reaches its correct co-ordinates.
Im making a game, where a player controls a character moving around the screen using the mouse.the player moves using a tween, using the current x y pos and the click x y pos to move the character around here's the thing, i have objects on the screen (such as rocks, etc) that i do not want the user to be able to walk through. i do not want to use hit test to simply chuck the character off the object in real time because that's messy and it would mean the tween continued and stuff.. instead, i want to add some code to the top of the "movePlayer" function that checks to see if an object (such as some rocks) is going to be hit, and if it does, i want the tween to only go to this point (yellow in the below diagram)
Here's what i mean:the player clicks on the screen ( the blue dot) and instead of walking straight to the blue dot, the code determines the point at which the player will hit the big orange block, and only tween to that point, if there are multiple orange blocks in the way, the tween will stop the closest block.
Im creating an array to hold co-ords, scale, rotation, etc for a menu system. I'm having trouble working out the best way to tell it that its current position is, say, mc_A and now it should show, say, mc_D. At present in my array I have a status parameter which is set to true if its the current movieclip, so mc_A is true. Now mc_D is triggered, what is the best way to tell the array that now mc_D is true and mc_A is now false. I understand that I could just have a line saying _root.myMenuArray[0].status = "false"; before I call_root.myMenuArray[4].status = "true";
I'm completely new to this forum, and would like to ask your help for one issue. I am working on an interactive flash map, I was able to set all the countries borders with the help of fireworks (awesome tool), and import them back to flash and set each country as a button. I would like to set all of the buttons to have the same properties for example : All the buttons have default red color, and will have a mouse hover frame that will change the color of the button to blue. I DO NOT want to set each button manually, because I would like to have the choice to change the mouse hover color to a different one, and would like to avoid passing each button and changing each one's mouse hover frame.
Is there a way I can built a template of a frame, and for each button set its mouse hover frame as the template frame I built ? And then if I make any changes to the template frame, all of my buttons would be automatically updated ?
I have tried repeatedly to take the examples in setChildIndex and instead of using sprites I want to control the order of 2 buttons on the stage so that when I roll over one of the buttons it comes to the top.
Here is the code I have so far which is from the example given in the on-line documentation:
If the answer is yes then a needle on a separate movie goes closer to the red(right) and if the answer is no then the needle stays where it is. This was all fine until the user ticks yes then changes their mind to no... the needle would then stay where it was rather than going backwards(towards the green) because I had set it up to not do anything if the no button was pressed initially? I was told that setting up the buttons as arrays would be the best option but on trying to learn about arrays I've become completely confused? oh additionally the amount of ticks dictate certain events that happen to the needle movie so they need to trigger events some how?
I am working on an interactive flash map, I was able to set all the countries borders with the help of fireworks (awesome tool), and import them back to flash and set each country as a button.I would like to set all of the buttons to have the same properties for example :All the buttons have default red color, and will have a mouse hover frame that will change the color of the button to blue.I DO NOT want to set each button manually, because I would like to have the choice to change the mouse hover color to a different one, and would like to avoid passing each button and changing each one's mouse hover frame.
Is there a way I can built a template of a frame, and for each button set its mouse hover frame as the template frame I built ? And then if I make any changes to the template frame, all of my buttons would be automatically updated?
I have pages of info I'm pulling from external files. I want my btn_next to not be visible when the last page loads and my btn_prev to not be visible when the first page loads. The btns are actually moviclips with instance names btn_next and btn_prev Here is my code:
it's an easy question but the words may come out wrong. so I'm loading these 5 pics as buttons
[code]...
and I want to have them located one below the other plus 10 pixels gap . . . it seems so easy, but then so did opening the MX2004 packaging . . . 3 days later.
i'm making a dynamic folder buttons... the above code i did ran successfully... now i want the dynamic buttons to display like at 1 sec interval between each button.. where and how do i insert the setInterval method..?
I'm currently trying to build my first flash site.I have just set up the buttons which get to each 'section' via frame labels and the AS3 gotoAndStop function.These work without error until my 'sections' contain movieclips that are referenced in my actionscript layer... Because they do not exist in 'all frames', whenever I click my buttons I get the error, "Error #1009: Cannot access a property or method of a null object reference."It took me a while to understand and track down why I was getting this. I removed the short bit of code in my actionscripts layer that referenced the movieclips in each section (I had some custom scrollbars set up) and it worked without error.
I'm using Flash Remoting to grab a result set from a SQL Server database. Then, using the total records in the result set, I'm creating the respective number of movie clips on the stage. Each of these movie clips is an instance of the "button_mc" movie clip I have in the library, named "button_0", "button_1", ..."button_n". The library movie clip that I'm using to create the instances contains a standard Flash button.
Anyway, that part is working fine. What I want to do is dynamically generate the onRelease event handler for each of these unique buttons. When I try to do this within the for loop, it sets all the event handlers to the last item in the list. What I want to do with the event handler is change the text of a dynamic text field based on the button name.
e.g. buttonName.onRelease = function() { myDynamicTextField.text = "button_"+i; }
In some ways it makes sense that the event handler is always going to be the last available in the loop, as the handler is called after the loop is completed. However, I'm hoping there's a way to make the handler "stick" after the loop is completed.
My code is on the main timeline.I call a function loop to draw lines between them.The lines are drawing between the right x, y values BUT between those values on the main stage, not those values within the kite.For example, dot1_mc is at x100, y0 inside kite. the line that should go from its center, draws from stage x100, 0.How do I draw the lines inside kite so that they draw between the dots?Heres my code that draws the linesPHP Code:
function loop():void{ lineDrawing.graphics.clear(); var a:Point = new Point(kite_mc.dot1_mc.x, kite_mc.dot1_mc.y); var b:Point = new Point(kite_mc.dot2_mc.x, kite_mc.dot2_mc.y); var c:Point = new
like my movie container in my _root, how do i set it`s alpha to 0? does this work: _root.contMovie.setAlpha(0); ? or is there any other possibility to set it`s alpha to 0?
the best thing for me would be if i could fade it to alpha via AS command, i can't control it direct because the movieclip is 2 levels above....:-)
ActionScript Code: var my_color:Color = new Color(closeText); my_color.setRGB(0xFF0000); // any color
I get the following compiler errors though: Symbol 'closeText', Layer 'Layer 1', Frame 1, Line 11046: Type was not found or was not a compile-time constant: Color. Symbol 'closeText', Layer 'Layer 1', Frame 1, Line 11180: Call to a possibly undefined method Color.
I have an MovieClip star with a setup var X which is set to 0 for the thing I'm duplicating, namely star
===Star====== onClipEvent(load){ x=0; }
If I duplicate the clip a bunch of times so I have Star0....N. Is there a way to set the x value here to the i value of the loop for each object duplicated. Such that star0 will have its x=0, star2 has its x=1 and so on. setProperty wont do it or _root["star"].x=i;
I have three mc's that look like cd's Three instances of the same movie clip. They go into a player onRelease. If I click on a cd it looks if any other cd's are clicked. If any of them are clicked then it tells them to gotoAndPlay (thisKeyFrame) in that cd movie clip (which would be a simple tween and will look like the cd comes back out). I tried setting variables in the cdMovie clip like on the first frame onValue="no" but once it goes in and stops the onValue="yes". And then I had AS on each cd looking if the onValue variable is yes or no in each one of them.
I am struggling trying to get this variable set. I want to set a variable number to be the frame number of a movieclip. this is what i am trying with no luck: var fn:Number = movie_name._currentframe(); trace(fn); I have looked at different online examples but cant find an example like this one.
I have a movieclip that moves on the x axis and is controlled by the mouse. I want to set boundaries for the movieclip so it won't go past a certain section on the stage.For example, say there is a rectangle on the stage and the paddle is supposed to appear to be inside the rectangle. I hope this makes sense.The movieclip is called mcPaddle. Here is my code.
ActionScript Code: stage.addEventListener(MouseEvent.MOUSE_MOVE, movePaddle); function movePaddle(event:MouseEvent):void
I am working on a simple action-script3 slideshow. The thing that I have modified is the movie loads the list in two separate sections. The problem is I want the movie clip to load one image on the right then one image on the left. When the one on the left loads, it loads over top of the right image. I want send the image on the right to be on top again when the left image loads.
Here is my code specific to the images loading: ActionScript Code: function nextImage():void{ if(my_times > 0){ var my_image1:Loader = Loader(my_loaders_array[my_playback_counter]); my_image_slides.addChild(my_image1); my_image1.x = 26.1 [Code] ..... The idea is, when my_image1 is loaded, I want to have the depth of my_image to be on top.
I'm basically trying to reference a number of preexisting movieclips on the stage through a for loop, give it a variable and assign and action. So, where in AS 2.0, I would have gone:
ActionScript Code: for (var i:Number=1;i<=4;i++){ var refMC:MovieClip=this["myMC"+i];