Flex :: Cast String To Image Id To Modify

Jun 27, 2011

i'm trying to modify a image, which is casted from a String:[code]In the inactiveElements Array are a bunch of ImageIds (way_0, way_1,..) and i'm trying to set the alpha-value of each Image.[code]with the trace i got the right String of ImageId but the cast to Image fails.[code]

View 1 Replies


Similar Posts:


Actionscript 3 :: Decode And Cast JSON String In Flex?

Sep 20, 2009

I'm using as3corelib to decode/encode JSON strings. In my little experiment I want to encode an object (UserInfo) to JSON string and decode it back to the object, however it seems to fail at the convertion point (the last line), why would that happen? how can I make it work?

The UserInfo class

public class UserInfo
{
public var levelProgress : int;
}

[Code]....

View 4 Replies

Flex :: Adding 1 (+1) Not Working On String Cast To Number?

Jan 25, 2011

just learning as3 for flex. i am trying to do this:

var someNumber:String = "10150125903517628"; //this is the actual number i noticed the issue with

var result:String = String(Number(someNumber) + 1);

I've tried different ways of putting the expression together and no matter what i seem to do the result is always equal to 10150125903517628 rather than 10150125903517629.

View 1 Replies

IDE :: Cast String As Function

May 15, 2009

I want to have a loader function that passes the loaded data to the correct function. So I can do this:[code]Is there any way to type the second variable to avoid the clumsy switch routine, like so:Function (sendTo) ();

View 2 Replies

ActionScript 3.0 :: Cast The String Into MovieClip?

Dec 12, 2008

I have the code the following code:

in root frame I:

var prevSec:*;
var currentSec:*;
var lastPage:String = "Default/Index";

[Code]....

And it's not working ("canno't create property visible on String"). I understand that if finds the variable to be of String type.

What i need to do is based on the switch to set a certain movieclip to go visible false or true on frame 16. I need to know how to cast the String into MovieClip.

View 1 Replies

ActionScript 3.0 :: Cast String To Uint?

Nov 26, 2008

Does anyone know how to cast a string into a uint?[code]...

But i keep getting an error stating that there is a mismatch in variable types or i get a value of '65280' when I trace myUint.I understand that uint is a positive integer but i need to accept a string for the colour value and need to convert it to a string for use.

View 6 Replies

ActionScript 3.0 :: Cast A String Into A Variable?

Apr 5, 2011

i have a list of items that get returned from a database.  the list is composed of strings. what i need to do is convert each item into a variable so that i can use each item as an array.
 
for instance, my array will look something like this: deviceArray = ["osx106", "osx107", "winxp", "win7"];
 
what i want to do is turn each item into its own array.  in AS2 (iirc) we had an eval() method.  that is no longer supported in AS3.

View 2 Replies

Actionscript 3 :: Cast A String As An Array?

Mar 1, 2012

I have 5 different arrays for a bunch of excercises, like so:

const oef1:Array = ["citroen","schoen","boek"];
const oef2:Array = ["huis","muis","jas"];
const oef3:Array = ["boek","koek","sok"];
const oef4:Array = ["ei","bij","bot"];
const oef5:Array = ["vier","mier","muur"];

Now I want to set the current game. I do this by copying the array, like so:

var curArr:Array;
var curExc:int = 1;
curArr = ("oef" + curExc) as Array;

I can't convince flash to accept the string ("oef"+curExc) as an Array. How do I do this?

I have searched Stack Overflow extensively but I think I simply don't know the correct lingo for what I'm looking for. It's the only possible reason I can think of why I can't find the answer here because I'm sure someone must have already tried this.

View 3 Replies

ActionScript 3.0 :: Cast String To Variable Name

Oct 2, 2009

I have a variable in flash:[code]I then have a multidimensional array which has this variable name in it, but as a string.[code]What I need to do is be able to reference the string item in the array, but then cast it so that when I add a number to it the ACTUAL variable with the same name will be altered - anyone know how I can do this?For reasons I won't go into I can't pass it straight into the variable, it has to go through the multidimensional array item.

View 5 Replies

Flash 10 :: Cast String As A Class?

Nov 4, 2010

I have 52 symbols in my library each with class names Symbol1, Symbol2, Symbol3, etc. I want to create an array of these classes which will be used to create a random particle effect. How do I cast the var cardNumbers so that the array looks like this[code]...

View 1 Replies

ActionScript 2.0 :: Any Way To Cast String Into Integer Value?

May 10, 2005

