Flex :: Combining Variables To Form A Variable Or Class Name?

Mar 2, 2012

I have an embedded image and the class name to be userd in source tag is a combination of 2 variables, how to do this, below is an iadea of what i am trying to do:

[Embed (source="assets/image11_a.jpg")] public static const 11_a:Class;
var first_part:String="11";
var second_part:String="a";

and in mxml

<s:Image width="100" height="100" source="{first_part+second_part}"/>

above is just a small simplified example of what i am trying to do, actually the variables are getting populated from list.Basically i want to combine variable names to form the embedded image class name to be used in source of spark image.

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Accessing Variables Form Within A Class?

Jan 19, 2010

having trouble accessing variables from the main timeline from within my class...this is a function within my class...(not the constructor function)

Code:
public function createPanorama():void {
var url:String = "../../../panorama/panoramaImg/fenway.jpg";

[code]......

View 6 Replies

ActionScript 3.0 :: Loader And Combining Variables?

Mar 14, 2010

1. I'm wondering if there is a way to use the loader to load in a series of pictures from disk rather than URL. If so what is the code for this?2. Is there a way to combine variables to create one single variable. Again if so how can I do this?I have included the code I am working on to give some clarity on what I'm trying to do.

Code:
var h:String = "http://img163.imageshack.us/img163/5961/pngjoust";
var p:String = ".png"

[code]......

View 1 Replies

ActionScript 3.0 :: Access Object By Combining It's Name From Variables?

May 21, 2010

I don't know if I named thread technically correct.

I'm new to flash, and my current challenge is to access object.[code]...

View 3 Replies

ActionScript 3.0 :: Combining 2 Variables - Background Image And Value Of I

Feb 26, 2011

Let's say I have
var i:Number = 6;
And I need that the 6 would go in place of (i) down below.
this.bg_img(i).visible=true;
So everytime variable "i" would change different background images would change their visibility at the same time.

View 2 Replies

Flex :: Variables - Html Form Post To App

Aug 26, 2011

I've got a flex app that is basically completed it uses Zend AMF to connect/supply data.My app does have a login screen which seems to work fine. Now I'd like to add another login form on my site that would allows users to enter in username/password. When submitted form should pass the data to the flex app and bypass the application's login.

View 2 Replies

ActionScript 2.0 :: Combining Logical Operator With Variables Defined By Radio Buttons

Aug 7, 2008

I have completely hit a wall. Here's what I'm after. I have two sets of radio buttons, each of which controls what loaded swf appears on stage. Then, depending on which button is clicked in group one and which button is clicked in group two, a third swf appears. I can access the value of each radio button, and I'm passing it into a variable (I think - the trace command works) but when I drop it all together into an if/else statement, no data is passed.

Here's the code:
//printArea is a movie clip on stage, which has dynamic mc's attached via code
var thisFront;
//function for what happens when fronts radio buttons clicked
frontListener = new Object();
frontListener.click = function(evt) {
[Code] .....

View 3 Replies

ActionScript 3.0 :: Combining Variable With Sting For Html Textfield

Sep 15, 2009

I'm using the following code to try and change the font size of a textfield dynamically using a varaible but I can't get size to use the variable as a value however all the other variables I combine with the string works as intended just not size ....

PHP Code:

var chSize = 50;
trace(msg);
insID.htmlText += "<font size="+chSize.toString(16)+" fontFamily='Tahoma' color="#"+newColor.toString(16)+"">"+msg+"</font>";

[Code].....

View 4 Replies

ActionScript 3.0 :: Combining Document Class With Timeline Code?

Jan 6, 2010

I've written a game in Flash using timeline code like this:On the main timeline:

Code:

stop();
include "includes/mySourceCode.as";
init();

Then,in mySourceCode.as I have a set of functions (including init(), of course).I know this technique of coding is frowned upon by many,but it was what I learned when I started out with Flash and it has always worked well for me. It also means I don't usually have to bother with importing classes to make most methods work as I guess they are all 'built in' to the main timeline already.

The problem I have now is that I have got the game sponsored, and the sponsor needs me to include his preloader, which is a document classfile.So I have his preloader working, and once loaded it tells the main timeline to proceed to the next frame, where I have my usual code as above - which now doesn't work.Firstly, it can't find my include files because it is now looking in the document class folder instead of the main .fla folder it usually looks in.Secondly, once I have moved my include files to the same folder as the document class, it gives me around 70 errors about undefined properties and methods, and things not being'compile time constants' whatever that means.

I am guessing that for some reason, since there is now a document class, Flash is no longer importing all the classes it usually does automatically for me - so could it be that I need to go through my whole game and figure out the class import paths for all the methods I have used? Or is there an easier way to get my code working how it was before without having to change it? If I do impoort all the right classes, should it work then or will I still face problems?

View 2 Replies

Simple Flash Form Variable - Collect Data From A Form, Then Pass That Data To An Asp File?

Oct 19, 2009

I am trying to create a simple form using Actionscript 3 that will collect data from a form, then pass that data to an asp file. I have attached the following code to the submit button,but this is not working.I'm not sure if I have to add anything else and I don't understand why this is not working. I'm trying to load all the variable info into one variable called email form.

submit_btn.onRelease = function() {
var emailform:text;
emailform.email_txt = email_txt.text;[code]......

View 1 Replies

Flex :: Referencing Class Variables?

May 3, 2011

I have a bunch of variables in a class. There are situations when I want to set then to null/ "temp" etc as per a well defined logic. The challenge is to list out the variables at multiple places- tedious and error-prone.

classname.speed=NaN
classname.speedtype="not_set"
classname.distance=NaN
classname.distancetype="not_set"

would prefer a way to refer to these variables programatically and set something like "for all class variables- if variable ends in type, set as "not_set"; for other variables set as NaN How can I achieve this?

View 2 Replies

Flex :: Layout - Horizontal MX Form Or Vertical Spark Form Flex?

Oct 5, 2011

I have noticed two differences between spark and mx forms which are causing me some problems. It seems by default the mx forms are arranged to the label is above the form input item. In Spark they are arranged next to each other. Also the label in spark forms are bold by default.For example MX code could be

<mx:Form width="100%">
<mx:FormItem indicatorGap="0">
<s:Label text="label1"/>

[code].....

View 1 Replies

Flex :: Flash Builder 4: Variable Not Displaying In Debug Window (Variables Tab)

Dec 15, 2011

In my flex 3.5 project, I have a class (MyItem) extending Canvas. In this I have declared a private variable named itemInfo which is type of ItemInfo (which is another subclass of Canvas).

I wrote code to hide/show the iteminfo when the mouse is over/out of MyItem. I am not getting any error but it is not showing the itemInfo as expected, when debugged the code, surprisingly the variables tab in debug window does not have the variable itemInfo at all.

I have declared a dummy:int variable and it is also not visible.

View 2 Replies

ActionScript 3.0 :: Flex - How To Get Variables In Main MXML To Be Seen By Class

Nov 2, 2010

How can I get access to public variables in my main .mxml application from my AS class and vice versa? Also, say I have a main container panel defined in mxml, how can I reference to it's id from a separate class file?

View 1 Replies

Flex :: Combining Ogre3d's Hikari And BlazeDS?

May 21, 2010

I am trying to load a swf into an Ogre3d/Hikari application and that swf uses BlazeDS to communicate with a Tomcat server. The swf is from another project that is used in a browser environment. So, the swf is served from Tomcat to the client's browswer. It seems like there are two main issues. The first is a sandbox issue with using the swf in a different sandbox type than a browser environment. The other issue seems to be setting up the BlazeDS message broker and the other communication channels and endpoints. As far as both of the issues are concerned, it seems like the Hikari application is similar to an Adobe Air application and can use similar approaches. Does this seem like a reasonable approach?

View 1 Replies

ActionScript 2.0 :: Referring To A Class Property - Get The Id Form The Piece Class

Jan 9, 2009

I have a class that looks like this:

[Code]....

now when i try to get the id form the Piece class like this it doesn't work, i've been looking at this for the better part of the past hour! what am i doing wrong?

ActionScript Code:
var player1:Player = new Player("eddie");
player1.setPieces();
trace(player1.pieces[0].id);///why is this not working! getting undefined!
// i tried datacasting i get null
trace(Piece(player1.pieces[0].id));

View 6 Replies

ActionScript 3.0 :: Calling A Function In The Document Class Form Another Class

Mar 9, 2011

I'm trying to have a class reference a variable within the document class and have scoured the web but can't seem to find a solution. It seems relatively simple, but is a major stumbling block for me.

I want the variable in the doc class to increment each time a draggable object is within bounds and snapped to a box in the subclass. By tracking successful snaps, the objects will be placed one under the other each time.

View 4 Replies

Flex :: Get Array From Server To Form,as Form Items ?

Nov 28, 2009

am sending one user object from java to flex using remote object,now i want to get each item from that array to display in text boxes...how can i do this ?

userInfo=event.result as Array;
<mx:FormItem label="FirstName" fontWeight="bold" width="325" required="true">[code].....

View 1 Replies

Flex :: Combining A Multiple Strings And Arrays To One DataProvider For Spark List

Dec 21, 2010

what I need to do is combine 5 arrays with 5 individual strings (which have come from a JSON webservice) into one single list item in FlashBuilder Burrito. [code]I've pulled these out successfully and each one traces in the debugger, although as I need them all in the same list I'm struggling to establish them as a dataprovider together.If I push the strings and arrays together it is impossible to read properly, as the main Titles are at a different level to any descriptors for the products which are in the arrays.

View 1 Replies

Actionscript 3 :: Slider In Flex Should Control Variable In Class

Nov 3, 2010

In my flex-app there is a slider that should change a variable inside a AS3-Object. How do you realize that? It's np problem to control the slider with the variable, but I want it the other way :)

View 2 Replies

Flex :: Assign Variable As Class In Flash Builder 4 Hero SDK

Jan 17, 2011

I am trying to assign a variable to a view navigation as follows:

protected function list_clickHandler(event:MouseEvent):void
{
var name1:String = list.selectedItem.vPage;
var name2:Object = list.selectedItem.vPage.valueOf();

[Code]....

As the View is presented as a static and not a variable. When you try to submit it as a variable in any format (String, Object) an error occurs.

Error #1034: Type Coercion failed: cannot convert "IM" to Class.

how I can send the (View)Class as a variable or if this is a bug in the SDK

View 1 Replies

ActionScript 2.0 :: CS3 AS3 Form, Components, Variables?

May 22, 2009

My brain has finally started draining out of my ears... which brings me to here for help. I don't know coding at all. I know simple stuff, html, dhtml, css, simple stuff... even simple AS 2.0. AS 3.0... not so much.
I'm totally lost. I'm trying to create a form to send using php. I'm fairly sure the php side I can do.I have 5 text boxes, and 5 checkboxes. No idea where to even start. I've done a lot of searches, mainly on this site and actionscript.org. But I haven't found anything that makes sense. Could someone please help, or direct me somewhere? I'd like to get validations in there too, but honestly, where do I even start??

View 5 Replies

Load Variables With Flash Form?

Dec 26, 2009

I have a simple flash form I put together (can be viewed at [url]... I have 4 input text boxes (name1, email, phone, and message1). Frame 1 is the form, frame 2 is the success message, and frame 3 is the message failed frame. The submit button has the following ActionScript attached to it [code]...

View 6 Replies

Flash :: Post Variables To Php Using Form?

Dec 27, 2011

I am using this code. The input text fields names are Name and Home.[code]...

View 1 Replies

ActionScript 2.0 :: Run External PHP Form With Variables

Feb 4, 2009

I have a flash form. When the send button is pressed, I need to access a php file from another server that sends the email. I need to access the php file like this: [URL], writing the 2 variables, var1 and var2 in the link. I tried like this:

Code:
var sendData:LoadVars = new LoadVars();
link = "[URL]" + value1 + "&var2=" + value2;
sendData.load(link);

This works when I test my file from Flash. But when I upload it to a server, it doesn't work anymore. Why is that?

View 1 Replies

Publish SWF With Variables From A Web Form Embedded?

Sep 16, 2009

The project is a simple flash application that queries a weather content provider, retrieves an XML file containing weather data, then uses that data to display weather information. In addition to being used on the web, the application is also being used on digital signs, terminals, etc:

The application is sold to hundreds of clients, who specify their location, desired layout / theme / colors, and other variables by passing variables to the SWF file via a query string. For instance, a client located in Greenwood, Indianapolis, might use the following code to embed/run the SWF file[code]...

View 6 Replies

IDE :: Passing Variables From Form To Php File

Sep 22, 2009

I have 5 scene's in my flash the first 3 scene are animations. 4 th scene has 4 textinput Box 1 chk box, 1 button.. in this scene i am passing varibles from my form to php file. here is the code For scene4( i called this Inscription form) Its getting datas perfectly.

[Code]....

View 2 Replies

ActionScript 2.0 :: Form Variables From Multiple MCs?

Dec 9, 2009

I am using the Kirupa email form to gather some results on a form...How can I load variables from 2 different movieclips to post in the php? I tried...

_root.loadVariables("email.php","POST");
_root.myMC.loadVariables("email.php","POST");

View 1 Replies

Flash :: Flex Datagrid And Finding Number Member Variable Of A Class

Mar 1, 2011

How to populate a flex datagrid from an Arraycollection without specifying DataGridColumn's individually. Is there any custom datagrid available where I can pass the datasource arraycollection and see the data populated in the output. Without knowing the structure / bluprint of an object is there anyway to find how many member variable that class have?

View 2 Replies

Login Form - Passing Variables To PHP Script

Apr 17, 2009

I currently have a login form in flash that needs to pass variables to a PHP script. That part works fine. The problem I am having is that when Flash passes the variables to PHP, it also passes the style of the input text.

For example, instead of passing "atomstore", it passes "<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">atomstore</FONT></P></TEXTFORMAT>".

This does not match the "atomstore" in the database and results in an error. How to get rid of all of these tags?

View 4 Replies







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