ActionScript 3.0 :: What Is The Most Useless Method In Flash
Jun 16, 2009
what is the most useless function in flash? one that can be used as a dummy code within a function. say for frameworking your code before making it. the best i can come up with is trace, but im looking for something less intrusive.
function fireMegaBall (lv:Number) {
trace('megaBall '+ lv +' fired');}
My problem is as such. I made a slide show for a non-profit, but they can't view my .swf or .html files. They say they open to a blank window.
I had Flash 5 and Flash MX. Apparently only the html version worked then. So I got rid of 5 hoping 6 would work better, but now nothing works.
Is Flash MX so dated that it just can't be used online anymore? Or am I missing some vital step in the publishing? Let me know if any of you have any incites on the matter. Or if you'd like any more details.
I have a simple application where you can sort isometric boxes on a grid. It works just fine but the more often you apply changes (i.e. click on a box and drag and drop it) the slower the app gets. After about 10 changes it has something like a 5 second delay in response and becomes completely useless.
As long as I stay on the first MOUSE_DOWN it works as fast as it should, but speed decreases with every click. Strangely CPU-levels will always return to near zero when I stop doing things in the app and always go up to the same level when working, so I do not think it that there is some procedure I call while dragging and forget to close again (I also checked this about a hundred times in the code).
Basically I think it must something with the most basic event listeners that look like this: Code: container.addEventListener(MouseEvent.MOUSE_UP, dropElement); container.addEventListener(MouseEvent.MOUSE_DOWN, dragElement); function dragElement(e:Event):void{ currentElement = currentDropTarget = previousDropTarget = Kiste(e.target); currentElement.alpha = 0.5; stage.addEventListener(Event.ENTER_FRAME, whileDrag); }function dropElement(e:Event):void{ currentElement.alpha = 1; stage.removeEventListener(Event.ENTER_FRAME,whileDrag); } I also checked if my "whileDrag"-function keeps running but it doesn't.
I publish test.swf and test.html to mydoc folder on my local computer. Mydoc folder also contains the test.flv that was imported to the flash to create the swf and html. Open any of them in the mydoc folder and they work fine, move the swf or html files to another folder and they work.Move the flv file,even keeping it with the other files, and they don't work.The main problem is that the swf will not work after uploading all to the same folder on the web server.
I'm tryng to make a public static method call another method, but Flash throws error 1180, sayng that the method called by the static method is undefined.
i have a fortran method which creates random numbers. i want to convert this method to a flash method . I want to get numbers from this method and use them in the delay method of flash.
the fortran method is the folowing
real znew1 , zold1 ,a,m,z1,p,TIME1 a= 16807. m=2147483647 B=2
I have a class called Animal that has a method foo() and I call it out within the Animal class.
Code: protected function foo():void { trace("Animal"); }
I also have a class called Cat that extends Animal and overrides the method foo()
Code: override protected function foo():void { trace("Cat"); }
However when calling the function foo() from the superclass it traces out Animal not Cat (using a Cat object).How can I make superclass call out methods in the subclass?
two classes, both extend EventDispatcher. Static method in 1st class calls instance method in 2nd event not getting caught. [code]also, since dispatchEvent() is an instance method, is there any way of calling it without first instantiating the class? i expect not.
getUser was already in UserService.java. I just created getUser2 and it's identical to getUser. When I try to call getUser2, i get the "Cannot invoke method" error. question: Do I need to specify getUser2 in some other file? like in some configuration file? if so, which one and how do I do it.
Is there a way to get a method's parameters from outside the method? I know that there's an "arguments" property but it's only accessable from within the method. I'm working on a RPC system and need to store the method parameter types in a hash table for easy access later on.
Code: class A{ function A(){ trace("construct"); } private function moo(){
[code]....
yet this doesn't, I'd expect it to: construct, start mooing, moo!, moo!, moo!, ...yet the moo! moo! moo! doesn't appear, as if moo() never gets called it all.
OK, from what I know actionscript in Flex runs asynchronously. I need the ability to run a method in a loop synchronously. Consider this code:
public class CustomerContainer extends VBox { public function CustomerContainer () {
[Code]....
This is not my exact situation as it is a bit more complicated to explain here. There is an abstract class and several custom view objects derived from it. Some of the views are dependent on others being completed first but I cannot seem to order them in the correct order. TIMERS are not an option. Probably not explaining this correctly.
Is it possible to add my own custom property to the flash.display.Bitmap using a public static method? I'm trying to write a bitmap utility that does something to a bitmap, and stores a Number property onto it afterwards.
[Code]....
I'm still learning AS3.0 OOP, I think that this can't be done with this method. I think I have to make a new Class that extends 'Bitmap', add the prop there, and then in the Main.as make a new instance of that class, point to the target Bitmap, and run the method in the extended 'Bitmap' class (?).
how to use get and set method?Is there any easy example for using this methods ?Can i use only the get method or both methods should use together ?Can i call the getter variable in any other class and how do i call it ?
There is a Point (flash.geom.Point) class in as3.I want to add method to class Point (e.g. convertToStagePointMyMethod()) and I'd like to call this method by using [code]What should I do in order to add this method to class Point? Is it possible without inheritance. I'd like to use it like "partial" classes in .NET
Can somebody explain me how to use get and set method ??Is there any easy example for using this methods Can i use only the get method or both methods should use together Can i call the getter variable in any other class and how do i call it ?
I noticed this full flash site and wonderring[URL].. How can I apply the resize method like the way they did?
Any examples might help me a lot. I have one main.swf and page.swf which loads within main.swf. My page.swf contains thumbnail images, and it's already position in middle of stage.
When handleResizeObjectOnStage is triggered, it's start to center again on stage. But it's not the same center applied of page.swf. I want to be able to do resize like the example I have posted.
I've been developing a framework for ActionScript 3 and have come across a peculiar scenario where I want a method to be able to return either an AvFrameworkObject or an Array containing multiple instances of AvFrameworkObject.[code]...
I have hit a brick wall after trying almost every example I have come accross.In a nutshell I have a Flex parent which is embedding a Flash SWF file which has a Method which needs to be accessed from Flex.[code]I have tried strong typing the SWFLoader as a MovieClip to gain control of it but have had no luck.[code]Essentially all I need to do is reset/reload the Flash SWF when the mx:State changes.
I use an application which uses flash cookie to store some important information. This information is critical and should not be deleted. But I have observed that the flash cookie or the shared local object is getting deleted under the following situations. When the local history(including cookies) are deleted by the browser. When flash is upgraded in the system.
This is adversely affecting my application. Please let me know, if there is a way to forcefully retain the 'shared local object' by placing some kind of lock on it. It will be better if this can done programmatically.
//Here we add the new textfield instance to the stage with addchild() _canvas.addChild(PlayerScore); var myFormat:TextFormat = new TextFormat(); myFormat.size = 30;
I'm making a quiz game where I need to send information about the player's score and other variables from Flash to a PHP page whlie opening the PHP page in a browser. I want to use POST so the variables don't show in the address line of the browser.
but that doesn't work either. What am I doing wrong?? If it's not possible to use navigateToURL like this, how else can I open a page in a browser and send variables along by POST?
overloaded constructor method is there in flash? Iam trying the following code but it is giving error like this "A class must have only one constructor."
Code:
function Login(userName:String, userPassword:String) { this.userName = userName; this.userPassword = userPassword;
I am using flash cs3, I am loading an external swf file into my application (the loaded file is in mx2004 format, in which I have a button). Now on clicking on that button i want to call a method which is there inside flash cs3.