The McLeodGaming forums were permanently closed on April 30th, 2020. You are currently viewing a read-only archive.
View unanswered posts | View active topics It is currently Fri May 15, 2020 1:58 am

Forum rules


IMPORTANT

This Forum is for Flash related questions ONLY! Do not ask questions about spriting, Game Maker, Photoshop, or anything else not related to Flash.



 [ 7 posts ] 
[Question] Changing the same sprite 
Author Message

Joined: Sat May 09, 2009 3:41 pm
Posts: 31
Is there a possible way to make the same sprite change direction... like say this is your sprite: :mrgreen: and you wanted him to turn around without having a seperate sprite made is that possible...
----------------------------------
I saw it on a game I played before but I don't know how...

_________________
Image Pure Awesomeness


Thu May 21, 2009 4:04 pm

Joined: Sun May 10, 2009 8:34 pm
Posts: 6
I use Paint to flip it.

_________________
Image
Animations: show
Image
My first animation.


Mon May 25, 2009 9:39 am
User avatar

Joined: Mon Aug 11, 2008 1:09 pm
Posts: 166
Location: England lol
Gender: Male
Currently Playing: Minecraft
What about this:

Code:
_root.mc1._xscale = -_root.mc1._xscale;


That will invert the image horizontally and then when used again, it will flip it back again.


Mon May 25, 2009 4:26 pm
WWW

Joined: Sat May 09, 2009 3:41 pm
Posts: 31
Umm... I don't know how to apply the code and where to apply the codes...

_________________
Image Pure Awesomeness


Tue May 26, 2009 7:36 pm
User avatar

Joined: Fri Mar 27, 2009 8:55 pm
Posts: 282
Location: Why do you want to know you perv!
Gender: Male
Skype: lomeli1241
Currently Playing: Kingdom Hearts Re:Coded (JP)
1. Click on the movie clip the character's in
2. Click on actions at the bottom of the screen(assuming you have Flash 8)
3. Type X2i's code
Code:
onClipEvent (load) {
   //Sets the initial speed
   speed = 5;
}
onClipEvent (enterFrame) {
   //Keys to move left and right
   if (Key.isDown(Key.LEFT)) {
      _x -= speed;
   }
   if (Key.isDown(Key.RIGHT)) {
      _x += speed;
   }
}

4. Then edit the code like this
Code:
onClipEvent (load) {
   //Sets the initial speed
   speed = 5;
}
onClipEvent (enterFrame) {
   //Keys to move left and right
   if (Key.isDown(Key.LEFT)) {
      _x -= speed;
      _xscale = -100; //makes character turn left
   }
   if (Key.isDown(Key.RIGHT)) {
      _x += speed;
      _xscale = 100; //makes character turn right
   }
}


The best part about the changes is that it doesn't have any side effect(well, for me there was no problem)

_________________
Image
Image
Give cred 2 Doromac
Mes Amis: show
BICURIOUS GEORGE
daniel
King Master X12
Neo_Fire_Sonic
Racerx52
Sora
Tycron
Tyli
User Avatar
yoh
Envoyez-moi un message pour ĂȘtre mon ami! Ha! That's French 4 Pm to be Friends


Tue Sep 08, 2009 6:30 pm
WWW

Joined: Sat Jul 30, 2011 5:40 am
Posts: 2
Gender: Anime Girl
I don't know how apply this code :doh: :doh: :doh:

_________________
Micro SD card
Pet insurance
Mp3 player accessories


Sat Jul 30, 2011 6:57 am

Joined: Fri Sep 30, 2011 6:32 pm
Posts: 1
Gender: Anime Girl
Please tell the detail that how we can use these. Actually I don't know how apply this code.

_________________
Translation Company


Fri Sep 30, 2011 6:35 pm
WWW
Display posts from previous:  Sort by  
 [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF.