Actionscript 3 :: Add MXML Elements To The Main Application?

Jan 26, 2011

There's an HTML technique known as innerHTML that allows Javascript to add/delete/edit HTML elements. Can actionscript do something similar to MXML?

For example, my main application's mxml part is:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Button x="29" y="347" label="Button"/>
</mx:Application>

But after running an actionscript code, I want the user to see the result of:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Button x="29" y="347" label="Button"/>
<mx:RichTextEditor x="183" y="24" title="Title">
</mx:RichTextEditor>
</mx:Application>

Is this possible with Actionscript inside a MXML file? p.s: is this possible with Degrafa library elements?

View 1 Replies


Similar Posts:


Flex :: Send Parameters From A Component To Main MXML Application

Aug 8, 2011

I would like to send variables or parameters from Component to Main (MXML) Application. Like my component is FileUpload.mxml and would like to forward the uploaded file details from FileUpload.mxml to Main.mxml.

I tried the following procedure :

com:FileUpload id="fp"

to get the reference for the FileUpload component, however, I am unable to get the variables from the FileUpload.mxml file.

View 1 Replies

Flex :: Display Another Mxml File As Main View Of Application?

Dec 3, 2011

I have the following problem of how to display another mxml file as main view of application For example, lets say I have main.mxml displaying as main window. When I click button I want to display another mxml file lets say newMain.mxml and close main.mxml

View 1 Replies

Flex :: Define Components Path In Each Module / Just Main Application Mxml?

Apr 16, 2010

I'm implementing a Flex application with several modules.I'm reusing the same component in all these modules.I was wondering if I'm correctly importing it in each mxml module definition: xmlns:hillelcoren="com.hillelcoren.components.*"Should I import it only once, in the main application mxml instead?

View 1 Replies

Actionscript :: Calling Function In A Mxml Component From A Main Flex Application

Dec 20, 2010

In my main application I have a viewstack with 3 child views. In the viewstack change handler, I programmatically change the selectedchild property.

I understand that the initialize method for the view is not called every time I change the selectedChild Property. So I tried to invoke the init method programmatically too..

