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.
|
|
|
|
|
![]() |
||
Direction change from inside a movie clip
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
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 |
|
|
|
||||
|
Re: Direction change from inside a movie clip
its better if u send the file...
__________________
Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
|
![]() |
| Thread Tools | |
|
|
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 |