ActionScript 3.0 :: Make A Generic Button Class That Can Be Used On Any Project?
Jan 30, 2012Just getting used to AS3 and I'm trying to make a generic button class that can be used on any project.
View 9 RepliesJust getting used to AS3 and I'm trying to make a generic button class that can be used on any project.
View 9 RepliesI'm trying to make a generic button to call an specific frame but when I'll try it with trace it works perfect... when I make a goto code on it it messes up my entire count....here is the code I'm using...does anyone know whats happening? how can I fix this? here is my code
[Code]...
Assume I know practically nothing about AS3! I'm using Flash Pro CS5. I'm trying to reassociate a flash file I've been given with its external assets and classes. In the library I have a movieclip with linkage to a class called 'StaticMap' using the base class 'flash.display.MovieClip'. am I missing a custom class file called 'StaticMap.as' that was originally located in the same folder as the fla, or is this a generic class accessible to all movieClips from within Flash?
View 7 Repliestrying to make the close button work on this homework project. This app scatters photos on the stage, randomly and at random angles. They are drag and droppable and the clicked photo comes to the fore. Each photo has a close button intended to remove the photo from the stage, this last is what won't work. I know its a common topic, but nothing I've tried has worked so far. onClickCloseBtn is the problem.
Code:
package
{
import flash.display.*;[code]........
I'm just getting started connection to webserivces and I have looked at a lot of tutorials and I get most of them to work but I'm having a little bit of a problem. I'm coding in eclipse with the flex plug-in and I'm using flash to complile it. I'm trying to come up with a generic class for my webservices where I can just pass in the wsdl and any params and it will run. I'm using the webservicex for my wsdl in this example. Here is the code below and it works great and returns an XML.
[code]...
Now the problem. I have a specific wsdl, NOT THE ONE ABOVE, that I pass in a lot of params, which isn't a problem, and it seems to be sending them all just fine but when I trace the result I keep getting [object, object]. how to turn this into and XML, or why it is coming back as an object?
I don't understand what is structurally different between a Value Object and a Class in ActionScript3. Can any Class be a VO if you decide to call it one?
View 1 RepliesAs you all know, Vector support type checking by added Type parameter.
var v:Vector.<String> = new Vector.<String>();
I wonder if I am able to create a custom class that have Type parameter, something like this
var myClassInstance: MyClassDefinition.<String>;
Is there no way to extend the vector class or write functions for a generic vector without specifying the class? There are a few basic reusable functions I want to use and I'd prefer to stick with vectors rather than arrays.
View 6 RepliesI am trying to make a generic list control that has x buttons in it so that users can remove items from the list by clicking the x button. However, this list control needs to support item renderers while still standardizing the layout of items placed next to x buttons.
So I figure the best approach would be to extend the list control and use a renderer that draws the x button and combines that with what ever renderer the user supplies. Unfortunately I cannot figure out how to do that.
I tried overriding newInstance method from the IFactory interface and used that to create an HBox that contains my button and inserts the newInstance result from a user supplied renderer, however it wasn't complete. It displayed as I expected, but the mouse over effect only worked on the user supplied renderer portion and not the entire HBox that my custom renderer made.
I have this bit of code, and it's not working as I expected. btnContainer is a VBox that contains a ton of buttons (toggle=true); and I want to reset them to un-toggled at a certain point.
for (var btn:Object in btnContainer.getChildren()){
if (btn.isPrototypeOf(mx.controls.Button)){
btn.selected = false;
}
}
With the above code, "btn" shows up as just the index during each iteration of the loop (0,1,2,3,...), and the conditional never evaluates to true.I also tried this:
for (var btn:Button in btnContainer.getChildren()){
btn.selected = false;
}
This works fine, except that there is also a label inside btnContainer; so it throws an error when trying to cast the label as a button.
i have a button labeled as events on the main page of my website and i want to link that button to an html page which i have createdThe page should be opened in a new tab
View 2 RepliesI have these images that will load when I input a certain string of text but I don't know how to combine functions to make a generic one that will work for all of the images. These are just two and they're basically the same thing except I have to make each function (something)1 and then (something)2 for the next image.
[Code]...
I'm trying to make a preloader for a little flash project that involves re-assembling a load of rectangles to make up a pattern.Idea is that instead of the usual load bar i wanted to make use of this pattern that is relevant to the project and have it rebuild it self with these rectangles flying in from the side. So far I have got the tweening sorted using the tween class and staggered the 42 (yes took a little while, probably an easier way so let me know on that also) rectangles using 'setTimeout' so it releases each 100milliseconds after the one one before it. This probably the wrong way to do it but i wanted to check how it looked and this was the one way i knew how to do it.
I want to make it so that these rectangles fly in a complete the pattern once the loading has finished, but on a fast connection I don't want it to rush the animation but for a slow connection I obviously want it to adjust the release time and maybe even the travel speed to compensate.
I had an idea of maybe working out the percentage loaded divided by 42 and then run an if statement to see if that percentage for that segment had been reached before 100millseconds had passed, if 100 had passed then release the rectangle, if not then hold the rectangle until 100 m/s had passed. Not sure if that is the best way to do but that's why I'm looking for some suggestions from more experienced developers.
Code:
import mx.transitions.Tween;
import mx.transitions.easing.Regular;
// declare variables
[code]....
I have my main class for my project. And lets say that this project requires me to split a string into sub elements.I have a class already made that does this... stringSplitter.asI would I include this class ?Is it as simple as putting it in the same dir as the .fla and writing Code: Select allinclude "stringSplitter.as" within the main class ?
View 1 RepliesI cant "center" my project, like you can see its "fixed" (yellow lines) in the left side and I cant see "invisible" part of project... (area around the project). how can I move my project so I can see the not-project area around the project. (picture 2).
At the moment situation... (cant see that area around the project)
http://img19.imageshack.us/img19/1186/68553623.png
I am Dinesh and new to action scripts, I need to design a flash interface that have a dynamic text field and fetches lines from a external text file for e.g.
-59684578
-59879889
-65656566
This should display in the dynamic field with a loop and fast (less than a second) and there should be a start/stop and a reset button on the interface to control the same.
when I create a new flash project, I would like to put the source files in /src/ folder.When I try to add the base class to my project, flash can't find it.I've added the folder "src/" to source paths, in flash preferences.
View 2 RepliesHow i make export my Flex project for IOS.I am using Flash Builder 4.5 .
View 2 Repliesis it possible to create an actionscript project (File > New > Actionscript Project) and still use mxml for the ui layout? basically, i want a main class as the entry point which can reference the controls within the mxml.i tried it the other way around (File > New > Flex Project), but it creates an mxml app that seems to serve as the entry point. if i create a class in this project, how do i make it the main entry point?//when i create this class inside a flex project, the constructor never gets called
Code:
package
{
[code].....
i seem to be having some problems with the Vector class in actionscript 3 in a Flex Project or an ActionScript Project it is possible to do this var v:Vector.<String>; But when i do the same thing in a Flex Library Project (to create an SWC) then i get the following error on that line of code 1046: Type was not found or was not a compile-time constant: String.
so when using Flex Library Project it fails..., but when i compile the same thing using compc there are no problems any idea why only the library project is complaining about Vector ?
[Code]...
I'm totally new to Adobe Flex Builder 3. I've been assigned a fully functional project but when I want to add the simplest function to any class, I always got the same error :
Call to a possibly undefined method through a reference with static type
For example, in some random class there is a function defined like this :
public function GetID() : String { return m_strID; }
If I try to define a new one like below :
public function GetIDFoo() :String { return m_strID; }
And then I try to call both of them like this:
trace ("This line is ok : " + oPhysicalScreen.GetID());
trace ("This line gives me an error : " + oPhysicalScreen.GetIDFoo());
[Code] .....
I am using Flex Builder for an Actionscript which apparently has a dependency on IMXML object. I'd never heard of this object, and there is nothing on the project site about any dependencies. I assume it's a Flex component library, though. Which library should I include in order for this program to resolve its dependency issues?
View 1 RepliesI'm developing an ActionScript 3.0 project for Blackberry Playbook, Android and iOS. I have some custom UI classes, like buttons, that I want to use it in another projects. How can I make an actionscript mobile library project? I'm using Flash Builder 4.5, and I'm not using Flex in my code.
View 2 RepliesI have created a Singleton class that handles my project texts. What is the appropriate name of a Singleton class like this?
[Code]...
I'm trying to make a simple test for my current project and I have som problems with Vector class. I'm assigning BitmapData to the MovieClip and store this MovieClip to an Array. Then I'm able to access BitmapData.If I do the same but use Vector instead of Array class, I get this error if I want to access BitmapData:1119: Access of possibly undefined property bitmapData through a reference with static type flash.displayDisplayObject.
Code:
//var store:Array = new Array(); // - THIS ONE WORKS!
var store:Vector.<MovieClip> = new <MovieClip>[];
var itemBitmap :Bitmap = new Bitmap();
itemBitmap.bitmapData = new BitmapData(100, 150, false, 0x990000);
[code]..
Im starting to learn about how RTMFP works in Flash, and I want to know what do I need to make this happen. I got this game, flash game, and I'd like to use RTMFP so other players can play versus/coop with each other.
Think of a RTS (Starcraft), I build units, some other guy do the same, and units fights with each other.
If I understand correctly, Cirrus is enough to make this happen, but I also heard some guys saying that FMS (Flash Media Server) is required for this, wich is, if Im correct, quite expensive at least for my low budget.
So, let say, I got N players, and they can connect with each other like in a regular RTS online game, is Cirrus enough for this?, or do I need to pay for FMS? I'd also want to record some data after the match is over, so I can give some points/gold/etc to each player
im trying to make a gallery in flash for a project and the coding isnt right Array 1 will play but arary 2 wont
[Code]...
I'm an MA student, and I am looking to make a simple theremin in Flash as part of a project. Can it be done? Has anyone done it before?
View 3 Repliesmy default document is the swf file.
View 1 RepliesIn my university a have to make a project: XMPP client on Adobe Flex. On this occasion I've decided to learn any architectural framework and to use it in my project. Could you advise me, what framework would be the best one for the XMPP client? What are advantages and disadvantages of this or that framework?
View 7 Replies