Be a Supporter!

3 Questions

  • 334 Views
  • 11 Replies
New Topic Respond to this Topic
Re2deemer
Re2deemer
  • Member since: Nov. 3, 2005
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
3 Questions 2006-05-30 15:05:44 Reply

Question nr 1.

Hope the picture helps to understand. I'm not much of AS so....I got 5 rings attached to a line by their pivots. The line's two ends are attached to cursor and the red point. The line should move and change its length according to the posistion of the cursor. I now want the 5 rings to move on top of each other or move away from each other as the line changes its length. How to do that?

Q nr 2

My sounds keep going out of sync. How to prevent that.

Last but not the least, Q nr 3

I got a 1 sec sound loop and I wasnt it to keep looping for about 10 seconds. Do I need 10 keyframes, or is there a different way???

3 Questions


BBS Signature
Skaijo
Skaijo
  • Member since: May. 11, 2005
  • Offline.
Forum Stats
Member
Level 18
Blank Slate
Response to 3 Questions 2006-05-30 15:13:46 Reply

At 5/30/06 03:05 PM, Re2deemer wrote: Question nr 1.

Hope the picture helps to understand. I'm not much of AS so....I got 5 rings attached to a line by their pivots. The line's two ends are attached to cursor and the red point. The line should move and change its length according to the posistion of the cursor. I now want the 5 rings to move on top of each other or move away from each other as the line changes its length. How to do that?

Q nr 2

My sounds keep going out of sync. How to prevent that.

Last but not the least, Q nr 3

I got a 1 sec sound loop and I wasnt it to keep looping for about 10 seconds. Do I need 10 keyframes, or is there a different way???

Q#1: You'll need AS if you want it to follow your mouse. What kind of AS code? Not sure, you may have to find that out on your own.

Q#2: Change the sound properties of your song/sound from Event to Stream.

Q#3: Click on the sound in the timeline, and open up the properties menu. You'll see an item in the bottom right that says Repeat. Just put in the desired number and it will repeat that many times.

Re2deemer
Re2deemer
  • Member since: Nov. 3, 2005
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to 3 Questions 2006-05-30 15:16:32 Reply

At 5/30/06 03:13 PM, Skaijo wrote:
Q#1: You'll need AS if you want it to follow your mouse.

Like....doh....I could really use the code


BBS Signature
xWELSHxDRAGONx
xWELSHxDRAGONx
  • Member since: Apr. 13, 2006
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to 3 Questions 2006-05-30 15:40:08 Reply

a huge clue with regardes to the code

ball1._x=origin._x-((origin._x-_xmouse)*0.
2)
ball2._x=origin._x-((origin._x-_xmouse)*0.
4)
ball3._x=origin._x-((origin._x-_xmouse)*0.
6)
ball4._x=origin._x-((origin._x-_xmouse)*0.
8)

Re2deemer
Re2deemer
  • Member since: Nov. 3, 2005
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to 3 Questions 2006-05-30 15:41:56 Reply

ummm...but how do I use that code? After taking a look at that I was still clueless how does this code make the rings to attach to the line and the line attach to cursor and the point


BBS Signature
BoMToons
BoMToons
  • Member since: Nov. 29, 2005
  • Offline.
Forum Stats
Moderator
Level 38
Game Developer
Response to 3 Questions 2006-05-30 15:45:57 Reply

At 5/30/06 03:16 PM, Re2deemer wrote:
At 5/30/06 03:13 PM, Skaijo wrote:
Q#1: You'll need AS if you want it to follow your mouse.
Like....doh....I could really use the code

Here's my take on #1 assuming you're already using trig (ie: you know the angle of the right triangle being created by drawing a line straight down from the mouse and then over to the origin of the line), I'll give you the concept you figure out the actual code:

Pythagoras taught us that the length of the hypotenuse of a right triangle is the square root of the sum of each side squared...(if you're not following me at this point, don't bother completing your project because you won't be able to)

So, you should know the length of the two sides based on the mouse's x and y distance from the point the line is originating. So, figure out the length of the hypotenuse of your triangle using the Pythagorean theorem mentioned above.

Then divide that length by the number of circles you have. So let's say the hypotenuse is 100 px and you have 10 circles, then there should be a circle every 10 px along the hypotenuse.

Since you know the angle (in radians), you can then calculate what the circle's x and y values should be for every 10 units along the hypotenuse (ie: a hypotenuse with length 10, 20, 30, 40, 50, 60, 70, 80, 90, and 100) using Math.cos() and Math.sin().

Voila.

Re2deemer
Re2deemer
  • Member since: Nov. 3, 2005
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to 3 Questions 2006-05-30 15:48:51 Reply

>_<
Ya know, I'm a n00b at AS....I didn't understand a damn thing you said except the part about his theorem


BBS Signature
Shinki
Shinki
  • Member since: Feb. 14, 2005
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to 3 Questions 2006-05-30 16:08:04 Reply

_root.createEmptyMovieClip("line", 1000);
line.onMouseMove = function(){
with(line){
lineStyle(3, 0);
moveTo(30, Stage.height-30);
lineTo(_root._xmouse, _root._ymouse);
}
}

There's your line.


SCGMD4 is on the way! @scgmd4
If a picture is worth a thousand words, a game is worth a play.

BBS Signature
BoMToons
BoMToons
  • Member since: Nov. 29, 2005
  • Offline.
Forum Stats
Moderator
Level 38
Game Developer
Response to 3 Questions 2006-05-30 16:49:57 Reply

At 5/30/06 03:48 PM, Re2deemer wrote: >_<
Ya know, I'm a n00b at AS....I didn't understand a damn thing you said except the part about his theorem

Here, I'll sell it to you for $20.00 ;)
http://www.bomtoons.com/forsale.html

Skaijo
Skaijo
  • Member since: May. 11, 2005
  • Offline.
Forum Stats
Member
Level 18
Blank Slate
Response to 3 Questions 2006-05-30 16:55:10 Reply

At 5/30/06 04:49 PM, bomtoons wrote:
At 5/30/06 03:48 PM, Re2deemer wrote: >_<
Ya know, I'm a n00b at AS....I didn't understand a damn thing you said except the part about his theorem
Here, I'll sell it to you for $20.00 ;)
http://www.bomtoons.com/forsale.html

Heh, evil bastard. :D

BoMToons
BoMToons
  • Member since: Nov. 29, 2005
  • Offline.
Forum Stats
Moderator
Level 38
Game Developer
Response to 3 Questions 2006-05-30 16:59:42 Reply

At 5/30/06 04:55 PM, Skaijo wrote:
At 5/30/06 04:49 PM, bomtoons wrote:
At 5/30/06 03:48 PM, Re2deemer wrote: >_<
Ya know, I'm a n00b at AS....I didn't understand a damn thing you said except the part about his theorem
Here, I'll sell it to you for $20.00 ;)
http://www.bomtoons.com/forsale.html
Heh, evil bastard. :D

I thought it was pretty fair :P