view1.mxml
<fx:Script>
<![CDATA[

[Code].....

View 2 Replies

Flex :: Retrieve Value On Main.mxml From Other .mxml?

Apr 23, 2010

main.mxml
[Bindable]
private var _dp:ArrayCollection = new ArrayCollection([

[code].....

View 1 Replies

Flex :: Gui - Switch Between Different Applications(mxml File With Application As The Root Tag) In A Big Application?

May 16, 2010

I'm new to flex. Now I'm writing an flex application. I plan to split my application into some MXML files(Application as the root tag). How can I switch from one mxml to another?BTW, what is the best practice for design large flex application? Just one MXML Application and many MXML component or many MXML Application?

View 1 Replies

Flex :: Access Mxml DOM Elements?

Jul 9, 2009

Is there a way to access the DOM-Elements of a mxml file in a way that you can in JS (e.g. using Prototype or jQuery)?

I need to know if a top-level element has a child (sub-sub-...-childs) with a certain id.

In JS (using prototype) it would be something like:

$('tabs').select('[id="something"]');

View 2 Replies

Actionscript :: Xml - Access Namespace Elements In MXML?

Jun 10, 2010

If I Have an XML variable that equals this:

var X:XML=XML("<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:ns1="Tools.*" minWidth="684" minHeight="484" creationComplete="Init();" xmlns:ns3="Components.*" initialize="I()"/>");

And I try to list the attributes via:

var AList:XMList=X.attributes();

The three namespaces, "xmlns:mx","xmlns:ns1", and "xmlns:ns3" aren't listed among the attributes! How can I access this information programmatically?

View 1 Replies

Flex :: Child Elements Of MXML Class Not Appearing?

Mar 4, 2011

I'm working on a simple task/calendar tool where tasks can be added dynamically to a canvas. Here is the main application as defined in Main.mxml, which is essentially just a Canvas and a button for adding a task:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Canvas id="MainCanvas" borderStyle="solid" width="300" height="300">

[Code].....

The problem is that when I add a Task instance to the Canvas, the children (the button and label) don't appear. I tried setting creationPolicy="all" on both the Canvas and the BorderContainer, but it still didn't work. I've read a bunch of posts about people having issues accessing members of their class before the class is fully loading, but all I want to do is SEE that Label and Button show up inside the BorderContainer.

View 2 Replies

Flex :: Get Id Value Of Main.mxml File To CustomPanel.mxml File?

May 16, 2011

I have a method in CustomPanel.mxml and I need to use id which is available in Main.mxml. Below is my sample code

Main.mxml
<local:CustomDivideBox id="div1">
Custompanel.mxml[code]....

View 2 Replies

Flex :: Come Back In Main Application On Click Of Logout Button Which Is In Application's Component?

Aug 4, 2011

How I will be back in Login Page after click of logout which is in application's component.

Project.mxml

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"

[Code]....

View 2 Replies

Flex - Define A MXML Component And Update MXML Component In Flex Application

Aug 12, 2009

A Flex components values are initlized by init methord. In an application flow, How to refresh a mxml component data value ; as init is callled at the start up it self only.

eg. of mxml componet may be as simple as button label or text as complex as repeater whose data provider is a web service ( means a fresh quesy should be made to pull the data and refresh the dataprovider of repeater )

View 3 Replies

Flex :: SystemManager.addEventListener Of Sub Application Is Not Working In Main Application?

Mar 31, 2011

i used systemManager.addEventListener in sub application...... it is working well....but when i load sub application into main application through swfloader it doesnot working..

View 1 Replies

ActionScript 3.0 :: Create An AIR Application Without Using Mxml?

Apr 25, 2011

How to create an AIR application using only actionscript(without mxml)?

View 5 Replies

Flex :: Components And Main.mxml Communication?

Mar 7, 2012

I'm building a Flex 4 Application in AIR.I've made a main.mxml and a login.mxml component. It all works but i can't communicate between my two mxmls (MAIN and COMPONENT)The login works but then it has to send a event tot the main that i can change the state in the main.Here is my cropped code.

login.mxml
//resulthandler if login is succesfull
loginUserResult.addEventListener(ResultEvent.RESULT, loginUserResultHandler);

[code].....

View 3 Replies

Flex :: Mxml - Embed An SWF Graphic In A 4 Application?

Sep 21, 2009

In Flex 3, you just said

<mx:Image source="@Embed('foo.swf')"/>

What is the preferred way to do this with Flex 4? Should I just keep using Image?

View 1 Replies

Flex :: Move MXML Application Into Flash?

Jun 18, 2010

Is it possible to move a flex mxml project into flash?

i have the project complete in mxml with actionscript but due to the fact that flex is limited in its visual animations ( no timeline! ) i would prefer to switch to using flash.

View 2 Replies

Actionscript :: Advantages Of Using Mxml In A Flex Application?

Oct 31, 2010

they both seem to accomplish the same things with different syntax, whats the point of using two different technologies. highlight every possible benefit of using mxml. Also are there scenarios when one is more beneficial than the other and why. clarify this runtime behavior of mxml vs AS3 as discussed in Oreilly Flex 4 Cookbook page 1:

[Code]....

View 7 Replies

Flex :: Multiple Netconnection At One Mxml Application?

Jun 13, 2011

Since I have to get data from other red5 application. is it possible using multiple netconnection in one mxml application?

View 1 Replies

In Flex Mxml Application On Including .as File?

Feb 26, 2012

In mxml application made in flex if i place a part of actionscript code in separate file and include it in mail application using (fx:Script source) , then do i have to import all the mx and spark components in .as included file even though they are were already imported in main mxml application ? For example if i have mx alert already imported in main mxml file then will i have to import in again in the .as file placed externally although .as file is included in main mxml application ?

View 1 Replies

Php :: Load A Sub-application From A Main Application In Flex?

Jan 19, 2010

I've created a client with login acces in Flex. After the succesful login i have to show a table based on a mySQL server. The database is composed by some tables, and I have created 6 flex mxml components with each own scripts for each of those tables. How can i load sub-applications, for example with a PopUpButton or a TabBar in the main application?

View 1 Replies

Flex :: Adding MXML Component As Child Of Main App Using AS

Apr 26, 2010

How can I add an MXML component as a child of the main application using ActionScript. It's not possible to instatiate it, is it? Assuming that behind every mxml file stands an actionscrpt3 class, I tried to import it but id didn't show up.

View 1 Replies

Flex :: Listening An Event In Main.mxml While In A Component?

Mar 9, 2011

I have an event, which I have dispatched in my main.mxml:

var evt:UserEvent = new UserEvent(UserEvent.USERINFORMATION);
evt.userVO = storeObject;
this.dispatchEvent(evt);

I can listen for it while in my navigation.mxml file, by using

this.parentApplication.addEventListener(UserEvent.USERINFORMATION, onInfo);

But in other component, I can not listen for it, even trying the same as I did in navigation.mxml.

tracing it back gives me an undefined.

the second component is in a viewstack in navigation.

View 1 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

C# :: POST Data To A Flex/Flash (mxml) Application?

Feb 19, 2010

I have Flex application requiring to filter users depending on there database groups.Depending on which group they are, the're is a config.xml file that is use to populate the swf.Here is how I figure how to do this : 1. The client comes to a .aspx page with a form requiring a username and a password. 2. On the server side I confirm the user credential . Once the username/password is valid I redirect to the mxml file with the config.xml file in the html headers (post).My problem comes when I need to get the post data from the http request. Let's say I have this code :

<mx:Application initialize="init()">
<mx:Script>
<![CDATA[

[code].....

View 2 Replies

Actionscript 3 :: Call The Function That Is In Main.mxml App From A Class In Flex

Feb 24, 2011

i write a sound playback class that stop the older sound and play the new sound.After that i need an extra method in this class that trigger when the sound play is complete.I successfully achieve this, but i need to inform the main app (main.mxml) about the completion of that sound playing.

here is my sound playback class.

package com.m2b.data
{
import flash.events.Event;
import flash.media.Sound;

[Code]....

View 3 Replies

Flex :: Flash - Using Sprite Objects In A MXML-based Application?

Oct 25, 2010

Canvas.addChild() insists any DisplayObject added implements IUIComponent. But I don't want my core graphics engine dependent on Flex. Is there an obvious/common way around this, to have simple graphical objects like Sprites & Shapes in a Flex application? The individual DisplayObject children I want to add as children represent objects in a game world, like a spaceship or a missile or a horse...

Not sure if Canvas is the most appropriate container, perhaps Group or another class is optimal for a game-engine... example MXML & AS3 code showing a skeleton setup is most welcome. I'm targeting Flex4 & Flash 10, but Flex3/Flash9 solutions are still of interest.

View 1 Replies

ActionScript 2.0 :: Stop Main MovieClips With All Elements Inside It

Jul 2, 2007

I've been using this code to try and stop a main movie clip and all of the movie clips inside it. My problem is that this code only stops the main movie "elements" but none of the nested clips, can anyone spot a glaring mistake.

function stopAllClips(clip) {
clip.stop();
for (var i in clip) {
if (typeof clip[i] == "elements") {
if (clip[i] != clip) {
stopAllClips(clip[i]);
[Code] .....

View 2 Replies

Css :: Flex Appending History Tracking Elements Below Application

May 22, 2009

I've got a Flex application that uses link buttons. As soon as I incorporated the link buttons (I assume) the Flex framework started putting history tracking elements below the app in the DOM. For example IE6-8 get an iframe element with id of ie_historyFrame, chrome/safari get a safari_rememberDiv and FF gets a firefox_anchorDiv.

Now, there would be no problem if these elements were hidden by the framework, but they're not. The sit underneath the Flex app (visually and in the DOM) and have a bunch of serialized history data.

I was wondering, is there a way to hide them through configuration or code? I know I could hide them via CSS but it just seems nasty that I'd have to use CSS for something that Flex is supposed to manage. I want the application to be site independent.

View 5 Replies







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