ActionScript 2.0 :: Passing TextField Into Custom Collection

Jan 22, 2009

I want a custom collection of TextFields that will update a property (to be posted back) when they lose focus (as opposed to using onChange and being too verbose). Here is the code of my collection...

[Code]....

View 4 Replies


Similar Posts:


Actionscript 3 :: Designing A Custom Collection Class?

Sep 15, 2010

Design a class that is a collection of other objects and could be used in for each (..)

public class Cards
{
public function add( $Card : Card ) { ... }
}
//...
var $Cards:Cards = new Cards();

[Code]...

Interesting thing is that if I use Array class as parent I shouldn't define child classes as dynamic

So, the question is: Is it possible to design a collection class in AS3 that could be used in for each (...) and will not contain any unnessary methods (like from Array class)?

View 2 Replies

ActionScript 3.0 :: Garbage Collection For Custom Effects?

Oct 19, 2011

I decide to make some custom effects for movie clips of my own, but while doing it i found out that i don`t know what happens withe the effect object after his job is done.

Code:
package {
import flash.events.*;

[code].....

View 8 Replies

ActionScript 3.0 :: Force Garbage Collection Or Explicitly Delete The New TextField-s?

Jun 13, 2009

I have a strip of SimpleButton-s which on mouseover will display a Bitmap in a Sprite location along with some TextField-s whose positions are dynamically calculated based on the Bitmap.width.With the below code, I find that the memory usage (Windows Task Manager > Processes) keeps increasing on each MouseOver. How do I force garbage collection or explicitly delete the new TextField-s?

Code:

function onMouseOver(index:uint)
{
_theSprite.removeChild(_theTextField);
_theSprite.removeChildAt(0); // the bitmap

[code]....

View 1 Replies

ActionScript 3.0 :: Var Not Passing From Custom Class

Jan 26, 2011

I have created a custom class. It seems to work (at least no errors), but when I create a button in the actual FLA that calls on the class, it doesn't change what I want it to change. Here is the class:

[Code]...

When I call for the class to make the button, it works. It also successfull calls the default.png from the class, but in the FLA the icon_retrofit.myIcon doesn't change the image to 'images/b.png'.

View 2 Replies

ActionScript 3.0 :: Flash Passing New TextField

May 4, 2011

I began coding in AS3 three weeks ago, and have made some simple games.Then, I tried making a generic SimpleButton for a multiple-choice game. I tried adding dynamicText in it, to no avail. As what I have read online, you cannot add dynamicText in it. With these, I tried to put inside a MovieClip the SimpleButton (without the text), and adding the dynamic Text in it. I tried to access the textField with [code]And it sure worked as the trace printed the value that I am passing. But the display on the program remained unchanged.

View 2 Replies

Flex :: Passing Array To Custom Component?

Oct 18, 2009

I created a custom button component that accepts an array as a property. I set the property as follows:

titleDims="[{Month: comboBox1.text, Year:comboBox2.text, Sales Order:comboBox3.text}]"

and I get the following error:

"1084: Syntax error: expecting rightparen before colon."

Wat is wrong with the array syntax?

View 2 Replies

ActionScript 3.0 :: Passing A String To Be A Custom Event

Oct 1, 2010

Ayumilove sent:

Code:
//Within Button1.as class
super.dispatchEvent(new CustomEvent("your custom message or data"));
super.dispatchEvent(new CustomEvent(CustomEvent.AYUMILOVE_EVENT));

[Code]....

each instance will have to have it's own event, how should i pass each instance its custom event?

View 8 Replies

Actionscript 3 :: Write An Adapter That Maps All The LinkedSetFx Events To The Expected Flex Collection Events(As3Common-collection)

Aug 25, 2010

LinkeSetFx has its own CollectionEvent, but I don't know how to map the LinkedSetFx event to mx.events.collectionEvent(I want use it in ComboBox). LinkedSetFx is in AS3Commons-collection framework.Here is the url, choose the as3commons-collections-1.0.0.zip, you'll find LinkedSetFx in srcorgas3commonscollectionsfx

View 1 Replies

ActionScript 3.0 :: Passing Arguments To A Custom MC Class Constructor?

Oct 30, 2011

I'm having trouble with the constructor for a custom Class tied to a library MovieClip.
 
Say I have a MovieClip in my library named Circle, which is tied to the class com.shapes.Circle . I want the Circle class contstructor to take 2 arguments, xScale and yScale:
 
public function Circle(xScale:Number, yScale:Number) { }
 
However, if I try to call that from in code, for example Circle ball = new Circle(3.14,2.0); , I always get an "Incorrect number of arguments. Expected 0" error.
 
Is it possible to have a custom class tied to a MovieClip that can take arguments, or does Flash not allow this? I'd asked about this before and thought I figured it out, but from looking at it now I apparently hadn't figured it out and had resorted to a sloppy workaround; I'm hoping to fix it now.

View 12 Replies

Actionscript 3.0 :: Passing Variables With A Custom Event With TransitionManager?

Apr 30, 2009

trying to learn Custom Events so that I can pass a variable through to a function that's fired when a Fade Out has been completed.

i.e.

Code: Select allvar tm:TransitionManager = new TransitionManager(movieclipname_mc);
tm.addEventListener ( "allTransitionsOutDone", TriggerThis );
tm.startTransition({type:Fade, direction:Transition.OUT, duration:2, easing:Strong.easeOut});

When the Fade Out is completed, the TriggerThis function is fired...

Code: Select allfunction TriggerThis(e:Event):void {
trace('triggered');
}

I want to pass a variable to TriggerThis though and I know that I need to use a Custom Event to do this. I tried creating a .as file containing the following:

Code: Select allpackage
{
import flash.events.Event;

[code]....

But this results in errors. Can anyone shed any light on how to pass the variables after a Transition has completed?

View 2 Replies

ActionScript 3.0 :: Passing Variables With A Custom Event With TransitionManager

Apr 30, 2009

I've spent most of this afternoon trying to learn Custom Events so that I can pass a variable through to a function that's fired when a Fade Out has been completed.

i.e.

[Code]....

So I'm not sure that I'm even close to getting this right.

how I can pass variables to a function called when a Transition has completed?

View 3 Replies

ActionScript 3.0 :: Flash Passing Data With Custom Event

Oct 14, 2010

I'm trying to pass a string variable with custom event and having a problem retrieveing the string when the event is handled. The event fires OK, and I can trace the string in the Event, but it returns "undefined" in the event handler. I'm hoping it's just a typo or something, but it's got me stumped. Below is my Event code and the handler code. [code]

View 2 Replies

ActionScript 2.0 :: Passing Parameter To GotoAndPlay In Custom Function

Dec 13, 2004

I have a custom function with parameter. I'm trying to pass the parameter to the gotoAndPlay as follows. This is where the function is called...

Code:
myButton_btn.onPress = function() {
myFunction("Apply");
}
This is the function...
Code:
myFunction = function (fLabel) {
trace(fLabel);
gotoAndPlay(fLabel);
}

Basically "Apply" is a frame label that I'm trying to send the playhead to. The fLabel paramater traces out properly, but the gotoAndPlay doesn't send the playhead to the appropriate frame label. It sends it to 4 frames before the end. It's really weird. Even if I add frames to the timeline, it still sends it to 4 before the end. I can get it to work perfectly in a "new" flash document, but not in my existing document.

View 11 Replies

Flex :: Passing Properties To Custom Component In Flash Builder 4

Sep 7, 2010

I'm trying to pass some properties to a component I've created in Flash Builder 4. In my example below I want to pass the "label" property to update the label property of the Button.

// MyApp.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="[URL]"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:local="*">
[Code] .....

View 1 Replies

Actionscript 3 :: Flex 4 . Passing Data From Main App To Custom Component

Oct 15, 2010

I havent found quite what I want elsewhere or at least am not accomplished enough to adapt I'm trying to create a project that shows radio stations with logo, listen button etc The datasource is an xml file with child tags like 'name','image' and 'listen' for each parent, 'station'. I access this data via the main application with creationComplete="radioService.send()"

[Code]...

View 5 Replies

Flex :: Passing Data From Custom Class To Main Application?

Aug 4, 2011

Im a complete beginner in Flex programming. I have an application with a main .mxml file, and a certain class Foo that I call from the .mxml. In Foo, I make a URLRequest and listen for the Complete event. Then I found myself with the returned data in a Foo function, but I have no idea how to communicate it to the .mxml part of the application ! I looked into ArrayCollections but I can't seem to understand how they work. Isn't there a way to modify, from inside the class, a variable with a global scope ?

View 5 Replies

Actionscript 3 :: Create Instances Of Flex Custom Component By Passing In Type

Jul 28, 2009

In my flex app there are a few custom components. I want to create instance of these components at runtime and assign them properties by reading in a config file. I know how to read xml and instantiate components, however my question is about being able to get the type of the component from the xml attribute and then creating an instance of that type.

View 1 Replies

ActionScript 3.0 :: StartDrag To Path - Passing Custom Drawn Shape Like Curve

Nov 19, 2009

I am currently looking to see what the bounding are for the start drag method. And by the looks of it the bounding is set by passing the rect() object to the dragUpdater/ constructor. My question then is can you pass a custom drawn shape like a curve or what ever? By the looks of it you can not as specified by the adobe reference doc.
startDrag()method
public function startDrag(lockCenter:Boolean = false, bounds:Rectangle = null):void
So from this I would conclude that to have a custom drag path one would have to create a custom class.

View 2 Replies

ActionScript 2.0 :: Passing Xml Loaded Text To External Swfs Dynamic Textfield

Feb 21, 2007

i'm pulling my hair over this. i have sucessfully (verified) loaded an xml file and can trace the data i'd like to pass. i am loading the external swf into an empty mc called X. in the external swf i am loading is a mc and in there is a dynamic textfield. i give the content of the xml to the path to the dynamic textfield and nothing happens. trying to pass the variable with: target.text = content;

i listed the variables and objects in the test movie debug option (command+enter) and i can see the dynamic text box variable. then i took copied the path from the output window to my actionscript, replaced _level0 with _root but still to no avail. what am i doing wrong? do i have to publish the swf being loaded in a certain way? why am i able to look at the variables in the debug list variables and objects option, but not in the actionscript?

View 1 Replies

ActionScript 3.0 :: Add A Custom Property To A Textfield?

Apr 28, 2010

Is there anyway of adding a custom property to a dynamic TextField. [code]...

But, how would I do something similar with a TextField (puting a TextField inside a Sprite or MovieClip is not an option).

View 2 Replies

ActionScript 2.0 :: Custom Scrollbar For A Textfield

Nov 18, 2005

I made a custom scrollbar for a textfield that works like a charm... but in it's "alpha-state", it was only showing where the text was scrolled to (and how long the text is, by it's own height)- you couldn't actually click the scrollbar and drag it. So I added a little AS to the actual scrolling block MC that *should* work... and kind of does- but not like I think it logically should..?

[Code]...

View 5 Replies

Flex :: Sort Collection And Sort Remains In Place When Adding To Collection?

Jun 30, 2011

When I get a collection back from the service tier, I create an ArrayCollection and apply a sort. When I add an item to the collection later on, the sort is still in place? It seems to be the case. I thought I was only sorting it once, not applying a sort that will stick??Here is the method for adding an item:

private function onAddNewClick():void
{
var fileTemplate:FileTemplateDetailDTO = new FileTemplateDetailDTO();

[code].....

View 4 Replies

Actionscript 3 :: Reordering An Array Collection Based On Another Array Collection Hierarchy?

Sep 16, 2011

I have an array, crewPositionsAC that contains a list of position abreviatations - EP, PR, DR, WR, and so on. These positions are read in through an XML file each time my flex application loads. Also being populated from an XML is a project. Within a project, there are positions (a student assigned to a type of position listed within crewPositionsAC). These positions are not necessarily in the correct hierarchy order dictated by crewPositionsAC. I have all the positions within an ArrayCollection (positionsAC) with the following structure:

positionsAC (arrayCollection)
[0] = Array
[0] = startOffset
[1] = numDays

[code].....

Then, the user can click a button to add another position. When the "Add Crew Member" button is pressed, the user is presented with a list of possible positions to add. Currently, I simply add another array to positionsAC. This results in the recently added crew member to placed on the bottom of the list. I need to take positionsAC and reorder it based on it's [2] item (role) based on the hierarchy defined in the crewPositionsAC. crewPositionsAC has the following structure:

crewPositionsAC:
[0] = EP
[1] = PR
[2] = DR
[3] = WR

* continue until all possible position types are listed

View 2 Replies

ActionScript 3.0 :: Create A Custom Format For A TextField Text?

Aug 23, 2009

I've created a custom format for a TextField text as below:

Code:
var _format:TextFormat = new TextFormat();
var _font:Font = new VerdanaPlain();
_format.font = _font.fontName;
_format.size = 12;

and then I've applied it to a TextField like so:

Code:
var _text:TextField = new TextField();
_text.setTextFormat(_format);
_text.text = "Here is some text";

and for some strange reason, the format does not seem to have any effect on the text in the text field. It still shows using default settings. And yes I have exported the font for linkage.

View 8 Replies

ActionScript 3.0 :: Access MC's Textfield Created In A Custom Class?

Jun 23, 2010

I have a custom class which creates a new MC using a library MC. The library MC contains a dynamic textfield called productName.

The custom class object gets created fine and is displaying on the stage. It's also holding custom properties I set as well.

How do I control the dynamic textfield inside the MC, which is inside the custom class object?

My Product.as:

Code:
package {
import flash.display.MovieClip;
public class Product extends MovieClip {

[Code].....

View 2 Replies

ActionScript 3.0 :: Create A Dynamic Textfield For A Custom Timer?

Oct 27, 2010

I'm trying to create a dynamic textfield for a custom timer created by me. This is how:

var tid:int = 0;
tid = tid+1/30;

[Code]....

The problem is, I can't get the TextFormat to work. Would a timerclass solve the problem?If so, how do I create this? I've only learned to create timers the way I showed above.

View 4 Replies

Actionscript 3.0 :: Input TextField Custom Font Type?

Jun 15, 2009

So I have an input TextField and I'm wanting to use a custom font for it. I tried to use setTextFormat() with a TextFormat object, which does not make any difference. When setting embedFonts to true, Nothing at all gets displayed. I know the problem isn't with the TextFormat object, because I can apply the same format to a regular TextField and it works

View 1 Replies

ActionScript 3.0 :: TextField From Xml Via For Loop (baby's First Custom Class Error)?

Jan 17, 2011

The following is the script for a button that is in my library (no instances onstage at start) which I need to be created from a for loop(courtesy of the excellent Henke37);

ActionScript Code:
package
{

[code]......

View 2 Replies

ActionScript 3.0 :: Creates A Custom Textfield And A Circle Sprite Not Working

Oct 18, 2009

I've made a simple package that creates a custom textfield and a circle sprite. pressing the circle sprite is supposed to update the textfield text with some sent string. The string is being sent by using a custom event. The problem is, for some reason the script never reaches the function that handles the custom event....why isn't the updateText event firing??

[Code]...

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved