It is currently Wed Oct 01, 2014 11:21 am

All times are UTC - 5 hours



Forum rules


1.) No trolling. If you cant have fun without being a jerk to others, find some other forum to QQ
2.) No inappropriate/vulgar/sexually explicit posting. Staff reserves the right to deem anything they see fit as inappropriate.
3.) Have fun and don't post anything not geared at having fun!
4.) Please respect staff members and their decisions at all times. If you cannot accept a staff or moderator decision, please appeal to admin Seth.



Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Flash Coding probs
PostPosted: Sat Mar 17, 2012 2:40 am 
Major
Major
User avatar
 Profile

Joined: Sat Dec 19, 2009 7:48 pm
Posts: 2708
Gender: male
Alright I am trying to make a simple game where you click on a ball, the ball bounces and you try to bounce it as many times as you can without it touching the ground. It is currently unfinished. I am getting a message at the bottom saying "Fonts should be embedded for any text that may be edited at runtime, other than text with the "Use Device Fonts" setting. Use the Text > Font Embedding command to embed fonts." Please someone help me out :D

Here is the code:

Spoiler:
Code:
package
{
   import flash.display.MovieClip
   import flash.text.TextField
   import flash.events.Event
   import flash.event.MouseEvent
   
   public class DocumentMain extends MovieClip
   
   {
      public const BOUNCE_FACTOR:Number = 0.8;
      public const GRAVITY:Number = 2;
      public var _bounces:TextField ;
      public var _highscore:TextField;
      public var _ball:Ball;
      
      private var _vx:Number;
      private var _vy:Number;
      
      public function DocumentMain():void
      
      {
         vx = 0;
         vy = 0;
         
         addEventListener(EVENT.ENTER_FRAME, enterFrameHandler);
         addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
         
         
      }
      
      private function enterFrameHandler (e:EVENT):void
      {
         //Gravitate the Ball.
         _vy += GRAVITY;
         
         
         //Move the Ball.
         _ball.x += vx;
         _ball.y += vy;
         
         //Check Stage Boundaries for collision.
         
         checkBoundaryCollision(): void
         {
            var left:Number;
            var right:Number;
            var bottom:Number;
            var top:Number;
            
            left = _ball.x - (_ball.width/2);
            right = _ball.x + (_ball.width/2);
            bottom = _ball.y - (_ball.height/2);
            top = _ball.y + (_ball.height/2);
            
            if (left < 0 && _vx < 0)
            {
               _ball.x =  _ball.width / 2;
               _vx *= -1;
            }
            else if (right > stage.StageWidth && _vx > 0)
            {
            _ball.x = stage.stageWidth - (ball.width / 2);
            _vx *= -1;
            }
            if (top < 0 && _vy < 0)
            {
               _ball.y = _ball.height / 2;
               _vy *= -1;
            }
            else if (bottom > stage.StageHeight && _vy > 0)
         {
             _ball.y = stage.stageHeight - (_ball. height /2);
            _vy *= -BOUNCE_FACTOR;
         }
         }
         
   }
   
   private function mouseDownHandler (e:MouseEvent):void
   {
      //hit ball if clicked.
   }
   
   }
   
}

_________________
Image

Image


Top
 

 Post subject: Re: Flash Coding probs
PostPosted: Sat Mar 17, 2012 5:08 am 
Captain
Captain
User avatar
 WWW  Profile

Joined: Sun Jan 16, 2011 8:43 am
Posts: 1191
Location: Philippines
Gender: male
DAmn, if only I know ActionScript :P

_________________
<New Sig In the Works ;) >
I dare you. Stay alive in this Bloody RP ~ Turn51. Do it... now!


Top
 

 Post subject: Re: Flash Coding probs
PostPosted: Sat Mar 17, 2012 9:45 am 
Captain
Captain
User avatar
 Profile

Joined: Tue Dec 14, 2010 10:55 am
Posts: 1160
Select the text field, go to the properties inspector, and for anti-aliasing, choose use device fonts.


Top
 

 Post subject: Re: Flash Coding probs
PostPosted: Sat Mar 17, 2012 10:41 am 
Moderator
Moderator
User avatar
 YIM  Profile

Joined: Sat Jul 17, 2010 2:35 am
Posts: 1739
Location: You see that mansion across the road? Yeah, there
Gender: male
WHA!?!?

confused

_________________
Best rank:1
Most Crystals:34
Most power:192
Best alliance finished:1st


Skype: ads126bd

The Silent Spammer.


Top
 

 Post subject: Re: Flash Coding probs
PostPosted: Sun Mar 18, 2012 9:55 am 
Captain
Captain
User avatar
 WWW  Profile

Joined: Sun Jan 16, 2011 8:43 am
Posts: 1191
Location: Philippines
Gender: male
ads126 wrote:
WHA!?!?

confused

Just geeks responsible in bring your every game coming through... :D

_________________
<New Sig In the Works ;) >
I dare you. Stay alive in this Bloody RP ~ Turn51. Do it... now!


Top
 

 Post subject: Re: Flash Coding probs
PostPosted: Sun Mar 18, 2012 1:53 pm 
Captain
Captain
User avatar
 Profile

Joined: Tue Dec 14, 2010 10:55 am
Posts: 1160
Did you get it working?


Top
 

 Post subject: Re: Flash Coding probs
PostPosted: Sun Mar 18, 2012 7:31 pm 
Captain
Captain
User avatar
 WWW  Profile

Joined: Sun Jan 16, 2011 8:43 am
Posts: 1191
Location: Philippines
Gender: male
Diaz, speaking of which...

Can you teach me ActionScript and Flash? :3

_________________
<New Sig In the Works ;) >
I dare you. Stay alive in this Bloody RP ~ Turn51. Do it... now!


Top
 

 Post subject: Re: Flash Coding probs
PostPosted: Sun Mar 18, 2012 8:08 pm 
Captain
Captain
User avatar
 Profile

Joined: Tue Dec 14, 2010 10:55 am
Posts: 1160
Yeah, no problem.

Step 1: Google "learn actionscript and flash"

Step 3: Read everything.


Top
 

 Post subject: Re: Flash Coding probs
PostPosted: Sun Mar 18, 2012 8:11 pm 
Captain
Captain
User avatar
 Profile

Joined: Tue Dec 14, 2010 10:55 am
Posts: 1160
Oh, and in case you were wondering. Step 2 is where you watch any porn you stumble upon. It's not nescessary, but you'll probably do it anyway.


Top
 

 Post subject: Re: Flash Coding probs
PostPosted: Sun Mar 18, 2012 8:23 pm 
Captain
Captain
User avatar
 WWW  Profile

Joined: Sun Jan 16, 2011 8:43 am
Posts: 1191
Location: Philippines
Gender: male
Thanks a bunch.

I seriously thought you were gonna teach me something that isn't in Google yet =P

_________________
<New Sig In the Works ;) >
I dare you. Stay alive in this Bloody RP ~ Turn51. Do it... now!


Top
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours



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

Jump to:  
cron
WarLingo Android Mobile Game

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group  
Copyright Tacticsoft Ltd. 2008   
Updated By phpBBservice.nl