ActionScript 3.0 :: Namespaces And Packages - Fail To Reference As-class From Fla File
Sep 26, 2009
Trying to migrate to AS 3.0 here, but are facing a tough time at kick-off: I have a base fla file located in a folder named "game". The "game" folder is in a folder named "northcreek" which again is in a folder named "no". For no other reason than that I read somewhere that this was smart. Anyway, I have in my (document) class under publish settings this: no.northcreek.game.Engine Both my "game.fla" and my "Engine.as" reside in the "game" folder, but I fail to reference my as-class from my fla file. What do I do wrong? It works if I simply remove all namespace names, and only type namespace, but I am trying to do it the right way here...
As the title says - is it possible to document my ActionScript packages / namespaces using the ASDoc comments and the included asdoc command line tool?
I'm teaching myself actionScript 3.I'm having some difficulty knowing which packages / classes to import from the flash core.I'm still a little shaky on the terminology but I mean these statements at the start of the main AS file.
import flash.display.Sprite;
Are there any good references / cheatsheets that describe what each flash.example.example provides? At least for commonly used packages.
this is the URL of the language reference website I have been using for Flash/AIR: [URL]Is this URL the correct one I should be using when I need to look up a class or method or property or something like that? Because it does not match up with what actually shows up in the Flash IDE when I type an import statement. Most of the packages match up but not all.
For instance, the reference URL has a fl.events package, and so do I locally, but my package seems to be missing lots of classes from it that the reference URL shows. This leads me to believe I don't have the latest SDK's or SWC's or whatever I need installed, whether they be Flash, Flex, Air, etc.Also, I have a few packages locally that don't show up in the reference URL. Things like "flash.debugger" and "flash.trace", they are not my custom classes, not sure where they came from.
Lastly, there are certain AIR classes missing, and I'm sure this is because I don't have the latest AIR SDK installed. I did find it and download it, just not sure how to download it.
1) Is the above URL the one I should be using? If not, is there a better definitive location for Flash/AIR language reference that is updated and always has the latest and greatest info?
2) I have the latest AIR sdk on my desktop, how do I install it? (I'm using Flash CS5 on Mac OSX 10.6)
3) How can I make sure that what I see in that reference URL is what shows up in my code hinting when I type import statements in the Actions Panel? Basically I just want to make sure I am all up to date so everything is showing and working the way it should be. For instance, I am missing a ton of fl classes (containers, controls, core, data, etc.) I want to get these in place so my local copies are synchronized as close as possible with the reference. Documentation doesn't help much when you don't have the tools it tells you to use...
4) Take the fl.ik package for instance. Locally, I have available all the classes in the reference URL that I should, plus a bunch more that aren't there.
I'm trying to compile an SWC file from a list of given ActionScript classes. I'm using the compc compiler. The problem is that there are so many classes grouped into multiple namespaces that I am finding it very tedious to specify each individual class to be included in the SWC. Is there any easier way of doing this like just simply specifying a root directory of these classes? At the moment I have something like this:
I"m a bit confused because FlexUnith 4's behavior. When I use fail() in try-catch body fail method is just ignored.
[Code]....
I suppose this one should fail as there is no way around it, but it succeeds and turns green. Whatam I doing wrong? When i put fail() before try-catch block it fails as it is suposed to. BTW using Flash builder 4.
For a project I am working on, I allow users to drag stuff around the stage and then let them save it as JPEG. I have used the new save method from player 10. This is my code so far.
var fr:FileReference; test_btn.addEventListener(MouseEvent.CLICK, showPic); function showPic(event:MouseEvent):void {
[Code]....
But when I click on the button, I get the following erro
TypeError: Error #1009: Cannot access a property or method of a null object reference. at homev1_fla::MainTimeline/showPic()
I almost have it, ( I think) but whenever I try to use a package with more than one class in it -- even the standard ones supplied in the ActionScript references, they don't work.And, if I have anything in the flash file other than an empty single frame, it breaks. So this precludes the use of library objects, which, if you CAN use them, saves a lot of coding time..
I am totally new to actionscript (barely could set up the IDE environment for Linux). I have trouble parsing an xml file containing some namespaces. All the tutorials and samples i found online are not working for me. the file looks like this:
I have been busy building the UI for a class file I wrote a while ago.
The problem I have is in referencing the symbols on the TimeLine. All the symbols have an instance name, and only exist in the first frame (main timeline has only one frame anyway).
At the moment I am instantiating my AS3 class file from a timeline layer using[code]...
I have a document class with a button script in it that is being completely ignored when I run my movie. I am also having bizarre trace results when I try to get the names of movie clips that are nested. [URL]
I've been searching around all afternoon, and am pulling my hair out. 1) I have a movieclip instance on stage (simple graphical element that represents platforms for a hero to run and jump along). I have placed it on the stage with an external class engine.as and in this class it is called myPlatform and is an object of Platforms.as. The movieClip is called platforms and from a trace(myPlatform.name) the instance name is instance3.
2) I am attempting to access the properties of myPlatform in an Enterframe event loop in my character control and collision class (called hero.as)
Basically here is the bit of code I am trying implement within Hero.as :
[Code]...
This all worked when I was writing actionscipt within the FLA file, on the timeline frame 1. I simply don't know how to access myPlatform from within the external Hero.as class! Do I need to create a variable? Is there a really easy way to do this with some syntax/command that I have not learned yet?
I have a package (XMLThumbLoader) that loads thumbnails and is supposed to import a scroller class(DSIScroller). The thumbloader works fine, but when I try to scroll the thumbsContainer movie clip, I get "Error #1009 Cannot acces a property or method of a null object reference". Notice that I instantiated the DSIScroller class near the end of the main package instead of underneath the import DSIScroller command. By doing this, my thumbnails show up. If I place the instantiation right under the import command, no thumbs show. I believe the issue is with the dynamically created movie clip: thumbsContainer.
Here is the main package (XMLThumbLoader) Code: package { import flash.xml.*; import flash.display.MovieClip; import flash.display.Sprite; import flash.geom.Rectangle; import flash.events.Event; [Code] .....
How do I change the frame of my timeline from my player class. I cannot just write gotoAndStop() because it will change the frame of the player not the timeline. I figured I would try this:
So i was going to run through some test's so I can get some basic lipsync. I recorded some audio and then proceeded to import i when to file, imported and then clicked the file.after it loaded, nothing happened
I have a small framework that I would like to put out there. I would love to export these classes as a single file. I know there is a SWC format, but there is not much recent information on how to export build this and I have a feeling this format might be outdated.
And I'm using the multipart parser from here: http://antscode.blogspot.com/2009/11/parsing-multipart-form-data-in-wcf.html.My issue is that the above works great for some files (.bat, .txt, .cs, .doc) - I see in Fiddler all the good signs including the 200 (OK) status. When I try to upload other files (.xls, .vsd), it fails with a 400 (Bad Request) status. I'm very surprised that a .doc would work and a .xls and .vsd would fail.
It is consistent as well. I've uploaded several .doc files successfully without any failures. I've also tried to upload several .xls files - some succeed, some fail (the successes are consistent over and over, the failures are consistent over and over). As I write this and test more and more files, there is a .pdf file that consistently produces a 504 (Fiddler - Receive Failure) error.
FYI, I am using Flex on the client and using the FileReference class to do the uploads. The Flex code is as standard as they come - using this code with the only change being the WCF REST URL: http:[url].....
I'm building Action Script project in Flash Builder. No flex, no third party libs. Pure actionscript - hierarchy of packages and classes. How do I include a plain external .as file, which is not a package or class, but just a set of statements?
I am using a pixelbender kernel to create a custom ShaderFilter in my standalone project it works fine, but once I build the changes into my main project I recieve "Packages cannot be nested" error. The following line is causing the problem
[Embed(source="./assets/pbfilters/ColorBalance.pbj")] private var CBByteCode:Class;
This is within an AS3 class which is being imported into a flex module extending the TItleWindow class. I prefer to avoid using the URLloader to bring the bytecode into the file.
Using Flash CS5 Professional I have created a symbol, dragged it onto the stage, and given it an instance name of GreenLight1. If I want to make this visible from the document class, I can simply do the GreenLight1.visible=true; and poof it's good to go when I test the file. As long as I stay in the document class I am good to go, but now I'm trying to move to another class and hitting ALL kinds of trouble just trying to get Flash to allow me to access this simple object. All I am looking to do is have this GreenLight1 go invisible (visible=false) when a certain condition occurs in this new class and Flash just won't let me access GreenLight1 at all. Things I've tried thus far:
stage is passed to the class and is referenced by _stage and is working just fine when I do _stage.addchild or anything like that. So I have tried "_stage.GreenLight1.visible=false;" and I get "ReferenceError: Error #1069: Property GreenLight1 not found on flash.display.Stage and there is no default value." My document class extends Sprite, so I figured I'd try the root function. So I tried "Sprite(root).GreenLight1.visible=false;" and I get "1119: Access of possibly undefined property GreenLight1 through a reference with static type flash.display:Sprite." I tried to create the Resource class as described therein. To which I came across the same problem that I started with in that it doesn't know what GreenLight1 is to begin with so I got "1120: Access of undefined property GreenLight1." Here is my code for Resource.as (am I supposed to pass something to this class from the document class?)
Given that both of these calls to getQualifiedClassName return the same thing (mx:Label), how would one go about programatically differentiating between an instance of a class and a reference to the class...
var lab1:Label=new Label(); var lab2:Class=Label; var qcn1:String=getQualifiedClassName(lab1); var qcn2:String=getQualifiedClassName(lab2);
In other words, how could I know that lab1 is of type Label, while lab2 is type "Class". typeof() simply returns "object" for both... getQualifiedClassName returns "mx.controls::Label" for both...
I am doing a looping background with 2 identical BG movieClip (B1 and B2). Those 2 are "new" by the same class.
var B1:MovieClip = new BG(); var B2:MovieClip = new BG();
But because this BG class picture is loader from the internet and the picture is rather big. When I addressed its loading by using progressEvent. The picture is really loaded 2 times. Is there anyway I create B2 based on B1 without using new BG() again? Since it definitely makes a new BG with Loader code inside.
I want to retrieve the var reference of an instance of a class from within the class. For example:
ActionScript Code: var ref:MyClass = new MyClass (); //then via some method, I would like to get the var ref inside the class ref.getRef(); //returns "ref" instead of [object Object]
[Code]....
You may ask why, well I want to do some spring cleaning inside this manager class I am making. Of course the above is a simplistic version of what I am trying to do.
I worked on a flex application 6-7 months back. We used flex 3.5 sdk. Now we are upgrading our flex app with flex sdk 4/4.1 I am still new to flex development and I have a very basic question related to namespace. I have seen three different namespaces in flex sample applications. What is the purpose of having three diff namespaces? When do I use each of them ?
I'm trying to get data from a namespaced xml file in a flex app. There is a root namespace (xmlns="blah") and another namespace (xmlns:i="blah"), and I'm able to access most tags using the following: var ns:Namespace = doc.namespace(); var result:XMLList = doc.ns::element;
However, there are several tags that are subject to change in the application, and i'd like to not hardcode them, possibly using the elements method: var result:XMLList = doc.elements(configuredField); Is there a way to get elements with namespaces using the elements method, or a similar way to get XML elements in flex using a parameter?