Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 600377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:35:57+00:00 2026-05-13T16:35:57+00:00

I don’t like external as files. Most developers prefer this and claim it’s better.

  • 0

I don’t like external as files. Most developers prefer this and claim it’s better. Explain why is it better to use classes in ActionScript 3.0.

My ActionScripts are different. I strip the classes away and paste it in the Flash IDE. 9 out of 10 times it works fine. My question is Socratic, but I really feel ignorant about this, since there is less code for what I’m trying to do. Have fun with this.

Here’s a tutorial I dissected – "example tests keyboard output"

//AFTER
//remove curly brackets and "outer shell of class definitions"
//remove class function "don't need it"
//function at bottom, remove "public", make sure it has a body {}
var _time_scale:Number = .25; 
var _frames_elapsed:int = 0; 
var _clip:MovieClip; 
 
function handleEnterFrame(e:Event):void { 
_frames_elapsed++; 
_clip.gotoAndStop(Math.round(_clip.totalFrames * _frames_elapsed * _time_scale)); 
}

//BEFORE
package { 
    import flash.display.MovieClip; 
    import flash.display.Sprite; 
    import flash.events.Event; 
 
    public class Main extends Sprite { 
 
        private var _time_scale:Number = .25; 
        private var _frames_elapsed:int = 0; 
        private var _clip:MovieClip; 
 
        public function Main():void { 
            _clip = new SomeClip; 
            addEventListener(Event.ENTER_FRAME, handleEnterFrame); 
        } 
 
        private function handleEnterFrame(e:Event):void { 
            _frames_elapsed++; 
            // we multiply the "real" time with our timescale to get the scaled time 
            // we also need to make sure we give an integer as a parameter, so we use Math.round() to round the value off 
            _clip.gotoAndStop(Math.round(_clip.totalFrames * _frames_elapsed * _time_scale)); 
        } 
 
    } 
}

There may be no answer, but there must be a definative explanation that makes sense.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:35:58+00:00Added an answer on May 13, 2026 at 4:35 pm

    This sounds like 2 questions:

    1) Why is it bad to put the code in the Flash IDE (CS4)?
    First, the editor in the flash IDE is historically awful. It just doesn’t have the features that I expect from an editor for code.

    Second, it can be hard to find code that’s in the timeline.

    Third, when you make a change in the ide and check it into your code repository (you do use version control, right?), the changes are binary and can’t be tracked and diffed easily.

    2) Why is object orientation good?
    Object orientation is about encapsulation. It’s not the only way to do things, but currently, it’s the most popular. Here’s a page that does a decent job of explaining it:
    http://www.alagad.com/blog/post.cfm/what-does-object-oriented-programming-do-for-me

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(Don't know if this is strictly on-topic, but I don't see any better Stack
Don't know how to explain it better but i'm trying to get a response
Don't ask me why but i can't use this method because I need to
Don't know if there is a better way to do this, so that is
Don't know if this is possible, but I have some code like this: val
don't know better title for this, but here's my code. I have class user
Don't dismiss this as a newbie question! It's not, I'm not, I've tried everything,
I don't know why, but this code worked for me a month ago... maybe
For some reason, after submitting a string like this Jack’s Spindle from a text
Don't know if this has been asked before, so point me to another question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.