Flex HTTPService Progressbar - apache-flex

How can I set a progress bar that may start when an HTTPService is sent and stop when the HTTPService ends?
I followed code given here but encountered following error:
Type was not found or was not a
compile-time constant: ProgressWin.
Don't know whether ProgressWin.mxml is a component or module or what. I just created a new ProgressWin.mxml file and pasted the code you posted but following error popped out before
<mx:TitleWindow xmlns:mx=" http://www.adobe.com/2006/mxml" width="250" height="150" title="Progressive Window">
Error:
Could not resolve to
a component implementation.

It appears that there is an extra space before each URL in the sample code. For example:
<mx:TitleWindow xmlns:mx=" http://www.adobe.com/2006/mxml" width="250" height="150" title="Progressive Window">
should be
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" width="250" height="150" title="Progressive Window">

Related

Cannot write accents in TextInput

i'm doing the maintenance of a flex application and i have a form to create new items:
<mx:FormItem id="frmName"
width="100%"
label="{Translate.getInstance().translateWords.name}"
required.edit="true"
required.new="true"
required.view="false">
<s:Label id="name_l"
width="100%" height="23"
text="{ myProgramVO.program_name }"
maxDisplayedLines="0"
lineBreak="toFit"
includeIn="view"/>
<s:TextInput id="name_ti"
width="100%" height="23"
maxChars="100"
maxChars.edit="100"
maxChars.new="100"
text="{ myProgramVO.program_name }"
includeIn="edit,new"/>
</mx:FormItem>
I don't know why, but i cannot write characters with accents when i'm creating a new program, but i can when i'm editing a program. And does not seem an unicode problem because i can type ñ without any problem.
The mxml file has <?xml version="1.0" encoding="utf-8"?> and the file is the same for item edition.
Can somebody guide me in the right direction?
PS: If anybody needs more code just ask for it and i'll paste in pastebin or something
After some research, it seems that there's nothing wrong with my code, it seem a problem with focus when mix html and swf.
When i try to create a new program, i need to mix html and flex, but when i edit the program there's no html code, and works well.
I got the problem only in linux (flash version 11.2), in windows (version 11.8) works perfectly, so seems a problem has been fixed
Thanks anyway guys :)

How to Import FileReference and FileSystemTree to ActionScript

I tried to insert a FileSystemTree in Flex .
Flash Builder doesn't recognise that and produces the error:
1046: Type was not found or was not a compile-time constant: FileSystemTree
Here's the code . It's a very basic one ....
<mx:HDividedBox width="100%" height="725" paddingLeft="10" paddingRight="10" paddingBottom="10" paddingTop="10" y="41">
<mx:VBox width="200" height="100%">
<mx:FileSystemTree id="fileSystemTree" width="100%" height="100%" change="onChange(event)" />
</mx:VBox>
<mx:Canvas width="100%" height="100%" id="content" ></mx:Canvas>
</mx:HDividedBox>
I'm using Flex 4 , Flash Builder 4. What am i doing wrong ? Is FileSystemTree supported in Flex 4 ?
That component is only available within Adobe AIR applications, not browser-based Flex applications, since browsing the local file system would violate the browser sandbox.
EDIT: Now that I understand your intention, yes, you can upload files from a flex application without having to use AIR. Instead of using the FileSystemTree component (which is AIR only), you use FileReference.browse() to allow the user to select a file from the local filesystem to upload. This page from the documentation will give you all the info you need: Working with file upload and download
Hope that helps.

Classes must not be nested - MXML

