ActionScript 3.0 :: Download An External Class From Code?
Jul 25, 2009i download an external class from code.google.com. now i want to know where should i put that class so that i can import it into my actionscript code.
View 1 Repliesi download an external class from code.google.com. now i want to know where should i put that class so that i can import it into my actionscript code.
View 1 RepliesI have tried to add a button a .fla and code it with a packaged class (Main.as).is it possible to use a button from the GUI and code it with a external imported packaged class?
View 3 RepliesIf one uses [Embed] to refer to external graphic assets its easy to instantiate and use them.However, I've got a png in an Fla, with the Class identifier set to "Symbols", Base class is BitmapData.I need to instantiate it like this:
var symbols:BitmapData = new Symbols(1, 1);
addChild(new Bitmap(symbols));
Of course the compiler complains about a call to a possibly undefined method Symbols.For a temporary fix I guess i'll put the graphic external to the swf, but for this project it needs to be in the library along with everything else.
I try use simulate download to test my perloading code. But the flash player only trace "1%" and a pure white scene to me.[code]
View 7 RepliesGot to the point where the hole in my AS3 knowledge is getting large!Realising I have confusion about the relationship of:Body of code on first frame of AS3 file.(Which I have so far used to create instances of library objects using addchild and make calls to class code).Is this code called the document code? What do people call it?Numerous classes linked together by extending each other etc.Library objects (usually graphical objects)Should it be done differently? have the following problems due to lack of understanding:Addchild complicated from a class but straight forward in main body code.Cant call functions on the main body code from classes, because class code does not know the main body code exists?
View 1 RepliesI had a 2 frame setup with some actionscript for each frame. Tried to move it all into one class file and a
1. frame .fla. ; Hiding and showing the resp. moviclips when i virtually move from frame 1 to frame
2. Now I get these ...Error #1069: Property edit_panel_mc not found on flash.display and there is no default value. errors or..
when i thought beeing clever adding the stage. prefix ReferenceError: Error #1069: Property edit_panel_mc not found on flash.display.Stage and there is no default value. The mc's are on the stage... i have a single .as classfile. Why cant I reference them? or how should i do it/ what should i do to change it from beeing .fla script to class script.
I see a lot of tutorials about coding actionscript 3 when they use all the code in a Class.I keep thinking every time why they use it in a class, instead of using actionscript on the stage.why it is more functional to code a class instead of putting code in the stage actionscript?
View 3 Replieswhere can I download classes? Like the freeTransform and the Tween class? And where can I find more? How many is it? How can I make an own class?
View 1 RepliesIs there a way to limit the download speed of a external FLV using action script 3?
View 1 RepliesI have a Main.fla which loads Main.as as its document class. In Main.as I have a public function named "Main" which runs a trace. I also have another .as file called Preloader.as, which also has a public function in it, this one named "Preloader" with simple trace in it. I just cannot figure out how to use Preloader() from the Preloader class in Main() from the Main class. Main.as loads up fine when the SWF loads and traces.
View 10 RepliesI have a movie that is going to be playing in our onLine Learning Site. I want to include a link to download a few documents, and I just don't know how to do that.I do Not KNOW what the complete HTTP url will be, just the directory path by that I mean, I know the files will be in "VideoFilesHighRes1.MOV" but I don't have access to the complete URL. This isnt a problem when it comes to loading other Flash objects (IE sounds, different clips etc) For some reason I didn't think the "getURL" request was valid in AS 3.0.....
View 1 RepliesI am trying to replace some code which loaded an external image and triggered and function once completed with code that uses and embedded image. The relevant code looks like this.
Code:
[Embed(source='globe.png')]
public function Globe()
{
var imageLoader:Loader = new Loader();
[code]....
The commented out section is where it used to take the loaded image and apply it to a texturemap.I need to replace the lines of code in the first function with something that calls the second function correctly.
I have tried using function imageLoadComplete (e:Event = null)and calling it with imageLoadComplete(); in the first function but although it compile and runs without error, the program does not work properly. I suspect this is to do with the dispatchEvent(); line which I do not understand.
Say you were importing flash.events.KeyboardEvent and you wanted it to extend the MovieClip class, is this possible? Where you dont have access to the class to just type "extends XXX"
View 14 RepliesI recently switch from AS2 to AS3 (too late - I know) and bump into (probably easy) problems now and then. I'm making this preloader in a class - I read that this might not be a good idea to put it in a class (?) - and I'm using a timer in it. But I keep getting this error message after simulating a download:
Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at MethodInfo-7()
at flash.utils::Timer/_timerDispatch()[code].........
Here is code for drag. i want to change as3 class to normal code as3
View 6 RepliesI have an xml snippet that contains an object hierarchy:
doc = """
<RootObj val1="ValueOne" stat1="Stat1" stat2="Stat2">
<internalarray type="array">
<InternalObject val1="12" val2="12" />
<InternalObject val1="13" val2="13" />
[Code]...
I want disable IDM(internet download manager)'s download video option from my youtube videos.
View 1 RepliesSo I basically have used the fileReference class to allow the user to download a determined file if he wants to.
I use the file.download(URL) function and it works well.
However, the file is downloaded and saved to the hard drive using only the flash player. The browser is not aware of the download, and thus, if I want to show the progress of the download I'd have to make some progress bar myself. I know how to do it, but it would become really tedious and take too much UI space.
Isn't there a damn way in Flash to "send" a determined file to the browser so that it prompts the user to download it? It's an image file, so navigateToURL doesn't cut it since it will just display the image, both if I use a new tab or the current one.
I'm working at a company which has high security environment.Akamai Download Manager starts to download a trial Flash CS5. However, it stops quickly and downloads nothing (zero byte).I want to download a trial Flash CS5 without Akamai Download Manager!
View 3 RepliesI generate a HTML page with VB.Net which stores several pinks to files. These links are formatted with JavaScript looking like the Windows-Explorer with folders and files. The problem: There are only download links for the files, not for Folders. A folder can contain Subfolders ,a List of Files or a combination of both. So if I want to download a folder, I have to click manually on every file-link. I have not the possibility to insert PHP or another Server-side language. my question now is: Is there a client side way to Download them by click on a Folder? I prefer Javascript but If it isn't possible Flash will be ok also.
View 2 RepliesI'm trying to create a new instance of a MovieClip when the original one has been used. Would sound easy enough. Just use: var
instanceName:ClassName = new ClassName();
the class name/mc in the library im trying to duplicate is MCg1 so
var instanceName:MCg1 = new MCg1(); right?
However, the particular object in the library i'm trying to duplicate has a base class that is an external class file (just to control it's drag drop functionality)... i.e baseclass is not set to the standard flash.display.MovieClip, or whatever the case maybe. So i end out with a: TypeError: Error #1009: Cannot access a property or method of a null object reference.
I am trying to access a function in a loaded swf that has external class.. I would like to avoid having to put the function on my "Main" Doc class in the external swf and instead access the function directly from the class
This is what ive tried so far and it's a no dice:
private function startLoad(){
var loader:Loader = new Loader();
var req:URLRequest = new URLRequest("one.swf");
[Code]....
i have a flash site im working on, with an image gallery. the way the site is designed, when you enter into a gallery, while it's loading the images (lets say 5-10 images), it draws 5-10 gray boxes in the exact spots the images will load into.
the trick is i need to know in advance how big the gray boxes should be (width/height) before the image is fully downloaded.
i found this site: [URL]
but the way he wrote this, as soon as the class determines the images dimensions, it cancels the download.
i'd rather have a fully complete image class that downloads images, dispatches events with the image dimensions as SOON as theyre detected, and fully downloads the images as well.
Lets say I have Main.swf and sub.swf, and I wanna load sub when I press a button from Main, but sub.swf has its own external class file attached, so here is the problem, when I load sub using loader class and I would get this message from the output panel:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at subScript()
seems loader class can not access sub.swf's external class when sub is being loaded.
I have a few buttons rigged up for downloading word.doc, mp3 etc
Problem is its opening the file rather than giving a download this file option.
There i have some keyframes with labels.On .fla file in property in Class field i adde MyMatching class.
Also i have main code:
package
{
[code]......
I added a font Arial to the library. In properties for the font the Class box is greyed out. Do I need to add the font class in the code?Also I have a dynamic text box on the stage. Which anti-alias setting do I use and can / should it be selectable? I also selected character embedding and selected ALL for Arial Narrow Bold.
The text is not showing up arial narrow bold
var mainText = new TextFormat();mainText.font = "Arial Narrow"; mainText.size = 18;mainText.color = 0x333333;mainText.bold = true;
I'm trying to pass a variable into my program through an external .txt file. Here's the basic code:
numberOfColors = new LoadVars();numberOfColors.onLoad = function(){ numberOfColors_text.text = this.myNumberOfColors;};numberOfColors.load("Text/NumberOfColors.txt");
[code].....
I'm having an issue running a swf within another. It seems to be running an incorrect version of the code. Here is an explanation of the environment.[code]...
View 1 Repliesthis is probably a very simple mistake made by many beginners. Basically, I have a preloader loading an external swf. The external swf is an image sequence. I wrote actionscript so you can scrub through the image sequence using the keyboard arrows. This works by itself but does not work when preloaded.
[Code]...