I have a bunch of classes in an SWF file. I'd like to use them in my Flash project. How do I import them?
External SWF
package com.external
{
public class Class1 {}
}
In my project I want to write
import com.external.*;
var myclass:Class1 = new Class1();
...
Just wondering, is it possible to limit number of 'imports' in AS3 code by defining them in parent class or in any other way?
Thanks in advance
...
Good day!
I'd like to found some logging framework for AS3. For now I use trace() and debug version of Flash Player, but I'm looking something that can be enabled without having debug version installed?
Thanks in advance!
...
I have a text field and a background and want to apply color using
myColorPicker. Either the text field or background can be selected using
radioGroup1. When either radio button is selected the trace statement
traces the variable obj2Clr exactly. However when I use that variable
with Transform, I can't apply color. If I hard co...
Is it "better" to initialize AS3 class variables in the class constructor? Or can I just initialize them to their default value when I declare them at the top of my class? I ask because when there's a lot of class variables, it appears inefficient to declare them in one place and then initialize them in another when I could easily do b...
In AS3, why do we put our import statements in the package statement, and not inside the Class declaration?
This is a typical (but rather pointless) AS3 class:
package my.foo.package
{
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.utils.Timer;
public class F...
Hi guys,
In flex, I am trying to do date deduction and addition, but couldn't find a way to do it.
e.g.:
public var dateNow:Date=new Date();
How can I get the Date 3 months earlier than dateNow?
Thanks!!!
...
Suppose I have the following XML:
var foo:XML = <root><a>this is a <b>special</b> case</a></root>
Is there any way to detect the position of <b> relative to the contents of <a> without a custom subparser?
...
The braces shown below after ...ret):String are incorrectly being highlighted as red
I'm using the following syntax definition file for actionscript:
http://www.vim.org/scripts/script.php?script_id=1061
2 Questions:
Does anyone happen to know off-hand what causes this weird matching?
Is there anyway of identifying the current sy...
Note: This is an Actionscript project, not a Flex project.
I have class A defined in an RSL (technically, it's an art asset that I made in the Flash IDE and exported for actionscript. The entire .FLA was then exported as a SWC/SWF).
I my main project I have class B, which inherits from class A. The project compiles fine, with no errors...
Hello to all,
Please tell me about the change watcher in flex.
i have a situation like,
i have few canvas, on which i have to show select and unselect,(These canvas hold product thumbnail images) , so when some thumbnail is selected i have to show selection and on selecting other, i have to unselect the previously selected canvas and h...
Hi there,
I have a parent swf called Main.swf that loads a child Registration.swf via a regular loader class then adds it to the stage. This child has a webcam function that captures an image but before that happens it prompts the user for permission to allow the webcam to be turned on.
The problem I'm having is that in my IDE the prom...
(Event.ENTER_FRAME,myFunction); function myFunction(event:Event)
{
if (fk.playheadTime > stopTime)
{ fk.pause(); }
}
i pause my video at stoptime it works but then when i press the play button it doesn't work.i guess the problem is my code's place.as you can see i write it in enter_frame event.how can i solve this problem?thanks f...
Good day!
What is the best\recommended way of handling runtime errors in AS3? I mean errors that were not catched by try...catch. I'd like to log such errors and provide some handler to show user some message? May be there are some AS3-specific best practicies?
Thanks!
...
My Flex 3 application uses a custom cursor and has to show a customized context menu when the user performs a right click. The problem is the customized menu is shown only when the default arrow cursor is shown. When I change it to the custom cursor, the standard context menu appears instead of the customized one.
Is there a way to hav...
I have a Sprite which is in the shape of a Convex polygon(not rectangular).
If I take its snapshot using :
var bmd:BitmapData = new BitmapData(width,height);
bmd.draw(someSprite,someMatrix,null,null,null);
I get an image like this :
Click here to see the image
In this image, I have added the green boundary myself, just to ...
package {
import flash.display.Sprite;
import flash.utils.*;
public class SetTimeoutExample extends Sprite {
private var delay:Number = 1000; // delay before calling myDelayedFunction
public function SetTimeoutExample() {
var intervalId:uint = setTimeout(myDelayedFunction, delay, "Hello", "World");
}
public fun...
I have PHP script which takes some file (FLV for example) and returns it to Flash player (just opens and reads to end), and I have flash(mxml+as3) app that calls that php script in order to recive a file. Ho to make priorety of that connection so that if user goes to some other web page or dowhloads some file my pair (PHP <-> Flash) will...
What I have is a class with static properties that I want to use as images. I would like the images to be configurable at run time but still have the defaults. So the Images class looks like:
package {
public class Images {
[Embed(source="/assets/Green-Light.gif")]
[Bindable]
public static var GreenLight:Class;
}
}
And now a custom c...
Hi All,
I will take advantage of the fact that this discussion is not answered yet to add some info and narrow down my problem.
You can still download my project from the link below.
It seems that my fla's document class in Flash Pro CS5 is not linked properly to the default application class in Flash Builder 4. What I mean is that w...