ActionScript 3.0 :: Packages And Directories - Reorganize Classes Into Folders?
Jul 8, 2011
I'm trying to re-organize my classes into folders, currently they're all just in the same directory and it's very messy, so I've tested this out in one feature, being the bullets. So bullet.as is in the directory: [main source]/Classes/Turrets/Ammo
I so in the bullet.as file I have coded as follows:
Code:
package Classes.Turrets.Ammo {
import flash.display.MovieClip;
import flash.events.*
public class Bullet extends MovieClip {
Now this works, the bullet is fired on to the stage, however it behaves profoundly. For some reason it does not move at all or behave how it does when it is fired from the turret object, the bullets behave perfectly though when I just simply put them in the same directory as the source .fla. What can I do to easily re-organize my classes into folders without turning my objects into malfunctioning pieces of junk?
View 2 Replies
Similar Posts:
Jul 11, 2010
I've worked wioth sub classes so I know how they work but I always work with everything all in one folder which can get messsy when there are a lot of classes to work through. So i started to make folders inside of my main folder but it's not working. Thought it may be to do with package names but as far as i know, for the whole "classes in separate folders" things that's how they are supposed to be.
View 2 Replies
Feb 3, 2012
I am creating a library in AS3. Inside the library I make use of a bunch of classes/packages that need not be exposed to the end user of my lib. I want to only expose one of these classes.
I guess my questions are:
1) How are libraries commonly distributed in AS3?
2) Is there a .jar equivalent in AS3 that developers can include, but will only have access/knowledge of the classes I've declared as public?
View 2 Replies
May 20, 2010
I cant just get what does packages and classes do.
View 1 Replies
Nov 30, 2009
I'm working on a project that imports custom classes (from external as files).
Each class is in it's own file (correctly named, located), and they import and compile fine.
I am building the text version using the Flash IDE (?), and am only using actionscript. The final version will be build using Flashdevelop.
Why does the compiler choke and give an error ("1037: Packages cannot be nested") when a package is coded in the main movie?
Isn't all as code in AS3 supposed to be contained in a package?
Here is the code that works - is this OK (in regards to package code)?
ActionScript Code:
import flash.display.*;
import flash.utils.*;
import com.company.affiliateWidget.DateExample;
[Code]....
View 5 Replies
Jul 23, 2010
I am in cs3, publishing as version 7, using actionscript 2. It is asking to be linked to my classes because of the error messages I am receiving.
what to link to in classes. Is it the file, the folder or folders with sub folders?
View 0 Replies
Feb 3, 2012
I haven't scripted in AS3 is a while and can't remember having these issues. Perhaps it's because I've been using less strict languages like lua, ruby/php, and java that has made this difficult to get back into.
I am trying to make classes talk to each other and am using folders in an attempt to make things a bit easier for me to track.I have a document class in the base folder known as Main and right now one other class located in com/Game/ known as NewGame.as
Now the issues I am having is basically the Main.as sets up the stage. Puts on the starting buttons, interface, etc. The NewGame.as is called from the Main when the NEWGAME button is clicked. I have gotten that working properly, a few hang ups on error 1061.
[Code]...
View 6 Replies
Aug 10, 2009
I'm new to as3 and although I am able to build classes that don't error but also don't put anything on the stage. I have Starter_1.as file stored in a folder called com...this is the script for that file:
Code:
package com {
import flash.display.Sprite;
import flash.text.TextField;
public class Starter_1 extends Sprite {
private var tField:TextField;
public function Starter_1 () {
[Code] .....
From what I can see the problem is because the addChild(tField) is not referencing the stage in anyway because the script is in an external .as file and not on the timeline (good coding practice I read somewhere?) I use this on the timeline to try put the text field on the stage:
Code:
import com.Starter_1;
var f1:Starter_1 = new Starter_1();
How do I get this working?
View 4 Replies
Jan 13, 2012
Say if the structure of my game is set up like this:mainMenu- Classes inside the mainMenu package.instructions- MainMenuButtonClass.- Other classes inside the instructions package.game- MainMenuButtonClass.- Other classes inside the game package.The class MainMenuButtonClass is a button that, when clicked, directs the user to the MaiMenu and is identical in both the instructions package and the game package. Would it make sense just to save the same file in two locations or is there a better way to handle it.I'm not trying to access variables between the two classes. I'm not looking for any code either.
View 2 Replies
May 18, 2011
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.
View 1 Replies
Jan 17, 2008
Before starting an class or code, you should put all your import statements..
Now I have flash application, which offers a search feature which relies on some pretty huge classes. The user is unlikely to use this feature. However, importing those classes anyway adds some pretty large kbs to my application. Is there a way to import these classes at runtime ONLY IF the user chooses to use this feature?
View 5 Replies
Jan 13, 2011
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?
View 1 Replies
Feb 12, 2009
A lot of people have .com websites & put all their classes & packages inside a com folder & then their website name to avoid any possible naming conflicts when using other peoples classes - all very sensible. I have a .co.uk website however - is there an equivelant naming standard?
View 3 Replies
Dec 11, 2007
Using an XML generated gallery, I would like to add the feature of repositioning the dynamically loaded thumbnails when the browser is resized. Currently, the thumbnails are laid out in columns and row, the number of column being predetermined by a COL variable. The rest of the code distributes the thumbs into as many rows as necessary depending on the COL number and total thumbs number. I came up with this line, which seems to be a good start:col = Math.round(Stage.width/60)-1;However, it is only working when the movie first loads. I tried putting a stageListener, onResize... but still not working. I guess it has to do with the XML.
View 3 Replies
Aug 12, 2010
I want to compile an FLA that I want to use as resources for two slightly different application in two different folders.
something like this
library.FLA
-> bin1/lib.swf
AND
-> bin2/lib.swf
I could just copy them manually, but with multiple files there's always room to forget one file.
View 2 Replies
Feb 9, 2009
I got a simple image slideshow. Im reading the image list from a XML file. Everything work fine when I export the swf.The problem is when I load my swf into an html located on a parent directory then the swf cant read the xml anymore.Here is the folder structure to clarify:
Root contains:
index.html
files (this is one is a folder)[code].....
So when I run the swf it work OK, if I create an html in the same directory as the swf works OK but as soon as I move my html one level up then swf loads but without any image on it.Now I know the easiest fastest way is just to put everything on the same directory right, but I cant in this specific situation since my index is loading a whole bunch of other stuff, thats why the swf and xml need to be on another directory.
when you embed a swf into an html that is on the root folder.. all pathing has to be done as if the swf was in the same location as the html.. which means .. in your flash code.. to call upon the xml via the browser you need to target it like this .. flash/the.xml .. instead of just the.xml .. same for the images.. you need to make sure that you target it as if you were look at the files from the root location.. flash/images/image1.jpg
So basically I changed my paths in flash in my actionscript and when I export it, it doesnt work by itself, but when I ran the HTML located one level up, everything works fine.
View 0 Replies
Jul 26, 2006
I was wondering if Flash (I have FLash MX 2004) has the capability to check if there is already a directory in a certain location, and if not create it. Obviously the outcome of there already being a file would be to take no action.
View 1 Replies
May 2, 2010
How do I load an XML file (and still have all of the XML functions) that's located in a specific directory on a user's computer? All of the tutorials I've seen are loading the XML files from the web/URL using the URLLoader function. Is there anyway to load the XML file from the computer?
Question 2:How do I have a standalone file that's created via actionscript save the file in some other location other than the default, really long appdata/roaming/Macromedia/etc./etc. directory? I'm using the SharedObject.getLocal syntax, but is there another syntax I need to use so that I can save the file in a directory called appdata/roaming/MyApplicationName ?
View 2 Replies
Feb 19, 2004
someone knows if a directory can be opened using loadVariables and then placed into an array or loop. I know files can be loaded individually, but I want to be able to see all the files using PHP and my .swf file.
View 2 Replies
Apr 4, 2009
just wondering how AS3 can do this. I'm writing in Flash CS3, I just need to know the length of a directory which is in the same location as the flash file. For example there is
/flash/flash.swf
and then
/flash/images/
and I need to know the length of /images
View 7 Replies
Dec 14, 2010
I took over a site that includes a flash file which I wasn't worried about at all until I tried to make changes and publish it. The original designer said the .fla file cannot be published on its own. It must be accompanied by the .as files and directories that are in the folder with the .fla file. What the heck does that mean? How do I publish this file? I'm on CS4.
View 4 Replies
May 15, 2010
By default, the server runs as System Account with no access to network drives. You can change the service user to a user with network access privileges with a UNC path. In Windows 2008, when I change FMS service to log on as user and start the service I get
"Windows Could not start the Flash Media Server (FMS) service on Local Computer.
Error 1067: The process terminated unexpectedly".
When I change it back to Local System Account, it works fine. Tested in Windows 7 x64 and I was able to start the service as a user log on. I checked the local policy group and the user have rights to log on as a service. I compared Windows 7 setting to Windows 2008 and they match.
View 2 Replies
Nov 2, 2010
I inherited a project and this thing is a real Frankenstein. It is a combination of external classes, flex xmls and action script on timelines of objects in various swf files. I have a situation where I need to access a class in a package a few directories up. For example my direcoty structure is similar to the following:
[Code]...
View 1 Replies
Apr 26, 2011
The easy version of my question is this. I have a main.swf that calls and loads smaller swfs. There is a text field in the main clip that holds descriptions (descriptionText). What I am trying to do is to be able to change that text with a string (feedback) from the loaded clips. So in other words, pass a string value from the loaded clip to the main clip and set the descriptionText.text = feedback.
I have worked out (unless there is another way I am not aware of) that I need to use an external class to do this. The issue is that the smaller clips have to live in a folder called "images" to function on our LMS and I can't figure out how to import the classes into my large clip and smaller clips because they are in different directories. I can post some code if needed.
View 2 Replies
Oct 6, 2010
I am having problems copying directories of movieclips from one flash file to another. They appear to be fine until I save it, then when they are reloaded they are missing a parent movie clip, and all of the children are blank.
View 2 Replies
Jul 6, 2010
Is it possible to make code in actionscript-3 to parse the virtual directories that are constructed in the flash library? I mean that if i add a folder on the library of CS4 called 'graphics' can i write code that parse the elements of that folder in order to fill an array with folder's elements(which are BitmapData classes) ?
View 1 Replies
Jul 29, 2010
Here is how I usually write the compile task:
[Code]...
What I'm looking for is a way to compile the entire director of classes without having to specify each class. I'm sure there's already an option for that, but I couldn't figure out the exact syntax.
View 1 Replies
Dec 22, 2009
I know very little about Flash so I apologize in advance for asking what is possibly a dumb question, although I did a fair bit of research before posting. Our current Flash app, written in AS3.0, is able to display a standard OS browse dialog for the purpose of allowing a user to select files. We are using [URL] to display this dialog.
The documentation for FileReferenceList states that only files could be selected. The new requirement is to allow the user to select directories as well as files. Afterward it would be very nice, but not required, to be able to get a recursive list of all the files in the selected directory. Is it possible to implement this in Flash running inside a browser? The closest I've seen so far is [URL] which does what I want but it only seems to work inside Adobe AIR and is not exposed to the browser.
View 1 Replies
May 17, 2011
I have Flash Media Server 3.5 on a Windows server, but I don't no much about how to make it work. Until know we have only used it for live streaming.I have let myself guide through the beginners pages and they're helpful, testing everything locally (applications/babyvultures/streams/_definst_/vultures.mp4).The problem is when I copy my project to the server; same structure, but no video. If I move the file to the applications/vod/media, and change the path in the script
So the big question is: am I able to have sub folders within the applications/vod ?
The thing is, that I want to publish videos from different sites that is also located on the server, and what I thought I could do, was to make sub folders, one for each site and then people can access their streaming folder via FTP, being able to publish their own videos with the advantage of rtmp streaming.
View 9 Replies
Nov 17, 2010
Can anyone enlighten me as to why my really simple web page is appearing as 2 folders please? These are the index.html and .swf files.
This has occurred before but I cant for the life of me remember the cause or solution.
The files are in the public folder on the server.
View 2 Replies