Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.


Actionscript Help

  • Please log in to reply
1 reply to this topic

#1 yano


    I can see what you post!

  • Members
  • 6,469 posts
  • Gender:Male
  • Local time:12:04 PM

Posted 05 May 2005 - 09:24 AM

Problem #1: Ok, I made a clock in Flash that looks like it rotates around a fixed point in the center. It has a second hand as well as a minute and hour hand. However one of my friends suggested instead of having just buttons on the side to take you to an hour, how about making the hands of the clock draggable so you could set the time...

Does anybody know how I would do this? Would I have to refoncigure my layers to actually rotate around a "motion guide"?

Problem #2: another problem how can I get a text box with text in it, to display in a middle of my project yet have it scroll so you can read the stuff in it. I've seen websites like this but I don't know how to do this...

Problem #3: Also another problem... I have a simple game... (just clicking around looking) and I was wondering how would I be able to have an inventory, so when someone click on an opject it was be placed off to the side in the "inventroy."

BC AdBot (Login to Remove)


#2 JacobS


  • Members
  • 21 posts
  • Local time:01:04 PM

Posted 24 June 2006 - 05:22 AM

This post is over a year old, so you probably wont hear this, but i'll put it up anyway just incase someone has the same question.

The way to determine the rotation of and object that needs to be be rotated around a central point to point at the mouse is simple trig.

A triangle could be drawn that depicts the angle, and gives us two side lengths to work with. these lengths are happily the difference in x between the mouse and the pivot point and the difference in y.

In a line:
	this._rotation = Math.atan2(_root._ymouse-this._y,_root._xmouse-this._x);
that will have the pointer always face the mouse.

i'd put it in a while loop for dragging.

To adress your "inventory" question:
This would best be done if the items were buttons

_x = 500;
_y = 500;

or something along those lines

if the items needed to be movieclips, you could use a mouse listener and collision detection with the cursor.

Edited by JacobS, 24 June 2006 - 05:25 AM.

Lasciate ogne speranza, voi ch'intrate.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users