28 Apr 2005
--------------------------------------------------check---------------------------------- function callApp() { window.document.title = document.getElementById(“newTitle”).value; FinalTouchIE.myFlexKeyHandler(window.document.title); } //---------------------------------------------------End Check------------------------------------ //--------------Here goes getFlexApp------------------------------------------------------------------- function getFlexApp(appName) { if (navigator.appName.indexOf (“Microsoft”) !=-1) { return window[appName]; } else { //alert(“Document “+document[appName]); return document[appName]; } } } Flex code:- - id: 171 author: sajjad mahmood author_email: [email protected] author_url: ‘’ date: ‘2008-06-24 21:35:01 +0530’ date_gmt: ‘2008-06-24 16:05:01 +0530’ content: ‘great.............… ‘ - id: 172 author: atul author_email: [email protected] author_url: ‘’ date: ‘2008-08-25 20:54:40 +0530’ date_gmt: ‘2008-08-25 15:24:40 +0530’ content: ‘i have tried you example but it doesn’‘t work can you some more example which are in working ‘ - id: 173 author: Ramesh author_email: [email protected] author_url: http://Nil date: ‘2008-11-13 14:56:07 +0530’ date_gmt: ‘2008-11-13 09:26:07 +0530’ content: | HI, I know its late, But i wish to know that can we include .js(JAVASCRIPT) file in to mxml flex file like including javascrpit file in html. if s, how? what is the code 4 tat. mail me.…. Regards, Ramesh. - id: 174 author: Mysok author_email: [email protected] author_url: ‘’ date: ‘2008-12-28 20:46:54 +0530’ date_gmt: ‘2008-12-28 15:16:54 +0530’ content: | hi, unfortunately the code doesn’t work with Flex Builder 3, do you (anybody) have some update? Thank you a lot. Mysok - id: 6596 author: Bhavika author_email: [email protected] author_url: ‘’ date: ‘2009-08-24 13:00:09 +0530’ date_gmt: ‘2009-08-24 08:00:09 +0530’ content: “i have 1 html page, from there i am calling a flex function to load swf object!\r\nm able to implement this successful in IE and safari,\r\nbut mozilla says myflexfunction is not a function!\r\n\r\nfunction callApp(formid) {\r\n var objectChart = document.getElementById(\“statisticsChart\”);\r\n objectChart.myFlexFunction(formid, $get(‘’).value);}\r\n\r\nmyFlexFunction is a flex function, statisticchart is a swf object.\r\nany help will be appriciated!\r\nanyidea?” - id: 7269 author: splendidus author_email: [email protected] author_url: http://splendidus.blogspot.com/ date: ‘2009-10-04 21:22:00 +0530’ date_gmt: ‘2009-10-04 15:52:00 +0530’ content: |- \@Bhavika: I had the same problem. In my case it turned out, that the flex-function was invoked before the swf-object was fully loaded. I described the problem and my solution in more detail on my blog: http://splendidus.blogspot.com/ Hope it helps... - id: 7383 author: pinarocal author_email: [email protected] author_url: ‘’ date: ‘2010-04-13 20:15:00 +0530’ date_gmt: ‘2010-04-13 14:45:00 +0530’ content: |- Hi, I have a problem. in my project i have two parts one is related with Javascript files for mozilla add on , the other is flex files which is used for graph visualization. the problem is that i can not manage to ensure interaction btw flex and javascript files. i want flex files take information from javascript file. that is, I want Javascript sent data to flex files. Can anyone help us ? thanx in advance - id: 7384 author: splendidus author_email: ‘’ author_url: http://twitter.com/splendidus date: ‘2010-04-13 20:52:00 +0530’ date_gmt: ‘2010-04-13 15:22:00 +0530’ content: “@pinarocal: The article on \nhttp://splendidus.blogspot.com/search/label/javascript\nshould give you some hints. \nI would declare a variable and a set-function in the flex file. Then call the set-function from the javascript file with the data you want to pass on to flex.\nThe code in the article above works fine, so you only need to add some additional variables and functions to it.\n\nIf that doesn’t work for you, maybe you could post a detailed description of the exact problem?” - id: 7393 author: pinarocal author_email: [email protected] author_url: ‘’ date: ‘2010-04-30 15:19:00 +0530’ date_gmt: ‘2010-04-30 09:49:00 +0530’ content: “nlks, actually we have the same problem. have you found any solution to this? if yes, can you please explain to me?\nthanx in advance “ - id: 7395 author: pinarocal author_email: [email protected] author_url: ‘’ date: ‘2010-05-02 17:45:00 +0530’ date_gmt: ‘2010-05-02 12:15:00 +0530’ content: ‘actually i have managed interaction between flex and javascript. swf file works correctly. Now, there is a project about creating mozilla add-on. when swf file is embeded to this project, it does nothing ! i see swf is loaded but any changes that i make is not displayed correctly. i couldnt understand why it is not working when i combine it to add-on project while it works. i checked the paths, includes and everything ! ‘ ---
Update: I have updated the content of this entry after it was posted. John Dowdell(JD) pointed out some part of post which were confusing. I hope, it is clear now.
This is quite common question in Flash and Flex world. I had created JSFCommunicator library long back to facilitate JavaScript-Flash-JavaScript communication. But JSFC is supported in applications created via Macromedia Flash authoring tool, it is not straight forward to use it in Macromedia Flex applications. JSFC also has some issues in Firefox browser on MacOS. I am going to update it so that it works well on most of the browsers, operating systems and also in Macromedia Flex applications.
In flexcoders list, someone asked how to call a function in Flex app from Javascript, I wrote a simple example to show the technique. Following example is not a very OO approach, but it can easily be made more reusable by wrapping things into classes or creating a component.
JavaScript Code:
//this function return to Flash ActiveX Object or Plugin depending upon browser
//it takes care for browser type and returns the proper reference.
//Accepts the id or name of or tag respectively
//source taken from: www.moock.org
function thisMovie(movieName) {
// IE and Netscape refer to the movie object differently.
// This function returns the appropriate syntax depending on the browser.
if (navigator.appName.indexOf (“Microsoft”) !=-1) {
return window[movieName];
} else {
return window.document[movieName];
}
}
//success flag, set by flash/flex app
var bFunctionCallFinished = true;
//param delimiter, kind of unique string
var paramDelimiter = “–>\(###\)##$$<–”;
//this function would call a flash/flex function.
function callFlashFunction(functionName, paramsArray)
{
if(bFunctionCallFinished)
{
//Get the reference so activeX or Plugin. flexApp is id/name of OBJECT/EMBED tags
var flashObject = thisMovie(“flexApp”);
bFunctionCallFinished = false;
flashObject.SetVariable(“functionName”, functionName);
flashObject.SetVariable(“functionParams”, paramsArray.join(paramDelimiter));
flashObject.SetVariable(“commitFunctionCall”, true);
}
else
{
//if previous function call is still being run, you can use setTimeOut etc to call it little later…
}
}
Flex Code(main.mxml):\
//the name of the function to be called.
var functionName:String;
//the params delimited by paramDelimiter
var functionParams:String;
//param delemiter, kind of unique string
var paramDelimiter = "-->$$###$$##$$<--";
//setter, which executes the function and send the success flag back to javascript
public function set commitFunctionCall(flag:Boolean):Void
{
var func:Function = this[functionName];
func.apply(this, functionParams.split(paramDelimiter));
getURL("javascript:bFunctionCallFinished=true;void(0)");
}
function sayHi(name:String)
{
alert("Hi " + name);
_ta.text += name + newline;
}
function setNum()
{
var n = arguments.length;
for(var i=0;itext += arguments[i] + newline;
}
}
HTML Code:
//above JavaScript code goes here
Download the complete file from: http://www.abdulqabiz.com/blog/Flex_JSCommunication2.zip
Hope it’s useful for someone. Stay tuned, for new version JSFC library.
See complete post in flexcoder’s archive:
http://www.mail-archive.com/[email protected]/msg06106.html
27 Apr 2005
LEXINGTON, Mass., Apr 27, 2005 (BUSINESS WIRE) -- Segue Software (NASDAQ-SCM: SEGU), the leader in software quality optimization(TM) (SQO(TM)), today announced that SilkPerformer(R), Segue’s performance testing solution, provides support for Macromedia(R) (MACR) Flex(TM) 1.5 and the Action Message Format (AMF) protocol. With this announcement, Segue(R) extends the comprehensive range of enterprise technologies SilkPerformer already supports to the Flex environment. Macromedia Flex is the leading presentation-tier solution for delivering enterprise rich Internet applications.
More details here
So many good news coming up. This shows that Macromedia Flex is a standard in RIA development. Developers/Organizations have been requesting for testing tools to test Macromedia Flash/Flex applications. I think, It’s a good move by Seague, they would soon realize that their revenue is going up like anything :), I hope this happens so that other companies or vendors come ahead and start supporting Macromedia Flex/Flash.
27 Apr 2005
Someone on Flexcoders asked, if it’s possible to show vertical label or text like this:
S
H
O
P
P
I
N
G
I wrote a simple MXML VerticalLabel component. Yet another example which shows the power of MXML components.
1)VerticalLabelExample.mxml
2)VerticalLabel.mxml\
import mx.controls.Label;
import mx.controls.TextInput;
import mx.controls.Text;
var text:String;
var textField;
function createChildren():Void
{
var n = text.length;
textField = createChild(Label,"textField");
textField.styleName = this;
for(var i=0;i<n;i++)
{
textField.text+= text.charAt(i) + "\r";
}
}
26 Apr 2005
COPENHAGEN, Denmark - April 26, 2005 - SAP (NYSE: SAP) and Macromedia (NASDAQ: MACR) today announced they are extending SAP NetWeaver™ with the Macromedia Flex application framework to give organizations the ability to create rich interfaces for SAP® solutions, including customer-facing SAP® Enterprise Portal-based applications.
you can read complete news here.
This is indeed a great news.
20 Apr 2005
When someone comments on my blog, I make sure it’s not spam and then I allow comments to appear on my blog.
My blog is getting over thousand spam comments every week and while deleting such comments today, I deleted some of the genuine comments by Manish, David Urech, Dinesh and Gaurav. By mistake some checkboxes left checked while deleting commments...MT interface sucks :(
Guys, please don’t mind and keep commenting here. I am thinking of ways to stop this approval-kind-of-process and let comments appear as soon as they are posted.
Any suggestions and guidence to stop this comment spamming are welcome.
Thanks...
18 Apr 2005
Adobe is acquiring Macromedia.
Read more about it here , here and here.
08 Apr 2005
This is interesting to see that David Temkin of Laszlo Systems seems to be reading flexcoders posts. He posted the link of one of the flexcoders thread (Flex1.5 Price).
Frankly speaking, I had not followed that thread completely, I have been busy in work. But I am confident that this increase in price will not affect decision makers because Macromedia Flex is full of features and it is worth buying.
06 Apr 2005
ALT + A = 197
ALT + B = 166
ALT + C = 199
---
A = 65
B = 66
C = 67
Happy coding... - id: 5739 author: jorge author_email: [email protected] author_url: http://jgutierrez.wordpress.com/ date: ‘2009-08-07 01:09:14 +0530’ date_gmt: ‘2009-08-06 20:09:14 +0530’ content: “thank for the script ;) \r\nI use the script of zied and work correctly” - id: 7350 author: Prasad author_email: [email protected] author_url: ‘’ date: ‘2010-02-22 14:44:00 +0530’ date_gmt: ‘2010-02-22 09:14:00 +0530’ content: “Hi,\r\n Ihave tried the ZIED code, Its not working. Can any one help me. My Sample Code attached.\r\n\r\n\r\n\r\n\r\n\t\r\n\r\n” - id: 7353 author: perjabs author_email: [email protected] author_url: ‘’ date: ‘2010-02-24 18:07:00 +0530’ date_gmt: ‘2010-02-24 12:37:00 +0530’ content: “Hi, I am Prasad, I am trying to implement your code, But the CTRL F & CTRL S is not triggering. Code below and Let me know your feedback. I am Using sdk 3.3 & flash player 10.\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\r\n\r\n\t\r\n\r\n\t\r\n\r\n” - id: 7488 author: Rameshkaveti9 author_email: [email protected] author_url: ‘’ date: ‘2010-11-08 17:05:00 +0530’ date_gmt: ‘2010-11-08 11:35:00 +0530’ content: “Hello,\r\n i tried this one but it’s not getting the out put plz help me here is my code\r\n\r\nvar bCTRLPressed:Boolean = event.altKey;\r\n\t\t\t\r\n\r\n\t\t\tif( bCTRLPressed)\r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tvar curKeyCode:int = event.keyCode;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(curKeyCode==78)\r\n\t\t\t{\r\n\t\t\t\r\n\t\t\tModuleload(‘fooditem’,1);\r\n\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t}\r\nI am using Flex3 and flashplayer 10 “ ---
Again someone on flexcoders wanted to assign keyboard shortcuts for UI components/controls in his application. Following was my response with quick and dirty example..
Suppose you want to assign some keyboard shortcuts to each
control on screen so that when shortcut key is pressed, control gets
focussed and pressing enter/space execute associated action. For example, pressing space key while a button is focussed, would be broadcast button’s click event.
You can easily achieve this by using Key object, as demonstrated in code later.
I am assuming:
- user would press CTRL + 1, CTRL + 2 ...to focus a control on screen.
- user can press SPACE key to execute associated action with the controls
like Button, CheckBox, RadioButton or any button kind of component.
- user can use arrow keys to change values in list type of controls like
ComboBox
- user can type in textfield like control.…
Following example has some controls on screen and pressing CTRL + 1 .. CTRL\
- 5 shifts the focus to corresponding control.…
Following code is quick & dirty and just for demo, you can always write a ShortcutManager class in very OO way, which is more easier to use and managable...
###KeyObjectDemo.mxml###
var keyListener:Object;
function debugTrace(msg)
{
_ta.text+= msg + newline;
}
function initApp()
{
keyListener = new Object();
keyListener.onKeyDown = mx.utils.Delegate.create(this, mx.utils.Delegate.create(this,shorcutHandler));
Key.addListener(keyListener);
}
function shorcutHandler()
{
var bControlPressed:Boolean = Key.isDown(Key.CONTROL);
if(bControlPressed) {
if(Key.isDown(49)) { debugTrace("CTRL + 1");
my_input.setFocus();
}else if(Key.isDown(50)) { debugTrace("CTRL + 2");
my_btn.setFocus();
}else if(Key.isDown(51)) { debugTrace("CTRL + 3");
my_radio.setFocus();
}else if(Key.isDown(52)) { debugTrace("CTRL + 4");
my_check.setFocus();
}else if(Key.isDown(53)) { debugTrace("CTRL + 5");
my_combo.setFocus();
}
}
}
mx:Script>
Indiamx:String>
USAmx:String>
Australiamx:String>
mx:Array>
mx:dataProvider>
mx:ComboBox>
mx:VBox>
mx:Application>
06 Apr 2005
Someone on flexcoders asked about printing a Custom component using PrintJob.
I wrote a quick and dirty example. The idea is to create instance of component in main application, print it and delete it when printing is done.
##PrinJobExample.mxml###
[CDATA[
import Help;
var helpRef;
function testPrintJob():Void
{
helpRef= createChild(Help, "help");
//wait untill help is created & rendered completely...
helpRef.addEventListener("creationComplete",mx.utils.Delegate.create(this, printHelp));
}
function printHelp()
{
var printJob:PrintJob= new PrintJob();
printJob.start();
printJob.addPage(helpRef);
printJob.send();
delete printJob;
destroyChild(helpRef);
}
]]
##Help.mxml###
06 Apr 2005
It seems Macromedia Flash Player would have On2 Video Codec also. On2 Video Codec seems to be better than Sorenson’s.
http://biz.yahoo.com/prnews/050405/latu124.html?.v=5