Using classes in the library

Hello all ,I just read an action script book ,for an exercise
the book told me to download a library to use it's actions script
files in the library ,I downloaded the library from
http://www.rightactionscript.com/ascb
, I tried to set the library folder in classpath of the flash file
,but the following codes doesn't work:
package {
import ascb.drawing.*;
import flash.display.*;
public class PenClassTest extends MovieClip {
var sampleSprite = new Sprite();
var pen:Pen = new Pen(sampleSprite.graphics);
pen.drawLine(0,0,10,0);
pen.drawLine(15,0,25,0);
pen.drawLine(30,0,40,0);
pen.drawLine(45,0,55,0);
and the errors are :
1120: Access of undefined property pen.
and it means that it can't distinguish the Pen class wich is
resides in ascb/drawing directory :
would you please help me .
Sincerely yours Mohsena

Hello and thank you very much for your attention ,I examined
both of the way you recommended me ( setting ascb in the
actionscript preferences , and either put the ascb folder next to
the movies .fla file ,but the I encounter the following errors:
1120: Access of undefined property pen.
1120: Access of undefined property pen.
5001: The name of package 'ascb.drawing' does not reflect the
location of this file. Please change the package definition's name
inside this file, or move the file. C:\ascb\drawing\Pen.as
would you please help me ,sincerely yours Mohsena

Similar Messages

  • How can you retieve a list of classes from the Library

    Is it possible to retrieve a list of the Linkage or Export
    Classes from a swf library dynamically?
    I am building an application where I allow the user to load
    an asset swf at runtime, then they can choose to load any Exported
    class from the library of the swf. Currently it works if you know
    the name of the asset, that you want to load, but I would like to
    be able to bring up a chooser list of the assets, rather than
    having to type the Class names.
    So far I have only seen examples where "if you know the class
    name you can load it", but nothing concerning pulling the list.
    There must be a list somewhere in flash, I just want to tap into
    that.

    I saw this before and did not have a chance to go through it
    completely.
    As I was reading it, though it did not seem to be giving me
    the answer, as they seem to extend the Export clips in the library
    by extending the class.
    I'll run through that and see.
    It does give me another idea though.
    (crazy) Idea:
    What if I extend the loader class and add a method, kind of
    like what they are doing on the document class of the loaded swf,
    to pull the class names. They hard code in the class names into the
    array though.... so that is the crux of the issue.
    Somehow I think this concept is doomed to fail but, I will
    also see if that is possible.
    I suppose for the application, I could require that any user
    would use a swf with a document class that has the getAssets()
    method.... also has some problems .... namely dealing with the
    issue of "what if they do not extend" and having it fail
    gracefully.
    oh well, food for thought... I will leave this open for now
    and perhaps I will post some answer.

  • I don't own a MAC. I can probably use one at the library. I am trying to publish my book with Apple's ibooks, etc. Since my files are in Word.doc or html; how can I format my book so as to publish it?

    I don't own a MAC. I can probably use one at the library. I am trying to publish my book with Apple's ibooks, etc. Since my files are in Word.doc or html; how can I format my book so as to publish it?
    www.amessageforthehumanrace.org

    Use an aggregator and follow their instructions for formatting.

  • HT1420 After updating to 11 for itunes and ios 7 for phone - I lost over 3500 songs from my itunes.  My ipod still has 4100 songs on it less the most recent ones I have purchased.  Can't my ipod be used to recreate the library in itunes?

    After updating itunes to 11.1 and phone to ios7, I lost more than 3500 songs from my library. My ipod has 4185 songs less the most recent I purchased.
    Is there no way an ipod can be used to restore the lost music?  Yes, some of it was from cds but were done a long time ago.  Obviously it was acceptable for me to compile this music then, now they want to say since it all wasn't purchased, I can't have what was already mine?  Plus I do not use nor want to use the cloud, but it keeps creeping up even though I don't want or use it.  HELP! 

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • Erasing unused, (never-to-be-used) images from the Library. How, please?

    Is there a way to Globally-Delete a subset of, or all of, the images in the Library? I want to erase all images that are NOT being used in a Album, Slideshow, or Book.
    I take many near-duplicate shots and later select only one or two for use. The accumulated never-to-be used images are becoming overwhelming. doing it manually will take many hours and there is no way to be sure that a Library image is not used in a Album, Slideshow or Book...at least that I am aware of.
    I really do not need to keep 8445+ images in the Library
    Many thanks,
    Fred

    Make a smart album - album is not any
    and delete from there in groups of 100 or so emptying the iPhoto trash for each group - command-option-delete deletes photos from the library while you are in an album -- or you can flag 100 or so and control-option-delete deletes flagged photos
    LN

  • Use Home sharing, the library is exported, but

    Using the Home sharing between my new computer and the old one, I was able to export the library from the old computer to the new computer. But it stays in the library on the new computer, what should I do next to move to the approriate place such as Music?

    Go to the Advanced tab in iTunes' Preferences.  Is the location specified for the iTunes Media folder the same as the location where you exported the library?  Change the the location in iTunes Preferences accordingly.

  • I cannot connet to app store using wifi in the library

    I have recently been in the local library to connect to the app store via wi fi as this is required for some apps but i cann connect to i tunes or the app store, i can connect to the net BBC i player etc.
    Does anyone know why i cannot connect

    The library network probably has a firewall which is blocking use of the ports needed to access the App store.
    See this Apple for information: http://support.apple.com/kb/ts3297

  • I have successfully transferred my library of photos to Aperature. Do I have to keep iPhoto with the same photos in it? In other words, once I've transferred I don't want to use space saving the library in iPhoto AND Aperature.

    I am wondering if I need to keep my iPhoto program and library once I've imported all of my iPhotos to Aperature. Seems like I am using double the space. I'd rather only have Aperature rather than both programs if that makes sense

    If you have the files imported into Aperture you don't have to keep the iPhoto database. Make sure they are really imported and not only referenced. Probably it's best to keep a back up of the iphoto database some time.

  • How to use classes with the Movie Clips

    Hi guys!I have a movie clip called teacher.It's assigned to a class called teacher.It has a location(room).I have multiple rooms and so i want the teacher to be only visible in the room it's at.I have  two buttons for each room.The problem is the teacher doesn't disappear when it's in the playroom.
    package  {
              import flash.display.MovieClip;
              public class teacher extends MovieClip {
                        var room:String;
                        room="classroom";
                        this.croom=croom;
                        public function teacher() {
                                  var teacher:teacher=new teacher();
                        if(teacher.room!==croom){
                                  teacher.visible=false;
                        if (teacher.room==croom){
                                  teacher.visible=true;
    clroom.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
    function fl_MouseClickHandler(event:MouseEvent):void
              croom = "classroom";
              classroom.visible = true;
              playroom.visible = false;
    btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
    function fl_MouseClickHandler_2(event:MouseEvent):void
              croom = "playroom";
              classroom.visible = false;
              playroom.visible = true;

    Where is all of the code you just showed?
    Only a portion of it is a class file's code, and of that class file's code, only a portion of it is valid.  The paret where you have the conditional checking the treacher's roon is not incorporated proerly... it needs to be inside some function of the class. 

  • Using JNIWrapper load the Library

    Hi,
    I am using JNIwrapper , i want to load the dll(usb4xx) . I write the code and copied all JNIWrapper jar files and Pasted to \jre\lib\ext\.
    Now my program compiled. but in runtime it throws exception.
    My Error Message is
    Exception in thread "main" java.lang.NoClassDefFoundError: com/jniwrapper/n (wrong name: com/jniwrapper/N)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at com.jniwrapper.Parameter.<clinit>(SourceFile:22)
    at CrossMatch.<init>(CrossMatch.java:38)
    at CrossMatch.main(CrossMatch.java:189)
    Anyone knows please tell me.
    Regards
    devi

    Hello and thank you very much for your attention ,I examined
    both of the way you recommended me ( setting ascb in the
    actionscript preferences , and either put the ascb folder next to
    the movies .fla file ,but the I encounter the following errors:
    1120: Access of undefined property pen.
    1120: Access of undefined property pen.
    5001: The name of package 'ascb.drawing' does not reflect the
    location of this file. Please change the package definition's name
    inside this file, or move the file. C:\ascb\drawing\Pen.as
    would you please help me ,sincerely yours Mohsena

  • How do I create and use folders in the library?

    I cannot see how to do this - are there any instructions available, please?

    I think because of how Muse works this will be a problem unless they do an update to solve that. Not sure how as you would normally code your stylesheet for your web project and content holder or not the styles not being inline would happen automatically.
    You got a link to examples of your issue?

  • How to use XPath in the adapter framework

    I am creating a XI adapter to our system.
    In the adapter I want to use XPath expression.
    I use the classes from javax.xml.xpath.*
    This way does not work in the XI application server. (Java 1.4.2)
    What is the correct way? Which packages/classes must be used?
    Miklos

    Hi Miklos,
    The package javax.xml.xpath was introduced with Java 5 (1.5), thus it is not available in XI which runs Java 1.4.2. There are (at least) a couple of ways to use XPath in Java 1.4:
    1. Use a third-party library that supports XPath, for instance Xalan-J from Apache.
    2. Embed your XPath expression in an XSLT transformation, execute the transformation using classes from the javax.xml.tranform... packages (which <i>are</i> part 1.4) and extract the result.
    Cheers,
    Thorsten

  • Using classes from another jar?

    Hello,
    Could anybody show me an example for how to put a shared library of classes in one jar file, and put an applet in another jar while the applet can use classes in the first jar file? Is this even possible at all???
    Thanks!

    norsez, did you had a look at the Java Tutorial:
    Using the APPLET Tag
    http://java.sun.com/docs/books/tutorial/applet/appletsonly/html.html
    It says: 'You specify JAR files using the ARCHIVE attribute of the <APPLET> tag. You can specify multiple archive files by separating them with commas [...]'. I assume all listed JAR files are in the classpath then and you should have access to their classes.
    Let us know if it works!
    HTH, Markus

  • Placing a instance from the library and parameters?

    Ok, here is just a general question about the use of classes in flash. Say I have a class called ClassA that wants two parameters passed in.
    So i create an instance of it and add it to the stage with code like this:
    var myInstance:ClassA = new ClassA("something", "somethingelse");
    addChild(myInstance);
    That works all well and good!
    Now, is there a way i could manually place an instance of ClassA from the library palette and tell it the two parameters?
    I hope this is clear.

    Why would you do that?
    In any case, when you grab a symbol from the library - constructor is automatically invoked. Thus - you cannot pass parameters into constructor. Nevertheless, you can expose corresponding parameters as API and set them on an instances that was placed on timeline at authoring.

  • Loading into the library at runtime?

    I have built a flash animation (for a web site) that requires a number of decent quality JPG images.  I don't display all of these at the start, so I don't want to wait for them all to load before starting the animation.  Thus I want to be able to load these images in the background - the obvious process would involve MovieClipLoader.loadClip() method.  This works fine if I am loading into an INSTANCE of a moveclip (either existing on the stage or one that I creat in actionscript) - but I really want to load into a library movieclip.
    The problem is that I end up using these images in two different movies on the stage - each pulls from a movieclip in the library (that contains the image I want).  So my original thought was simply to load (using loadClip()) into the library movie - which in turn would show up in the two stage movieclips that have this library clip in the timeline.  However, I cannot seem to get loadClip() to work with a library object.
    I tried exporting the library movieclip to actionscript (giving it a name) - but loadClip() doesn't seem to want to load into it.  I can only get loadClip() to load into an instance that exists on the stage.
    Sorry if I am asking a stupid question - I don't do a lot of flash programming - although I have extensive programming experience in other languages.
    So can this be done?  Is there another way to accomplish what I want to do?
    I can easily load into an instance of a movieclip - but I don't want to load each image twice (into two different movieclips that I need to manipulate) - hence my desire to load into a single library object that end up having multiple instances on the stage.
    My other thought was to load into an instance and then COPY that instance to the second instance.  But I can't seem to find a way to copy one clip into another clip?
    Any pointers would be very much appreciated.
    Just to clarify, here is an example.
    *  I have several library movieclips (call them clip1, clip2, clip3... )  which contain a single frame with a JPG image in that frame.
    * I have a library movieclip called bkgnd which has 10 frames in it.  Each frame has an instance of the different clips above (e.g. frame 1 has clip1 in it, frame 2 has clip2 in it, frame 3 has clip3 in it etc).  At run time, this move is manipulated through gotoAndStop() to display a particular image.
    * I use this bkgnd library movieclip in TWO places on the real stage (two instances).  Each is controlled through actionscript to display particular frames (particular images) through the gotoAndStop() method.
    * I want to be able to load the individual images at runtime - my thought was to use loadClip() to load JPG files into the clip1, clip2, clip3... library clips.  However, loadClip() doesn't seem to want to load into a library clip.

    Thank you.  I was able to use the bitmap class draw function to accomplish what I wanted.
    It got pretty convoluted though.  Used actionscript on instances of hidden movies to initiate the loading.
    Had a loader bar on images when they are used - but wanted them to load asynchronously in the background (use the first while others are loading).
    There are lots of little "gotchas" with this stuff, and while flash is very powerful, it is difficult to document / take apart.  Because action script is all over the place and interacts in very funny ways, it can be very complicated to figure out how all the timelines mesh and what code is running when.
    I have to say I am quite disappointed in a few items - one of which is that if you associate actionscript with a particular item on the stage (a movie clip), you don't see it highlighted in the timeline and you don't see it on the movie inspector.  It is kind of hidden out there unless you know to look for it.
    Anyway - thanks again.  Definitely did the trick..... Warren

Maybe you are looking for