Close a flex application using AS3
Hi everyone,
I am building a flex application using AS3, and I would like
to allow the user to close the application through a CLOSE button.
Do you know how can I do that ??
I traied with fscommand("quit"); but it dosen't work.
The rules are that UIComponent cannot be used in the download progress bar. You'll need to use really low level objects.
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui
Similar Messages
-
How to Play/Pause All for Adobe Air Application using AS3 in Flash CS4?
I am new to Flash and I'm creating an educational application in AS3 in Flash CS4 for Adobe Air. I want to use buttons to play and pause all content (movieclips AND sound).
I have created play and pause buttons that worked by switching the frame rate between 0 and 20, unfortunately I've realised that it's never really 0fps but rather 0.01fps and so it continues playing, albeit very very slowly. Also this doesn't affect the audio; I have set sound files to Stream which are synced to movieclips on their timelines, but even when the application is set to 0fps the audio continues.
Since I have various levels with numerous movieclips each with synced audio, what i'd like is to be able to do is pause absolutely everything within each movieclip with one button and to be able to resume from the same place using another button. Is this possible? If not, is there a global function to pause/resume the entire application/program?
Thanks in advance for your help!Its possible but you would need to tell each movieclip and audioclip to play/pause. You can create a for loop inside your mouse event function to find each movieclip and pause/play its timeline and a separate for loop for audio clips. Also instead of setting fame rate to 0 for pause just use a stop() command.
-
Control Flex application using presentation clicker
I am building an application using Flex and need the ability
to navigate through a "table of Contents" list using a presentation
clicker, similar to navigating through a powerpoint presentation. I
have been searching through the forum most of the day and haven't
come across any information.
Any help would be greately appreciated.
Thanks!This is not a support forum for Flex.
Try asking your question on FlexCoders:
http://tech.groups.yahoo.com/group/flexcoders/ -
Compiling flex application using ANT throws error
Hi i m tryin to compile my flex project using ANT, and i have used [Embed(source="/assets/images/inuse/phonering.png")] lot of places in my project. How can i solve this error. I have lot of swf file also for css.
Thanks in advance
RupamOK, I checked my build script and remember having this problem. I'm deploying a war file that contains some java EE and flex code. So my solutions does not apply to your case, but check out this blog post.
http://www.olocity.com/blogs/2009/05/13/adobe-flex-ant-builds/
Also this is probably helpful
http://www.mail-archive.com/[email protected]/msg123564.html//www.mail-archive.com/[email protected]/msg123564.html -
Login flex application using HTML page
Is it possible in flex
For example you click on a button in HTML and it redirect to flex applicationFlex applications sit in a HTML page. Just make your button link redirect to that page. It's no differrent to changing a HTML page because that's all you are doing.
-
Closing FLEX current application using AS
I use the following code to close the current application using Action Script and JavaScript:
var urlString:String = "javascript:window.opener = self; self.close();";
var request:URLRequest = new URLRequest(urlString);
navigateToURL(request, "_self");
Then I got the message: SecurityError: Error #2121: Security sandbox violation: navigateToURL
Is there a way to solve the problem or should I use another way to close the current application from AS.
Regards,I have try your code and I got the message:
Error: Error #2067: The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX, Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime.
at Error$/throwError()
at flash.external::ExternalInterface$/call()
at Maj_Temps_SouthShore_Desktop/keyPressed()[C:\Projets Développement Flex\Maj_Temps_SouthShore_Desktop\src\Maj_Temps_SouthShore_Desktop.mxml:215]
Regards, -
Trying to make a flex application scalable in its display size by using a "Host-swf" - Problem
We created a flex application using Flex 3. What we are
trying to do is to make this application scalable in its display
size. That means we want the application to scale itself to exactly
fit the size of the browser window without using a scrollbar like
normal Flash-swfs do. Sadly flex application don't scale like a
normal flash swf.
To get a workaround for this we created a so called
"Host-swf" with flash CS3. This Host-swf loads the flex application
and adds it as a child. And voila: When calling the Host-swf our
application can scale.
We used this code to achive this:
var oUrlRequest:URLRequest = new
URLRequest("Flex-Application.swf");
var oURLLoader:Loader = new Loader();
oURLLoader.load(oUrlRequest);
addChild(oURLLoader);
This works perfectly as long the browser window is larger
then the resolution of the host-swf (900*600) when calling the url
for the application:
Picture showing the
scaling
But it doesnt't work out when the browser window is smaller
than 900*600. The application is then shown with a scrollbar, and
when resizing the browser window the scrollbar is still there:
Picture showing the
application with scrollbar
Maybe anyone already tried to achive the same thing and has a
different solution for us?
Thank you in advance!"noby_95" <[email protected]> wrote in
message
news:gpsue6$rhh$[email protected]..
> We created a flex application using Flex 3. What we are
trying to do is to
> make
> this application scalable in its display size. That
means we want the
> application to scale itself to exactly fit the size of
the browser window
> without using a scrollbar like normal Flash-swfs do.
Sadly flex
> application
> don't scale like a normal flash swf.
>
> To get a workaround for this we created a so called
"Host-swf" with flash
> CS3.
> This Host-swf loads the flex application and adds it as
a child. And
> voila:
> When calling the Host-swf our application can scale.
>
> We used this code to achive this:
>
>
> --------------------------
> var oUrlRequest:URLRequest = new
URLRequest("Flex-Application.swf");
> var oURLLoader:Loader = new Loader();
> oURLLoader.load(oUrlRequest);
> addChild(oURLLoader);
>
>
> -------------------------
>
> This works perfectly as long the browser window is
larger then the
> resolution
> of the host-swf (900*600) when calling the url for the
application:
>
http://www.gansl-online.de/Bild1.jpg
>
> But it doesnt't work out when the browser window is
smaller than 900*600.
> The
> application is then shown with a scrollbar, and when
resizing the browser
> window the scrollbar is still there:
>
http://www.gansl-online.de/Bild2.jpg
>
> Maybe anyone already tried to achive the same thing and
has a different
> solution for us?
When I set the Application width and height to a percentage
number, it will
change its size based on the size of the window. -
Flex Application Not loading in case of using RSL.
If anyone can help, I release my Flex Application using RSL but now this appication is not loading on some system. I upload application.swf and framework_3.0.0.477.swz and also crossdomain.xml but application not uploading and getting error #2032.
Search the internet for solutions for that error.
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui -
Calling a FLEX application from html, using parameters
Hi guys,
I have this html:
<form name="getTracing" method="POST" action="http://syyzas400/ShipmentInquiry/ShipmentDetails.html">
QuickTrace
<input type="text" name="TrackNbr" size="14" tabindex="1" maxlength="11">
<br>
Carrier
<select name="Carrier" tabindex="2" style="background-color: #D8E4FF; color: black;
font-family: Arial; font-weight: bold; font-size: 9pt; width=114">
<option>Option1
<option>Option2
<option>Option3
</select>
As you can notice, there is an Input field ("TrackNbr") and a selection field ("Carrier") with three options... The user enters a Tracking Nbr.
in first field and chooses one of the three options from the second field and hits <enter>. In this moment, as you can see from "action" area, an html (part of a FLEX application) is called. The problem is that the parameters ("TrackNbr" and "Carrier") are not transmitted and I don't know how to do that.
This FLEX application accepts parameters using URL fragments technique (because could be called from another FLEX application, too)
but obviously this cannot work with the above described form.
I read about External Interface class, but everybody is talking about calling ActionScript functions, not FLEX applications. Being a newbie in this area,
I am sure I am missing something, but what?
Any help would be very appreciated, as usual...
FlorinProblem solved.
I got rid of the form tag (and "action", obviously); instead, I created a JavaScript function used for onClick event of the submit button. Inside this function, I captured the values (using getElementById method) of the input and select field and, using these values, I created the URL for my FLEX application (used with location.href property), and BAM! Everything works like a charm... I am even able to use the Back button to exit the FLEX app and return to the selection screen.
Now my question is, why does it work??? No complaints at all, just curiosity... I didn't use External Interface class, no exposed ActionScript functions prior calling frm JavaScript, no fancy stuff all sites I saw talking about...
Grizz..., I have a feeling that what you described above is a simpler and more advanced way to do about the same thing I did; am I right?
Thanks,
Florin -
How to deploy a Flex application (Server Type ColdFusion) to production
I have built a flex application using Flash Builder 4.6. It utilizes ColdFusion Flash Remoting for its data services. When first setting up the data services I had to set a bunch of properties in the flex server section. Which I am not sure are all correct but the app does run and connect to the data services. They were:
Application Server type: ColdFusion
Use remote object access service
ColdFusion flash remoting
Server Location:
Deployed to Java application server
Web Root: v:\inetpub\testFlex
Root URL: http://myDevServerIP/
ColdFusion Was folder: v:\CF9\JRun4\servers\testFlex\cfusion.ear\cfusion.war
My question is now when I'm ready to deploy to my production machine and load the app onto a tablet or other computer, obviously the Root URL will be different something like http://myLiveURL.com. Is this the only thing I change? Do I even change it here or is there some other location? Any other things I need to change?
Thanks!
Your help is much appreciated!All the paths to CFCs are the same in my live production site. Can you be more specific as to what you mean by "RemoteClass aliases in your AS Classes and CFCs (if any) are correct."? How will the app know that the CFC is on http://myLiveSite.com instead of http://myDevSite.com? The only line of code that I have noticed that points to a URL is the endpoint in a file called _Super_XXX.as. And at the top of that file it says that the file is not meant for editting.
To clarify...I see your app/code all exists on a server access via a web browser so I can understand that everything still works when deployed. Mine is a mobile app so when I am developing and testing on my local computer the URL points to my local development machine. However when I deploy it to a mobile device like a tablet and run the app, it needs to be able to access a cfc on a remote server via a different URL ie. my http://myLiveSite.com/myCFC.cfc instead of http://localhost/myCFC.cfc
Thanks for your help! I will now take a look at your thread.
Message was edited by: ace0215 -
Adobe Air+ Flex applications to build from database
Hi,
I know how to create a Flex application from database.But
when we are developing a flex application from database using Adobe
AIR,i'm not able to run the application.It is throwing an error
saying .xml file is missing.Can anyone help me out with
this?In Flex, an application can be created from database by
following the steps as follows:
STEP 1. Create a new Flex Project and name it as for example,
“FLEXDB”. Select the
application type as “Web Application (runs in Flash
Player)” and Application server type as
“ASP.Net”.
STEP 2. Go to Data->Create application from database.
Select the project as
FLEXDB”.Create a new Connection to SqlServer 2005 and
specify the database and name that connection
as”TestConn”. Then select any table (for example
DashboardRegion) from the list of tables and click
“Next” button.
STEP 3. Select the Server language as “C# with Web
Services”. Click “Finish”.
STEP 4. Then the following files and folders will be created
under the project “FLEXDB”
automatically.
• DashboardRegion.mxml -- is a design page.
• DashboardRegionScript.as -- defines web service
object and capture the results and assigns the results to the
corresponding UI Component.
• DashboardRegionConfig.as -- calls the Web Service
file.
• DashboardRegion.asmx -- calls the Class Files
(DashboardRegion.cs file).
• Web.config – defines the Connection string
• App_Code is a folder which contains the following
files
o DashboardRegion.cs that interacts with SQL Server 2005 and
return the results.
o TestConn.cs that defines connection to SQL Server 2005.
STEP 5. Run the application “DashboardRegion.mxml
”.We can see the Database results
Fetched and displayed in the corresponding UI Component in
the output.
Now we are trying to create a Similar Flex Application using
Adobe AIR.
For this, we have to follow similar steps mentioned as above
with a slight modification in STEP 1. It will be as follows:
STEP 1. Create a new Flex Project and name it as for
example, “FLEXDB”. Select the
application type as”Desktop Application (runs in Adobe
AIR)” and Application server type as “ASP.Net”.
The remaining steps are same as above.
When we try to run the application
“DashboardRegion.mxml”, it is throwing an error saying
“DashboardRegion-app.xml” file is missing. To solve
this issue we tried creating “DashboardRegion-app.xml”
file manually, the application is running but, again throwing an
error saying “Unable to load WSDL. If currently online,
please verify the URI and/or format of the WSDL
(../DashBoardRegion.asmx?wsdl)”.
Can any one please suggest a solution for this?
Or Help me how to connect sql server 2005 in the Adobe AIR
application that are buid using Flex builder. -
Regarding Flex application in Adobe Air
I> I developed a flex application using FLEX BUILDER3. My
main.mxml and background image file was under src directory in flex
project. There was a folder named history under which
index.template.html was present. I inserted the javascript code
inside this html file. I want to convert the same flex application
to a desktop application. So I created a new project as a desktop
app and copied the mxml file and background image file under the
src directoy of the project. I am not able to see a folder named
history. I dont know where and how to insert the javascript and
html code for creating desktop air application
> Also the backgroundimage file is not getting display in
the window. Not sure why is it so. I had inserted the JPEGThe ability to package Composite Applications in AIR is currently available
as a limited release, so if you are interested you will need to contact your
sales channel for more information.
The technology includes a library (mosaic-mxml.swc) that contains UI
Components that allow developers to control the loading and placement of
Tiles or entire AXML Applications within the AIR application. There are
samples and documentation available.
As for mobile, there is work underway to support Mobile AIR applications
scheduled for an upcoming release.
Matt -
Display & run a Flex Application in NW7
Hi @ all,
i´ve developed a FlexApplication to read the Bex Analyser favourites to a Flextree an now im trying to display this application in our NW7 portal. The application is connected to SAP throu a BSP-application.
With clicking one node of the tree i want to open an sapWorkbook with, for example tcode RRMXP and a WBID = xyz.
How to manage this problem?
In flex i have the workbookID and the transactionCode, but how to send them to SAPSystem and after that opening a workbook with excel?Hi Daniel,
You can Export content from flex application using JSP file on your N/W server also.
The Flow for this would be, collect the required content in HTML Table format string.
then pass this string as parameter to a JSP page which will open an excel sheet and copy your content to it.
You can also apply table formatting using usual html tags.
Plz find some code snippets for your reference :
Suppose on on click of node you have called for an method which is written in your ActionScript part of Flex Application.
viz. loadContentInExcel(para1,para2)
Definition for this method would be like :
private function loadContentInExcel(para1:String, para2:String):void {
//Pass the htmltable in a variable so that it can be delivered
//to the backend script
var variables:URLVariables = new URLVariables();
variables.htmltable = convertContentToHTMLTable(para1,para2);
//Setup a new request and make sure that we are
//sending the data through a post
var u:URLRequest = new URLRequest("http://XXX.XX.X.XXX:YYYYY/Test_Excel/main.jsp");
/* In Above Line Replace XXX.XX.X.XXX:YYYYY with <Host IP>:<Port> */
u.data = variables; //Pass the variables
u.method = URLRequestMethod.POST; //Don't forget that we need to send as POST
//Navigate to the script
navigateToURL(u);
private function convertContentToHTMLTable(para1:String, para2:String):String {
//Set default values
var font:String = 'ARIAL';
var size:String = '10';
var str:String = '';
var style:String = 'style="font-family:'+font+';font-size:'+size+'pt;"';
str = "<table border=1><tbody>";
str+="<tr width=\""+100+"\">";
str += "<td width=\""+100+"\" "+style+">"+"<B>"+"TransactionCode : "+"</B>"+"</td>";
str += "<td width=\""+100+"\" "+style+">"+para1+"</td>";
str += "</tr>";
str+="<tr width=\""+100+"\">";
str += "<td width=\""+100+"\" "+style+">"+"<B>"+"WorkbookID : "+"</B>"+"</td>";
str += "<td width=\""+100+"\" "+style+">"+para2+"</td>";
str += "</tr>";
str+="</tbody></table>";
return str;
In main.jsp page mention content type as application/vnd.ms-excel.
In body tag mention out.println(request.getParameter("htmltable").
Hope this will help you..
Regards,
Vivek -
Error # 1014 verifyError - flex application in Livcycle Workspace
Hi All
I have created a flex application using Flex SDK 3.4.1 to be incorporated in Adobe LiveCycle ES 2. My flex application is working fine, but when I lunch the flex application inside the Adobe LiveCycle Workspace, I got Error # 1014 VerifyError and the cause of this error is the use of flashx.textLayout.elements.TextFlow libaray.
Any help is really appriciated.
Best regards
KhaledThat explains it then. This example requires the ContentElement, which is only present in FlashPlayer 10 and later. The example should require that -- when the project is set up, it can specify the minimum Player version it requires. Then if you try to run it on an earlier Player you get a warning that the SWF can't load on this Player, and it tells the user what version number is required. Try installing FP10, and it should work.
-
Using AS3 and Python to access MSSQL
How could I implement Python to access a MSSQL database in a Flash application using AS3? Thanks!
you call and retrieve data via python using the urlloader class in flash.
Maybe you are looking for
-
Report for Purchases of a Material
Dear MM gurus Is there any standard SAP report for the following criteria? 1. Material code 2. Qty purchased and uom 3. Value 4. Taxes 5. Total Purchase value 6. Material type 7. Vendor 8. Material Receipt doc. Appreciate your quick answer. Thanks R
-
I just started with Verizon. At work, I like to text online and you can do this with their "integrated messaging" platform. However, my contacts aren't showing up. How do I get my contacts to show up? When I start typing in the "to" field, it doesn't
-
HT201269 Can't copy my contacts from NOKIA E6 to iPhone 5S Please help...
I am unable to copy my contacts from Nokia E6 to iPhone 5S. I am able to make a backup on Nokia PC Suit. But when opening iTunes it says thta contacts are being copied through iCloid Please help.
-
Envy 17 J160nr, windows 10 update
I am wondering about the upcoming Windows10 update coming in a few days. the compatibility check says everythign is ok/ready. But my question is, if i do upgrade to Windows 10, will i be able to roll back to Win8.1 if i don't like Win10?I assume s
-
Ipod not skipping songs in shuffle
I seem to have the opposite problem as most in the shuffle mode. I have marked all of my holiday songs to skip in shuffle mode, multiple times now, but a few songs continue to play when I hit Shuffle. Any ideas?