I'm trying to build a simple FLEX application. Unfortunately, I get '1131: Classes must not be nested.' errors even with the simples MXML .... the error pops out at the mx:Application openning tag:
(I'm using PureMVC if it's important)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:view="icm.view.components.*"
viewSourceURL="srcview/index.html"
name="ICM"
layout="absolute"
> //FLEX BUILDER SAYS THE ERROR IS HERE
<mx:Script>
<![CDATA[
import mx.effects.easing.Exponential;
import icm.ApplicationFacade;
public static const NAME:String = "AppSkeleton";
private var facade:ApplicationFacade = ApplicationFacade.getInstance(NAME);
]]>
</mx:Script>
<mx:Move id="slideInEffect" yFrom="5000" easingFunction="{Exponential.easeOut}" duration="1300"/>
<mx:Fade id="fadeOut" duration="1000" alphaFrom="1.0" alphaTo="0.0"/>
<mx:Fade id="fadeIn" duration="1000" alphaFrom="0.0" alphaTo="1.0"/>
<mx:Style source="css/yflexskin.css" />
<mx:Canvas id="mainViewStack" left="0" top="0" right="0" bottom="0" >
<mx:ViewStack id="vwStack" left="0" top="0" right="0" bottom="0" resizeToContent="false" creationPolicy="auto">
<mx:VBox />
<view:SplashScreen id="splashScreen" showEffect="{slideInEffect}" hideEffect="{fadeOut}" />
<view:LoginScreen id="loginScreen" showEffect="{fadeIn}" />
<view:MainScreen id="mainScreen" showEffect="{fadeIn}" />
</mx:ViewStack>
</mx:Canvas>
</mx:Application>
Can someone help me understand why? I've being doing a lot of non-sense tests because I'm not understanding it.
Sometimes if I remove the Script section the compilation suceed, others not.
Thanks
Thank you all for the comments.
The greatest tip at this topic is: build with the SDK!!!
Flex Builder (both, the IDE and the Plugin) seems to lack a lot of features on error treatment and even when it reports an error it's not reliable.
A prompt window for compiling used with the IDE saved me a lot of headaches.
Thank you all again!
I had this problem using a compiler option to exclude/include some code
like -define+=CONFIG::myOption,true
when the option is true (resulting including some code), and you have such thing into your code :
CONFIG::myOption {
import <a package>;
}
this will result in a 1131 error... I have no workaround but not using such conditional compilation directives.
There is a flex compiler option "Enable Strict type checking" just de-select it. I think that can give so a simple solution....
http://blog.gigantt.com/2011/02/how-to-build-flex-sdk.html
Building
Let's create a batch file to set some useful envars: envars.bat
set JAVA_HOME=c:\Program Files\Java\jdk1.6.0_23
set PATH=c:\dev\ant\bin;%PATH%
set ANT_OPTS=-Xmx256m
Open cmd.exe and run it...
Edit c:\dev\sdk\frameworks\build.xml
Look for:
And fix the location of the manifest file from:
"${datavis.dir}/manifest.xml" to:
"${datavis.dir}/manifest_datavisualization.xml"
Run Ant:c:\dev\sdk\frameworks> ant
It should end with such a message: BUILD SUCCESSFUL
Now let's tell Flash Builder where to find this new SDK: c:\dev\sdk
Add it to the "Installed SDKs" settings in Flash Builder
Make sure your project is configured to use this SDK (it was probably created with the original one and still refers to it).
Rebuild your project. It should work.

mx:MediaPlayback Flex tag

I'm trying to compile gui/flex/songs.mxml in the fourth edition of Bruce Eckel's Thinking in Java book and am getting a compilation error with Flex 3.4.
Here is a simplified version of the example that gives the same error:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
backgroundColor="#B9CAD2">
<mx:MediaPlayback id="songPlayer"
contentPath=""
mediaType="MP3"
height="70"
width="230"
controllerPolicy="on"
autoPlay="false"
visible="false" />
</mx:Application>
Here is the invocation and the error:
>mxmlc.exe songs.mxml
Loading configuration file C:\javaTools\flex_sdk_3.4\frameworks\flex-config.xml
C:\songs.mxml(5):
Error: Could not resolve <mx:MediaPlayback> to a component implementation.
<mx:MediaPlayback id="songPlayer"
What am I doing wrong here?
That component is no longer available in flex, i believe since flex 3.0. There is a video display component built in but you have to set up the controls for it. If you want a more complete pre-built component you need to import one from flash. heres a good tutorial from adobe on how to do that - http://www.adobe.com/devnet/flex/articles/video_flex.html

Displaying video in Flex

I am new to FLEX and I am planning to display video on web page.My mxml code is below
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">
<mx:Array id="movieList">
<mx:String>http://localhost/Flex/Butterfly.flv</mx:String>
</mx:Array>
<mx:VBox>
<mx:List id="cntlMovie" dataProvider="{movieList}" width="300" />
<mx:Button label="Pause" click="cntlDisp.pause();" />
<mx:Button label="Play" click="cntlDisp.play();" />
</mx:VBox>
<mx:VideoDisplay id="cntlDisp" source="{cntlMovie.selectedItem.valueOf()}"
width="400" height="300" />
</mx:Application>
I am running Apache2.2.11 server.
When I run the above code, the browser just hangs(does not respond).
When the video url(http://localhost/Flex/Butterfly.flv) is directly accessed, it prompts to download the video file.
Could someone provide some help on this.
Install Charles and monitor the request (you might need to use your computer name instead of localhost). Is the request coming through to the server? What's the response status code?

Resources