Direction change from inside a movie clip

This is a discussion on "Direction change from inside a movie clip" within the Flash & Multimedia Forum section. This forum, and the thread "Direction change from inside a movie clip are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 8th, 2007, 19:54
Junior Member
Join Date: Mar 2007
Location: Dorset,England
Age: 29
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Direction change from inside a movie clip

hi can anyone help?

I am learning action script at the mo. and am just thinking of simple actions and then trying to implement them.

I started by creating two buttons,
and then wired them to a counter,
one button makes the counter go up and the other go down.
simple stuff so far.

I then but one button in a movie clip and called it target_mc


Then made this movie clip move across the stage from left to right. by using the code that follows

target_mc._x = Stage.width = 1;
target_mc._y = Stage.height = 180.1;

target_mc.onEnterFrame = function()
{
target_mc._x += 10; // increase current _x position by 10 pixels
if (target_mc._x >= 550)
{
target_mc._x = -80;
target_mc.onEnterFrame;
}
};

Still all groovy at this point.

On the button inside the movie clip I added _root. To my button so it still made the counter work on the main time line.

Then I thought I would change the direction and make my movie clip
go down following the Y direction. When the button is pressed

So added the following code in the movie clip

neg_btn.onRelease = function(){
_root.outputNum = _root.outputNum -1

_root.target_mc.onEnterFrame = function()

{
_root.target_mc._y += 10; // decrease current _y position by 10 pixels
if (_root.target_mc._y >= 400)
{
_root.target_mc._x = -80;
_root.target_mc._y = Stage.height = 180.1;


}

};
};

so when my movie clip hits the bottom of the stage it is then placed on the left hand side of the stage (off screen ready to come on again)

This is where I am stuck

As my movie clip is now repeatedly going down the Y access. (off screen)

I now want it to come back on the page start moving back along the X access.
As it was previously

Does this make sense to any one can any one help???


Cheers
Reply With Quote

  #2 (permalink)  
Old Nov 8th, 2007, 21:23
marSoul's Avatar
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 411
Blog Entries: 2
Thanks: 3
Thanked 4 Times in 4 Posts
Send a message via MSN to marSoul Send a message via Yahoo to marSoul
Re: Direction change from inside a movie clip

its better if u send the file...
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
unload movie clip transition. monkeygraphik Flash & Multimedia Forum 0 Jan 29th, 2008 12:37
Unload movie clip problem monkeygraphik Flash & Multimedia Forum 2 Sep 11th, 2007 08:37
Accessing a movie clip ClrWtrDsgnr Flash & Multimedia Forum 1 Sep 10th, 2007 13:23
Removes Movie clip without my say so magnetica Flash & Multimedia Forum 2 Jun 15th, 2007 02:21
Button within a movie clip therussian Flash & Multimedia Forum 0 Nov 4th, 2005 18:16


All times are GMT. The time now is 22:40.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43