I need to add values in a string (they're strings because I get a date as timestamp from a database and then pluck it apart in Flash with substring). Flash doesn't do math with strings. So is there a way to cast the string into an integer value?

View 4 Replies

ActionScript 3.0 :: Type Cast String To Textfield

Feb 21, 2009

[code]How to set focus to class1_txt?I've tried this, but doesnt work. How to type cast it so that the focus goes to the class1_txt.[code]

View 5 Replies

Flex :: FileReference And HttpService Browse Image Modify It Then Upload It?

Sep 23, 2009

I am trying to do an image uploader, user can:

- browse local file with button.browse

- select one and save it as a FileReference.

- then we do FileReference.load() then bind the data to our image control.

- after we make a rotation on it and change the data of image.

- and to finish we upload it to a server.

To change the data of image i get the matrix of the displayed image and transform it then i re-use the new matrix and bind it to my old image:

private function TurnImage():void
{
//Turn it[code]...........

Now the mater is that i really don't know how to send the data as a file to my server cause its not stored in the FileReference and data inside FileReference is readOnly so we can't change it or create a new, so i can't use .upload();.Then i tried HttpService.send but i can't figure out how you send a file and not a mxml.

View 1 Replies

ActionScript 2.0 :: CS3 Number-cast Input String Versus Numbers - Inconsistent Traces Between Computers?

May 26, 2009

We're making a simple input text comparisons vs. some constant floating point numbers (e.g. 4.35). Using Actionscript 2 to Flash 9 export. Getting totally contradictory traces on two different computers compiling identical code...Here's some simple code we're using to figure out what's going on.

Code:

trace(typeof(Number(435/100)))
trace(typeof(Number(435/100)==4.35))
trace((Number(435/100)==4.35))

[code]....

Also, what behavior do any PC users have? I'm expecting the latter since they're generally intel chipsets too?Note: once i compile the code on my PPC mac, intel macs that run the SWF (but don't recompile the FLA) do return the correct booleans that match the PPC output.

View 1 Replies

ActionScript 3.0 :: Cast String As MovieClip When MovieClip Is On Stage?

Jan 15, 2010

I am trying to cast a String (from an array of strings generated by a for loop) which is referencing a MovieClip already on the stage.

[Code]...

View 4 Replies

Java :: Flex Error Flex.messaging.io.amf.ASObject Cannot Be Cast To

Sep 13, 2010

I have an action script Object that contains an array collection of other object, both objects are reflects of the Java Objects which are the database tables represented as beans, i am using blazeds spring hibernate... the regular configurations for flex RIA with java backend server language, all other objects work perfectly, but this time i needed to get this data from the client side and i do, but when i get into the Set represented as array collection in client side i get this error! both classes work for other situations, mapping is ok for these classes, i suspect that i need to convert the array collection on the server side.

View 1 Replies

Flex :: How To Cast One Object As Derived Type

Nov 3, 2009

Here's the example:
var cartesian:CartesianChart = new CartesianChart();
cartesian.width = 100;
var column:ColumnChart = new ColumnChart();
column = cartesian as ColumnChart;
Why does this not work? "column" ends up null. ColumnChart is a derived class of CartesianChart, so I would have thought I'd end up with a ColumnChart with a width of 100.

View 1 Replies

Flash - How To Modify Image Dynamically

Jan 29, 2012

I'm trying to modify my bitmap to change their pixels to a random color. This is the way I do it (I'm using the FlashPunk library):
private var _v:Point = new Point;
private var _speed:Point = new Point(200, 200);
private var _bmpData:BitmapData = new BitmapData(24, 24, false, 0x000000)
private var _bmpImage:Image = new Image(_bmpData);
public function Player(p:Point) {
[Code] .....

So ok, the function that does this is render(), but in the line
graphic = new Image(_bmpData);
I get new memory for graphic, and this translate into a memory leak in the game. Here is an image of this:
And as you can see, the MEM: part is constantly increasing.

View 1 Replies

Flex :: Null Cast Between Parent And Child Objects?

Mar 1, 2011

I have a flex application with two objects: a parent widget (called an IBaseWidget) and a child widget (called a HelperWidget2).When the user clicks on a help link, a helper widget is loaded into the list of base widgets and then displayed for the user.However, when I try to access this child widget by casting the base widget in the collection to the child widget type,the child widget returns null and I am unable to work with the widget.The following snippet correctly returns the widget ID of the newly added widget and dispatches an event to load the widget:

var id:Number = WidgetManager.getInstance().getWidgetId("Helper");
ViewerContainer.dispatchEvent(new AppEvent(AppEvent.WIDGET_RUN, id, openQuickQueryCanvas));[code].........

The problem is that helperWidget above always returns null, meaning the cast isn't successful.

View 1 Replies

Flex - Embed Image With A String Variable Which Contains A Filename?

Jun 26, 2010

I try to embed images in a mx:tree:

<mx:Tree labelField="name" id="tree"
folderOpenIcon="@Embed(source='assets/images/test.png')"
folderClosedIcon="@Embed(source='assets/images/test.png')"
defaultLeafIcon="@Embed(source='assets/images/test.png')">
</mx:Tree>

This works fine, but I will embed the images with a String variable.

[Code]...

View 3 Replies

Professional :: Modify The Code To Get The Last Number Of Image?

Aug 9, 2010

The following code is quite nice I got it from a tutorial. But I would like one modification as mentioned below: The next_btn will disappear in the following code once it reaches to 5 image.Instead that what I need to modify is, the could should get th last number from the images and set the disappear to value to next_btn. Why I need it because I don't know how many images the user will require. The following is the code:


next_btn.addEventListener(MouseEvent.CLICK, nextImage);
//variable is a container that holds some value...var imageNumber:Number = 1;=true;[code]..........

View 5 Replies

Flex :: Convert And String(path Of Image) To A Bitmap Object?

Jan 6, 2011

The solution should be straight forward but I cannot find it, my problem it's that I'm reading a xml, and one of the properties inside the xml it's a Bitmap path(string), when I`m reading this xml I would like to convert this string to a Bitmap Obj so I can use through my MXMLs.

View 4 Replies

Actionscript 3 :: Modify Image Data In SlidesShowPro Using Flash?

Mar 19, 2010

I'm using SlideShowPro with Flash AS3 and I have the following [code]...

How can I modify the link for when the image is clicked?

View 2 Replies

ActionScript 2.0 :: [MX] Modify Scale And Alpha Of Image Via Input Txt Boxes?

Jul 23, 2003

I have to make a thingie whereby when u enter values into 2 input txt boxes an image modifies its scale and alpha accordingly. Now I have done everything I am supposed to but the funny thing is NOTHING happens. I'll post the code (I applied it to the button which I think is right)...

on (release, keyPress "<Enter>") {
if (_root.scale>100) {
gotoAndPlay(1);

[Code]....

View 8 Replies

ActionScript 2.0 :: Modify The Kirupa Image Gallery To Use Numbers In Place Of Thumbnails?

Jun 19, 2007

I am trying to modify the Kirupa image gallery to use numbers in place of thumbnails.So far I have been able to place buttons on the stage using attachMovie()and I have been successful in getting them numbered properly. Where I am failing is in getting the individually placed buttons to load an image.A more detailed list of what I am trying to do:

I want to attach a button that has a text box to the stage.In that button�s text box I want a sequential number to appear.When a button is pressed I want the corresponding image to display(button 1 loads image 1).I have the first two working; not doing so well with the last.Here is what I have:

PHP Code:[code]...

View 8 Replies

Flex :: Create A Custom List Item Renderer With Image(base64 Png String) At Runtime?

Mar 28, 2011

I'm trying to create a list with icons. There're a lot of examples but seems all of them are using embedded images.My problem is how can I create the list with icon from base64 png string at runtime?

View 1 Replies

ActionScript 2.0 :: Load A New External JPEG Image Into A MC With A String Var Encoding A String Caption In The URL Link / Text Fader

Jun 6, 2003

I have a very general requirement that seemed very simple: Step 1: Load a new external JPEG image into a MC with a string var encoding a string caption in the URL link (VALUE="../fadeTest.swf?someTextVar=TestCaption") within the EMBED / OBJECT sections. I know how to do this and it semed to work fine. STEP2: When the JPEG is loaded I would like the substituted Text to Fade In over the JPEG. The JPEG should also fade in before the Text. The fade rate should be programmable.

[Code]....

View 1 Replies

Flex :: Use Same MXML For An Add & Modify Form?

Feb 16, 2010

I have a form that is written in MXML that allows a user to create/add a User.I need to add a form that allows a user to modify SOME but NOT ALL of the fields for this user.The forms are so similar, I don't want to have to create two separate forms, one for Add and one for Modify.For example, in the Add form, the user specifies a user id. In the Modify form, the "user id" field is not editable.I'm wondering how I can initialize the MXML form (i.e. pass in a parameter?) so that it knows whether it is in the Add state or the Modif state.I know I can't do the following but this is what I would like to do (pseudocode):[code]

View 1 Replies

Flex :: Modify Its Properties Since It Already Exists?

Mar 19, 2010

I have a Rect object that I'd like to create and set its properties only once. After that, I want to just modify its properties since it already exists. This is my general idea

if(theRect == undefined){
Alert.show("creating");
var theRect:Rect = new Rect();[code].............

but can't get the desired effect. Everytime this code block runs, and depending on which version I've used, it either gives me a "can't access null object" error or the if statement always evaluates to true and creates a new Rect object and I get the "creating" Alert. What's the right way of creating that Rect but only if doesn't exist?

View 1 Replies

Flex :: Modify The Vertical Gap In A Repeater?

Jul 2, 2010

I Have a VBox, and set the verticleGap = 0. Inside the VBox I have a Repeater. When I run the App, the items listed from the Repeater have a large gap between each line. Is there a way to set the verticleGap on the Repeater, or reduce that space?

View 1 Replies







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