Basic class structure

I've managed to create several applications in AS 3 without
ever going face to face with packages and classes. I know that
seems hard to believe, but anyway-- now I want to use something in
the corelib and can't figure where I'm supposed to put these files
I've downloaded. I know this is sub basic but would appreciate
help.

funonmars,
> Hi David, Thanks for your help.
Sure thing!
> I tried to implement your class structure, then gave it
a rest, then tried
> again today to no avail. Here's a
>
http://henryjones.us/articles/using-the-as3-jpeg-encoder
to the
> JPGencoder demo that got me interested,
Gotcha. Yes, that link helps. I ran through the tutorial
(it's
surprisingly quick!) and met with success. There are various
ways it
*could* be done -- classpath preferences are flexible -- but
here's what I
did.
In the tutorial, just beneath the "First Things First"
heading, Henry
writes:
"Once you have the library, just drop it into your classes
folder and you
are ready to go. Now we can import the JPGEncoder."
The phrase that's open to interpretation is "your classes
folder." For
my development workflow, just personal preference, I keep
third party AS2
and AS3 classes in these folders:
C:\Documents and Settings\<username>\My Documents\My
Projects\ActionScript
2.0 Classes
C:\Documents and Settings\<username>\My Documents\My
Projects\ActionScript
3.0 Classes
These corelib classes are written in AS3, so I put them into
my
ActionScript 3.0 Classes folder. Specifically, I visited the
Google Code
repository linked from Henry's site:
http://code.google.com/p/as3corelib/.
I downloaded corelib-.90.zip and extracted its contents to my
desktop (this
created a folder called corelib-.90 on my desktop). Inside
that folder, I
found a src subfolder. I assumed that meant "source," so I
opened it -- and
sure enough, there was the expected com folder. Inside that
com folder was
an adobe folder, and so on. The JPGEncoder class was
ultimately in this
folder structure: com\adobe\images\JPGEncoder.
I already had a number of third party AS3 classes in my
ActionScript 3.0
Classes folder. Of those, some are located inside a root
folder named net,
some in edu, and some in com. My com folder already had a
number of
subfolders inside it, but not yet adobe; so I dragged the
adobe folder
(along with all of its subfolders) from the corelib-.90
folder on my desktop
into my ActionScript 3.0 Classes\com folder.
From the standpoint of ActionScript 3.0 Classes, then, I had
a
com\adobe\images folder structure that led to the class file
in question.
Here's the relevant classpath setting in my Flash
preferences:
C:\Documents and Settings\<username>\My Documents\My
Projects\ActionScript
3.0 Classes
Based on that classpath setting, here's my import statement:
import com.adobe.images.JPGEncoder;
I can see now, in my previous email, that I accidentally
misled you with
a suggestion for the wrong import path (apologies on that! I
misread your
folder structure). In short, the import path needs to match
the folder
structure of the class files themselves -- from the starting
point of their
parent-most (aka root) folder.
I hope that clears it up!
> Your book arrived today, so maybe that will help me make
> sense of it.
Foundation Flash CS3 for Designers is a FLA-centric book, so
it may not
help you especially with external class files -- but I
certainly hope you
get good use out of it! :) Tom and I tried to cover a broad
range of
topics.
David Stiller
Adobe Community Expert
Dev blog,
http://www.quip.net/blog/
"Luck is the residue of good design."

Similar Messages

  • Basic IDOC Structure Enhancement

    My requirement is to add a new segment to the basic IDOC structure
    I have tried this using a <b>Z</b> type IDOC with reference to the basic type then i am getting an error saying that clipboard is empty.
    Please help me to solve this.
    <b>Thanq</b>

    My requirement is to add a new segment to the basic IDOC structure
    I have tried this using a <b>Z</b> type IDOC with reference to the basic type then i am getting an error saying that clipboard is empty.
    Please help me to solve this.
    <b>Thanq</b>

  • Exporting Class structure

    Is there a way to export your class structure to something like Excel?  Currently, I expanded all the classes with my Data Explorer in Webi, copy all, and pasted them in Excel.  I get all objects this way but they loose their folder structure.  Is there a better way to do this?
    Thanks,
    Jimmy

    Shreya,
    Thanks for the quick reply.  Print to pdf is great if I only needed a read version but I am looking for an easy way to export the structure so I can modify it in Excel.  Sure I can copy from the pdf and paste it in Excel but I'll loose the structure.  Is there a way to export the class structure to Excel without loosing the structure?
    Thanks,
    Jimmy

  • Help to read the complete basic idoc structure

    Hi,
    I have the following Basic Idoc structure
    1. /DSD/HH_CONTROL01- Control data for hand held interface.
    1.1 /DSD/HH_E1CTHD01- Control data header.
    1.1.1 /DSD/HH_E1CTAD02- Control idoc- Application data header
    1.1.1.1 /DSD/HH_E1CTID03- Control idoc- Application data item
    1.1.1.2 /E1WXX01- Segment for customer enhancement to be used as requirement.     
    OBSERVATION----
    1. The basic idoc (1) is found in table EDBAS and description in EDBAST.
    2. The segments (1.1.1.2) are in table EDISEGMENT and EDISEGT.
    3. All the other structures (1.1), (1.1.1), (1.1.1.1) are found in tables EDISDEF and some in EDISEGMENT.
    QUESTIONS----
    1.What query can I write to get the above basic idoc structure?
    2.How are the relationships mapped among the tables?
    Thank you, points will be awarded for your time and answers.

    REPORT  ZPGM_BASIC_IDOC_IMPRT_TO_PCNTR.
    TABLES: EDBAS, " Basic types
            IDOCSYN. " Syntax Description for Basic Types
    DATA: BEGIN OF ITAB OCCURS 0.
            INCLUDE STRUCTURE IDOCSYN.
    DATA: END OF ITAB.
    SELECT A~IDOCTYP " Basic type
           B~NR      " Sequential Number of Segment in IDoc Type
           B~SEGTYP  " Segment type
           B~PARSEG  " Name of parent segment
           B~PARPNO  " Sequential number of parent segment
           B~PARFLG  " Flag for parent segment: Segment is start of segment
                                                                 "  group
           B~MUSTFL  " Flag: Mandatory entry
           B~OCCMIN  " Minimum number of segments in sequence
           B~OCCMAX  " Maximum number of segments in sequence
           B~HLEVEL  " Hierarchy level of IDoc type segment
           INTO TABLE ITAB
           FROM EDBAS AS A INNER JOIN
                IDOCSYN AS B
            ON AIDOCTYP EQ BIDOCTYP.
    SORT ITAB BY IDOCTYP NR." Sort the idoctype and according the segment "
                            "number for the right order in the basic idoc
                            "syntax.
    LOOP AT ITAB.
      AT NEW IDOCTYP.
          WRITE:/ '***********'.
          WRITE:/1 ITAB-IDOCTYP.
      ENDAT.
         WRITE:/.
         SY-COLNO = 5 + ( ITAB-PARPNO * 2 ). " this displays the segments
                                             "under the respective parent
                                             "segments.
         WRITE AT SY-COLNO ITAB-SEGTYP.
    ENDLOOP.
    Thank you.

  • Good class structure?

    what is a good class structure for example i will have a GUI for displaying personnel.
    1. create the FrmPersonnel.java
    public class FrmPersonnel{
    all codes for designing the GUI.
    2. create the JDBC connection class RSetPersonnel.java
    public class RSetPersonnel{
    public ResultSet rsProfile()
    ResultSet rs=null;
    rs.executQuery("SELECT * FROM personnel");
    return rs;
    is this the way it should be?

    what about in my GUI i have these navigation buttons
    top, previous,next and bottom, so i need to have a
    ResultSet that has all the rows of the personnel
    table. what is the best approach to handle this kind
    of data?what if personnel has 100,000 rows.if you want to page your data then page your data.
    Don't fetch 100,000 rows at once. The user doesn't want to see 100,000 at one time. The user wants at the very most to see maybe 100 rows at one time. Probably even less.
    So get 100 rows. Then when the user clicks next get the next 100.
    And so on.
    This is called pagination and it's not only applicable to JSP/Servlets or web applications in general but all GUI tied to data sources.

  • Basic enterprise structure

    hi dear sapient,
    please explain me
    While we are decideing basic enteprise structure form non-sap to sap how can we differentiate that in sap which one we wil take as enterprise structure element  e.g comp code-cont area-operating con-profit center-plant etc...  but here cost center is not included as element.why?
    why we are creating cost element. what is the difference between primary cost element & secondary element. give some example of both
    thanks
    soraj kumar

    Hi soraj,
    Cost Element: It is a carrirer of cost. It carries a cost from one cost centre to another cost centre. we can not move the cost to one cost centre  to another cost centre without cost element. there are two kinds of cost element in sap
    1. PRIMARY  cost elements: It is created in FI modue and for primary cost element General ledger must be created first. and the no of cost elemnt and gl account will be same .Example Rent account . suppose Rent GL account no is 111111 and the primary cost element no will be also 111111.Sap defined category for Primary  cost element like 1,11, etc
    2. SECONDARY  Cost elemnt: It is created within the co module. it is used for assessment and distribution. there is no condition for Gl account in case of secondary cost element. suppose if you want to allocate rent expendiure to different department like production and finance then you wll use secondary cost elemnt. sap defined category for secondary cost element like 41,42,43, etc
    Thanks
    Ranjit

  • Persist class structure with XMLEncoder

    Hi,
    I am tring to persist the following class structure with an XMLEncoder:
    public class Header {
         public HeaderItem createHeaderItem() {
              //do some initialization
         public HeaderItem getHeaderItem() {
              return item;
         //no getter here
    public class HeaderItem {
         public void setName(String name) {
              this.name = name;
         public String getName() {
              return name;
    //creation
    Header h = new Header();
    HeaderItem item = h.createHeaderItem();
    item.setName("test");I dont want to use setters, so I need custom PersistenceDelegates to deal with the factory method. I have read the sun tutorial and tried several things
    but I don't succeed in persisting this structure. Can anyone help me?
    kind regards,
    Christiaan

    Does no one know a solution for this?

  • Xcode, how do you take an app from an idea to a data model, data structure, or class structure?

    Hey everyone!
    I'm a beginner xcoder and computer engineering sophomore and have literally spent every hour of the past few weeks reading as much as I possibly can about becoming a developer.
    I've found plenty of documentation, and guides on how to do very specific things in xcode and objective-C but am still looking for more information on one topic; how do you decide which data models/structures/controllers etc to use?
    I mean, you personally. I've been looking for a resource on this and have not been able to find one. I just finished Apple's iOS Developers Guide and they mention "choosing a data model" but do not describe them in much detail.
    The following is what is provided in the guide:
    ● Choose a basic approach for your data model:
    ● Existing data model code—If you already have data model code written in a C-based language, you
    can integrate that code directly into your iOS apps. Because iOS apps are written in Objective-C, they
    work just fine with code written in other C-based languages. Of course, there is also benefit to writing
    an Objective-C wrapper for any non Objective-C code.
    ● Custom objects data model—A custom object typically combines some simple data (strings, numbers,
    dates, URLs, and so on) with the business logic needed to manage that data and ensure its consistency.
    Custom objects can store a combination of scalar values and pointers to other objects. For example,
    the Foundation framework defines classes for many simple data types and for storing collections of
    other objects. These classes make it much easier to define your own custom objects.
    ● Structured data model—If your data is highly structured—that is, it lends itself to storage in a
    database—use Core Data (or SQLite) to store the data. Core Data provides a simple object-oriented
    model for managing your structured data. It also provides built-in support for some advanced features
    like undo and iCloud. (SQLite files cannot be used in conjunction with iCloud.)
    ● Decide whether you need support for documents:
    The job of a document is to manage your app’s in-memory data model objects and coordinate the storage
    of that data in a corresponding file (or set of files) on disk. Documents normally connote files that the user
    created but apps can use documents to manage non user facing files too. One big advantage of using
    documents is that the UIDocument class makes interacting with iCloud and the local file system much
    simpler. For apps that use Core Data to store their content, the UIManagedDocument class provides similar
    support.
    I suppose my question boils down to, how do you decide which structures to use? If you can provide an example of an app idea and how its implemented that would be very helpful and much appreciated!
    For example, to implement the idea of an app which allows users to progress through levels of knowledge of a certain subject and rewarding them with badges and such (this is not an actual app just a whim) how would one model that?
    Thanks in advance for all your help!!!

    SgtChevelle wrote:
    how do you decide which structures to use?
    Trial and error.
    I wish I had a better answer for you, but that pretty much encapsulates it. There is some, but not much, good wisdom out there, but it takes a significant amount of experience to be able to recognize it. The software development community if currently afflicted with a case of copy-and-paste-itis. And the prognosis is poor.
    The solution is to be brutal to yourself and others. Focus on what you need and ignore everything else. Remember that other people have their own needs and methods and they might not be applicable to you. Apple, for example, can hire thousands of programmers, set them to coding for six months, pick the best results, and have the end-users spend their own time and monety to test it. If you don't have Apple's resources and power, think twice about adopting Apple's approach. And I am talking from a macro to a micro perspective. Apple's sample and boilerplate code is just junk. Don't assume you can't do better. You can.
    Unfortunately, all this takes time and practice. You can read popular books, but never assume that anyone knows more than you do. Maybe they do and maybe they don't. It takes time to figure that out. Just do your best, ignore the naysayers, and doubt other people even more than you doubt yourself.

  • Where can i find basic data structure to implement linklist,priority que ?

    where can i find basic datastructure and how to shift left and right and similar things to do in java plzz help me in this regard i ll be great ful to u
    thanks in advance

    I assume from your question you're new to Java. You'll find Java does not have "structures" per se as in languages such as C. Instead, everything is implemented in classes, which can hold both data and code (methods) to operate on the data.
    Regarding shifting left and right, check out the [url http://java.sun.com/docs/books/tutorial/java/nutsandbolts/op3.html]Java tutorial on operators.

  • Problem in creating EJB and WebService using complex class structure

    Hi All,
    My requirement is like :
    I have a class with very complex structure.
    I have also used external .jars.
    Now when I have created an EJB with a method's return parameter as above class.
    But when I am creating a Webservice, it doesnot allow me to select this method.
    Not able to configure why ?
    Please Help.
    Thanks.

    Hi,
    I have gone through your code and the problem is that when you create jar it takes a complete path address (which is called using getAbsolutePath ) (when you extract you see the path; C:\..\...\..\ )
    You need to truncate this complete path and take only the path address where your files are stored and the problem must be solved.

  • SetBackground and basic class and method calling stuff

    A few days ago I posted a thread about some paint problems. I was then told I was a bad programmer :P So I've read up a little on the subject. Hope this code looks better then the last (event though it's not as "complete" as the last one was).
    Now I've got a few new problems though.
    // Java Document
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Diamonds2 extends JFrame{
        public static void main(String[] args) {
            JFrame f = new JFrame("Diamonds 2");
            f.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    System.exit(0);
            Container panel = new DiamondsPanel();
            f.getContentPane().add(panel, BorderLayout.CENTER);
              Container statusPanel = new DiamondsStatusPanel();
              f.getContentPane().add(statusPanel, BorderLayout.PAGE_END);
              f.setBackground(Color.black);
            f.pack();
              f.setResizable(false);
              f.setVisible(true);
              Game d2 = new Game();
              d2.game();
    class DiamondsPanel extends JPanel {
         public static int BallRadius = 16;
         public static int posx = 100;
         public static int posy = 1;
        public DiamondsPanel() {
            super();
            setOpaque(false); // we don't paint all our bits
            setLayout(new BorderLayout());
            setBorder(BorderFactory.createLineBorder(Color.black));
        public Dimension getPreferredSize() {
            Dimension panelSize = new Dimension(800, 580);
              return panelSize;
        protected void paintComponent(Graphics g) {
              super.paintComponent(g);
            Dimension size = getSize();
              // set color
             g.setColor (Color.red);
             // paint a filled colored circle
             g.fillOval (posx, posy, BallRadius, BallRadius);
         public void updateGamePanel() {
              posy--;
              repaint();
    class DiamondsStatusPanel extends JPanel {
         public DiamondsStatusPanel() {
              super();
              setOpaque(false);
              setLayout(new FlowLayout());
              setBorder(BorderFactory.createLineBorder(Color.black));
         public Dimension getPreferredSize() {
            Dimension panelSize = new Dimension(800, 20);
              return panelSize;
        protected void paintComponent(Graphics g) {
              super.paintComponent(g);
    class Game {
         public void game() {
              while(0 < 10) {
                   try {
                        Thread.sleep(10);
                   }     catch (InterruptedException e) {}
              //     System.out.println("Something is happening");
    }I can't set the background. I've tried to apply setBackground color to the constructors of each of the panel classes too but that won't work either.
    Secondly. How should I do the animation (the red circle should move) now. I knew how to do it before but with this new structure (I found in some swing tutorial) I can't figure it out. I've tried intializing a thread in the class Game since it couldn't be done (according to the compiler) in main. Also, before I could use isVisible() to run the while-loop now that didn't work either and I suppose using 0 < 10 is not a very good way to do it. I also made an update method in the DiamondsPanel class but I don't know how to call it. I understand I'm not doing this as it should be done. I also can't find any place that makes me understand how to do it :P
    Any answers will be welcomed with open arms (except mean ones xD).
    Thanks alot

    Styrisen wrote:
    I got the background to work.. really don't know what I did. It works thoughGreat
    So should the code for animating the ball be inside the DiamondsPanel class? Or where should it be?This is one of the crucial questions when developing an OOP app: what objects to create and what code goes where? I have not done animations, but I believe that there is a 2D forum here in the Sun forums. You might consider asking this over there (but if you do, please be sure to have each thread reference the other so as to avoid duplication of effort from the volunteers who help).
    How should the code look like? Should I use runnable? You're definitely going to need to use separate threads. That much I'm sure of.
    Should I make an infint loop? No.
    Should I use a timer class? Probably.
    Is it a bad idea to divide the panels into classes?Not only is it not a bad idea, it may be a good one.
    Good luck!
    Pete

  • HTML5 basic page structure...is this about right?

    So my first attempt at creating a site using HTML5. I'm using my new portfolio site as an opportunity to practice some new skills...
    Can anyone tell me if my basic structure is correct?
    If anyone wants to see the (in progress) site so far, I have it posted here:
    http://firewalkcreative.com/2012/2012.html
    I'm playing around with some responsive elements for the first time...fun stuff! Still far from finished, but what I have so far works best in Chrome.
    Thanks in advance for any help!
    Elliott
    EDIT: Don't know why but the code I inserted didn't show up. Probably easier anyway to just click the link above and view source... Thanks!

    The link above is to a site showing a 404 error.
    Jarrod

  • Strings, Characters, and Basic Control Structures

    Newbie question time (a groan emits from the veteran audience):
    Bear with me :)
    I have a text field, and I want to make sure that only letters are typed in the field, and not numbers, nor nothing at all.
    Note: this is located within an actionPerformed for a button.
    Using my poor logic, I attempted to create the following lines of code:
    add: {
    String name = addNameField.getText();
    for(int i = 0; i == name.length() - 1; i++)
         char x = name.charAt(i);
         if(Character.isLetter(x) == false)
         {area.append("Names are usually made up of letters." + "\n"  + "\n");
         break add;}
    [MORE IRRELEVANT CODE]
    Basically, if a person types a word, i need the actionPerformed to go about as usual. However, if a number, symbol, or nothing is typed in, I need for it to get the dickens out of the actionPerformed and accomplish nothing. In the irrelevant code is a catch (Exception exception), so perhaps i could throw it there if it didn't work. I don't know, I'm new to this game. Any questions about the question will be answers, and any help would be greatly appreciated.
    Thanks :)

    U can use InputVerifier for this purpose..
    Simply make text fiels and call setInputVerifier() API of the JTextField, The argument of this API is InputVerifier object....
    U can take below code as sample..
    In that code Value verifier is class extended from InputVerifier In that class, Check the range of text field. In below example I try to check text field range as 0 to 255.... like the below example u can make text field range as "a" to "z"
    m_text1 = new JTextField(10);
    m_text1.setInputVerifier( new ValueVerifier() );
    class ValueVerifier extends InputVerifier
    public boolean verify(JComponent input)
         boolean flag = false;
              JTextField tf = (JTextField) input;
         for( int i=0;i<256;i++)
         String str = tf.getText();
    if ( false == str.equals(""))
              Integer int1 = new Integer(str);
         int c = int1.intValue();
              if ( (i == c) )
              flag = true;
              else
                   flag = true;
         if( false == flag )
              tf.setText("255");
         return flag;
    best wishes
    Praveen

  • Large App Design Class Structure - OOP or MVC?

    Helloooo Everyone!!
    I used flash a few years ago and am now getting into as3, I began watching hours of as3 tutorials and training in preparation to build a web app with multi user access and the structure of the design is a bit beyond my skills and need help please.
    My problem: I can design well in flash, love the graphic design tools and can draw the screens the way i want my app to look; i can build different library components and fla's and set up the project files.
    I best give a brief explanation of the system i want to design.....
    I am building an app, where different business types all work together on properties, repair projects and associated property data.
    For example a property owner owns a property, an agent runs the property for the owner and finds a tenant to live in the flat, the tenant who lives in the flat will use the online facility to tell the agent about repairs needed, or pay rent online, or check diary events such as when he needs to renew his tenancy or insurance. The repair the tenant requests will be authorised by the agent and a tradesman will then have to interact with the repair details and provide a quote or just carry out emergency work.
    First dilemma... Do i use MVC Architecture Or Object Oriented programming with custom classes.
         I was planning on the latter - OOP
         I cant quite get my head around how to think about structuring the folders and classes???
    For example. Do i build a class for 'Property' a class for 'projects' a class for 'project tasks' etc
    Is it that you think about Admin for example and build a class for invoices, a class for quotes.
    Different users will access the same property but see different information relavent to them only
    Could someone please mentor me through the design process? You can see the flash design at www.milesquicker.com/projectplanning
    I would be eernally grateful
    Miles

    MVC is an OOP Design Pattern.
    For a program like this i wouldn't use the MVC design pattern.
    I will probably create a class for each section in my application.
    Design Patterns are an advanced topic of OOP and i dought that you will be able to master it after watching
    a few tutorials, same goes for OOP. If you are just starting with programing i would suggest you to start with procedural programming
    and when you feel comfortable with that you can get into OOP although for an application like yours OOP will be the best solution.
    I dont know anything about your programming skills but the pull of an application like that they got to be really good.
    I would also suggest that you will look into flash and mysql because you will have to create databases that will hold the information.

  • What is the most effective way to get ospf to function and what is the basic command structure

    I am doing a project of ospf and need to know if I am on the right tract somehow these commands are not working and wondering if I am doing something wrong.

    Hello,
    I would say the basic configuration for OSPF should be:
    1. router ospf  1
             2.   Router-id 2.2.2.2 ( if you want to hardcode the router-id else you can go with the default which would be the highest interface on your router)
             3.  Network  192.168.0.0 0.0.0.255 area 0 (telling the router * I care about the 192.168.0 part of my ip and the last part can be anything thus the 255)
        4.      Net   192.168.2.2 0.0.0.255 area 0 (telling the router * I care about the 192.168.2 part of my ip and the last part can be anything thus the 255)
    OR for the 192.168.0.0 and 192.168.2.0 you could just have 192.168.0.0 0.0.255.255 meaning I only care about 192.168 and 0.0 can be anything.
    The four lines above would be my basic config for ospf. Also have a look at these links, they provide some insight into ospf and how it should be configured. http://www.cisco.com/en/US/docs/ios-xml/ios/iproute_ospf/configuration/12-4/iro-cfg.html#GUID-588D1301-F63C-4DAC-BF1C-C3735EB13673
    http://www.cisco.com/en/US/tech/tk365/tk480/tsd_technology_support_sub-protocol_home.html
    I have also experienced that I cannot configure all OSPF commands on PT but prob GNS3 allow all configs.
    HTH.
    DJ.

Maybe you are looking for