ActionScript 3.0 :: Rotating A Clip Around A Dynamic Anchor?
Jan 5, 2011
I ran into a problem, I'm trying to create a class where I can rotate a clip according to the position of another marker. I attached my source code, it's hard to explain but I think the project speaks for itself.Initialy it works great the way it should but after just one rotation the clip to be rotated starts moving in the wrong direction. I feel like I'm almost there but I could be wrong.
ActionScript Code:
package
{
[code].....
View 2 Replies
Similar Posts:
May 25, 2010
i'm a novice to ActionScript but from failed Google function searches, i think i've choosen an advanced i hope possible task: how to read then apply bezier, anchor point and handle positions to different anchor points. What i need to do is precisely align a rectangular closed bezier path with a randomly shaped closed bezier path, both with the same number of anchor points.
View 9 Replies
Jan 8, 2011
We are building a flash website with cms at the back end, and we are allowing admin to put anchors inside a content. Later we created a smaller version of the whole content to display just a small part and then [read more] button. Which add a new layer on top of every thing acting like a popup and it is populated with complete content.
Now we would like to scroll that text inside popup to that portion which [read more] button was clicked.
The most common example inside HTMl is go to top link in footer on most of the sites which move the whole document to top.
View 1 Replies
Sep 16, 2009
I have a rectangular movie clip which I am rotating along its y-axis according to the position of the mouse, using this code:
PHP Code:
rotateClip.addEventListener(Event.ENTER_FRAME, doTilt);
function doTilt(e:Event):void {
var clipToTilt:MovieClip = MovieClip(e.target);
clipToTilt.rotationY = (stage.mouseX-400)/10; // The stage width is 800
}
When I position the clip in the centre of the stage (x=400) the function works fine - the clip rotates from -40 to 40 degrees, and the perspective effect looks the same at each extremity. However, when I change the x co-ords of the clip to 600 it still rotates in the range -40 to 40 degrees; but it looks as if it's turned much further round at -40 degrees than it does at 40 degrees. Surely if it's rotating by the same amount it should look the same, wherever it's positioned on the stage? I've changed the vanishing point of the object to x=600, but it doesn't seem to make any difference.
The reason I'm using the centre of the stage as a reference is because I want the clip to appear un-rotated when the cursor is in the centre of the movie. Is there another value I should be setting, or have I misunderstood the concept of rotating along an axis?
View 4 Replies
Aug 30, 2009
I'm trying to recreate the sky with a rotating clip in the shape of an arc. I've tried the built-in timer that changes the rotation, I've tried the TweenMax class, and I've tried hand-building the animation with a motion tween. In all cases, the movement is jerky--smooth for about five frames, then a sudden jerk of motion. What can I do to make this animation smoother? Clip is about 2400px wide, 400px high, with a reg point about 3000px away that it rotates around.
View 3 Replies
Aug 23, 2009
I'm trying to create a puzzle/platform game where the environment flips (180 degrees) rotates (90 degrees) by increments when the player touches a power-up so to speak. The code I have for the power-up is:
onClipEvent (enterFrame) {
if (_root.powerup, hitTest(_root.player)) {
gotoAndStop(2);
[code]....
View 1 Replies
Aug 19, 2008
I created a scene that allows the user to attach multiple instances of several movie clipsI want the user to be able to manually rotate any movie clip they wish via a button. While I understand how to create the button and write the rotation script, I am completely at a loss on how to go about writing the code that would allow the user to select the MC they want to rotate by first clicking it with their mouse and then rotating it with the button.
View 1 Replies
Dec 2, 2006
There is a fantastic mouse sensitive merry go round 'menu' within the kirupa site via the link:http:[url]....
It's situated under the first example, named basic camera panning.This is very hard code. I understand the principals, but personally am new to actionscripting, and therefore cannot piece together my own example from the code supplied, purely by not understanding the placing of the actionscripting.provide a *.fla file from the example that is explained in the link above?
View 4 Replies
Apr 1, 2010
I need with a menu witch has 5 buttons moving along an ellipse. When I click on a button, I need to call an "arrow" movie clip, locate it BETWEEN the button being pressed AND center stage, and make sure it's pointing toward the middle. Much like the picture below: I've spent the whole week trying to make it work but I guess I don't know enough about AS2, or geometry to succeed on my own.
View 2 Replies
Mar 29, 2010
In an application, i am creating dynamic text Field and then try to rotate it by using _rotation method but it become invisible.
View 7 Replies
Jan 21, 2009
I have a little problem here, that I keep banging my head on for a few units now. It's fairly simple:rotate a dynamic text. Think of somekind of a quirky menu structure, with a circle in the middle and leaf-like menu items around it. I would like to rotate those, then it will look like a nifty flower-menu. Anyway, I cannot get the rotation to work. I've wandered around on the forums and Google already, and all point to the same thing. Embed a font, attach it and then rotate it. Well, I embedded the font 'Arial' in my library, linked it and called it 'Embed'. Then I create a TextFormat in AS3, use the name 'Embed', link it to my TextField and set the property embedFonts to true. All this goes fine, until I use that property. In the beginning you can still see my menu (only when it's not rotated, otherwise it disappears) and it's text, if I set embedFonts to true the text disappears.What am I forgetting or doing wrong, and is there perhaps an easier option?
View 7 Replies
Feb 10, 2006
Hi, is there any way to rotate a movie clip during runtime? Also, do movie clips have a width property that can be accessed with actionscript?
View 2 Replies
Feb 29, 2008
I made a simple fla with explanation and actual failed attempt in it. seems logically right to me but still not working...
View 2 Replies
Jul 11, 2007
SO i have looked and looked and I am beginning to believe that this may just be impossible to do with Actionscript. Basically i have a backend php file that creates an XML file of randomly selected entries from a Db. That XML file is imported to the swf file, and currently i can rotate through the XML nodes with no problem. Where i am now having issues is trying to have each entry Fade in.........and then fade out. Doing this with tweening is not an option because the tween time period never matches up with the backend actionscript rotation time period.
I have read alot about how you need to embed fonts to make this possible. have done that to no avail. THis can not be that out there of an idea. Basically i have a list of advertiser names and am wanting to rotate through them........but want a little more style than just a hard cut between the entries.
[Code]....
View 6 Replies
Sep 23, 2009
Does anyone know the code for finding the global positioning of X & Y co-ordinates of a click of a button which is constantly rotating, and then secondly the code for when you click on the button it displays a movie clip on top of it -(position of x & y when clicked) at the angle that you clicked it (so underneath the buttons are still rotating so other people can click them where they are)to explain the context, I'm trying to design a mock up of a circular interactive table when someone comes up to it and clicks on one of the buttons that are moving, it reads where the person clicked it and opens up a new box (movie clip) where they clicked it (at the angle) so its not upside down if you are at the topI've included my .fla file which shows the four buttons moving and a little diagramexplaining what I'm trying to do.
View 5 Replies
Nov 1, 2005
I have a rotating menu that sets the selected button to the 3:00 position once clicked. I need the labels for the buttons to stay in the upright position as they rotate with the button. I have attached an image. Anyone know of an action script that would keep the labels upright?
View 8 Replies
Feb 6, 2009
Been working on this for almost 2 weeks and I am completely stuck. I've got a main dynamic movie clip that pulls in images from an xml file. It's x position moves depending on the mouse position. Obviously its width is dependent on how many images are pulled in.
I have an indicator movie clip that runs along a 600 pixel line in the opposite direction to the main clip that gives an indication of how long the main clip is.
I know the length of the indicator's line so its x position needs to be updated in relation to the x position of the main clip. 1% of indicator's maximum movement in 6 pixels so it needs to move 6 pixels in relation to 1% of main movie clips maximum distance.
[Code]...
View 0 Replies
Oct 19, 2006
i've got 48 small movieclips named "1clip", "2clip", etc. all the way up to "48clip." I want to do something with them all and use a loop to affect them all the same way.
[Code]...
but that doesn't seem to work. are variables and instance names interchangeable? my lClip var traces out of course, but the lClip.imagHolder.loadMovie never happens (clip inside the clip).
View 1 Replies
Jan 23, 2010
I've made a flash movie which will load four movie clips at runtime. Actually, the number of movie clips will depend upon number of "NODE" in XML file. Keeping XML file thing aside, I've tried hardcoded values; 4. Let me describe you the structure very well:
There is a main empty movie clip, instance name "mc_scroll" which will be only item on stage. In this movie clip, another movie clip whose identifier name is "blueMovie" will be loaded dynamically. Inside this "blueMovie" MC, there is a button instance name is "blueButton" and inside this button there is a "Dynamic Text" field instance name is "btn_text".
Phewww.. so long chain... inshort:
mc_scroll->blueMovie->blueButton->btn_text
Now, I can load 4 or any number of "blueMovie" inside "mc_scroll". But I also want to set the button text for each button inside each MC!! I'm sure you guys are getting what I want to do. But its not working. Below is the code:
Code:
//INSIDE THE MAIN TIME LINE
for(i=0; i<4; i++)
{
[code]....
how to assign the text dynamically which is inside a button and this button inside a MC which is created dynamically inside a main MC!
View 3 Replies
Aug 22, 2005
can't figure out why the dynamic text boxes in my dynamic clip arent picking up the variable when I loop through this recordset!the trace (you'll see here right after I try two ways to assign the variable) traces the correct info back..
[code]...
View 1 Replies
Jan 26, 2010
I have sevral buttons on stage and I'm trying to draw a rectangle under them. My problem is that the dynamically drawn recatngle is always on top.
Is there a way of having the rectangle under without having tu put another clip on stage ?
View 1 Replies
Sep 11, 2009
I am using anchor labels for a new site and it works good in firefox but in IE it is going though each anchor till it finds the correct one. You can see it going through the labels in the address bar and a clicking noise for each one, besides the fact its ugly it takes a while to go through them all. You can see it here -[URL]
View 1 Replies
Sep 10, 2009
I am using anchor labels for a new site and it works good in firefox but in IE it is going though each anchor till it finds the correct one.
You can see it going through the labels in the address bar and a clicking noise for each one, besides the fact its ugly it takes a while to go through them all. You can see it here - [URL]
View 1 Replies
Sep 27, 2006
I understand that when applying html text to a textfield you can have an anchor tag call a specific function. however, is if you can call a function on rollover of the anchor tag?
Example:
Instead of this...
<a href='asfunction:_root.test'>Click here to call the test function</a>
I'd like this...
<a href='' onMouseOver='asfunction:_root.test'>Rollover here to call the test function</a>
View 2 Replies
Sep 28, 2009
I'm hoping this is very easy as I'm not very proficient in flash/as3. but from the looks of things it might be a bit complicated ..how would I go about calling an anchor id such as the one below:
<a id="v_toggle" href="#">toggle</a>
I want to toggle a javascript slide in the html page.
View 2 Replies
Aug 19, 2011
Is there a better way to have a symbol's anchor point default to the size of the stage? I'm having Huge problems because if two symbols are different sizes then I can't tell two objects to be in the same location.The workaround seems terrible. I have a guide layer for stage bounds. I'd have to duplicate that, add that to the objects that I'm going to want to convert to a symbol first, then remove it after it's converted. Is there anyway to automate any of that? That just seems like a terrible task to repeat over and over. I suppose one option is to have a blank symbol that is the correct size already, duplicate that in the library, rename it, put that on the stage, then put your objects in there. Wow, I'm not sure if that's better or worse!
View 1 Replies
Jul 6, 2009
how can i make named anchor links in flash, i tried this: [URL] i dowloaded the sample, it works as it is with as1 but it doesn't seem to work with as2?
View 1 Replies
Jul 13, 2009
Flash knows where the anchor point is in 3D space in order for the symbol to rotate around it, but I can't seem to figure out how to see the coordinates of the anchor point or type in new ones. Please tell me how to do this. I am already very annoyed that Lynda, a pay service, doesn't think this is vital information. Apparently they think we would never want to do anything more visually stimulating than one simple spinning logo! But I digress...
Just to be clear, I know how to move the anchor point visually on the stage, but I want accuracy. I want to be able to give two symbols the exact same coordinates to rotate around.
View 3 Replies
Dec 8, 2010
Does anybody know if there is an option to make a pen anchor snap to a guide/grid? Kind of like smart guides in illustrator but in flash cs 5?
View 2 Replies
Oct 10, 2011
I think I discovered a bug. Say this is a line with anchor points:
x---x---x---x---x---x---x
And this is what I want to achieve using the Delete Anchor Point Tool:
x-----------x-----------x
Then this is as far as I'm actually able to get:
x-------x---x-----------x
Because for some reason, if I delete the 2nd anchor point, the 3rd will be deleted too. I can, however, delete the 3rd without deleting the 2nd.
It is only after I've moved the 3rd further away that I'm able to delete the 2nd, but this gets tiring after a while.
View 1 Replies