You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by PKumar <pr...@gmail.com> on 2016/02/28 06:04:26 UTC
FlexJS: FileUploader Control
I am trying to create a file control using FlexJS. I write below mentioned
code but it is not compiling. getting lots of error. can any one check &
provide suggestion?
package comp
{
import flash.events.IEventDispatcher;
import org.apache.flex.core.IStrand;
import org.apache.flex.core.IUIBase;
COMPILE::JS
{
import org.apache.flex.core.UIBase;
import org.apache.flex.core.WrappedHTMLElement;
}
COMPILE::JS
public class FileUploader extends UIBase implements IStrand,
IEventDispatcher, IUIBase
{
public function FileUploader()
{
super();
}
override protected function createElement():WrappedHTMLElement
{
element = document.createElement('input') as WrappedHTMLElement;
element.setAttribute('type', 'file');
positioner = element;
positioner.style.position = 'relative';
element.flexjs_wrapper = this;
return element;
}
}
}
*E:\FlexWorkspace47\FlexJSLib\src\comp\FileUploader.as:8
Can not resolve config constant: 'JS'
COMPILE::JS
^
E:\FlexWorkspace47\FlexJSLib\src\comp\FileUploader.as:14
Access of possibly undefined property COMPILE.
COMPILE::JS
^
E:\FlexWorkspace47\FlexJSLib\src\comp\FileUploader.as:15
The definition of base class UIBase was not found.
public class FileUploader extends UIBase implements IStrand,
IEventDispatcher, IUIBase*
-----
Prashant
Sr. Product Specialist, Sungard
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-FileUploader-Control-tp12072.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: FlexJS: FileUploader Control
Posted by Alex Harui <ah...@adobe.com>.
On 3/10/16, 10:58 PM, "PKumar" <pr...@gmail.com> wrote:
>It is not working. When i am compiling my library with FalconJX(Compc)
>then i
>am getting "FileUploader.js" file inside "comp" folder. I am not aware how
>can i use this js?
There are at least 3 ways to use this comp/FileUploader.js in your test
application.
1) Follow the patterns used by the other framework swcs to run Ant builder
from Flash Builder to inject the .js files into the SWC.
2) Copy the .js file into the FlexJS SDK's frameworks/js/FlexJS/src as
comp/FileUploader.js. You may need to create the subdirectories yourself
3) Make a copy of the run configuration and add -sdk-js-lib=<path to
parent of comp folder>
HTH,
-Alex
Re: FlexJS: FileUploader Control
Posted by PKumar <pr...@gmail.com>.
It is not working. When i am compiling my library with FalconJX(Compc) then i
am getting "FileUploader.js" file inside "comp" folder. I am not aware how
can i use this js? I also unzipped the swc and checked the catalog.xml. If
you want to see "catalog.xml", please let me know.
-----
Regards,
Prashant
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-FileUploader-Control-tp12072p12196.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: FlexJS: FileUploader Control
Posted by Alex Harui <ah...@adobe.com>.
I assume you are using "FileUploader" and not "fileUploader" as the
component name.
Next step is to unzip the swc and check the catalog.xml.
In the test application, what code is referencing this component? It
looks like it is in the "comp" package so AS code must import
comp.FileUploader. I didn't notice a manifest.xml file which is usually
needed to use a prefix in MXML, otherwise you need to do something like
xmlns:comp="comp.*"
-Alex
On 3/5/16, 10:31 PM, "PKumar" <pr...@gmail.com> wrote:
>I used the additional compiler arguments and code compiles perfectly. But
>"fileUploader" is not found inside the swc, when i am using swc with
>other
>application, as generally we use any swc in FlexSDK. Here i am attaching
>the
>settings screen shot. Please check & suggest.
>
><http://apache-flex-users.2333346.n4.nabble.com/file/n12130/Capture1.jpg>
><http://apache-flex-users.2333346.n4.nabble.com/file/n12130/Capture2.jpg>
>
>
>
>
>
>-----
>Regards,
>Prashant
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/FlexJS-FileUploader-Control
>-tp12072p12130.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: FlexJS: FileUploader Control
Posted by PKumar <pr...@gmail.com>.
I used the additional compiler arguments and code compiles perfectly. But
"fileUploader" is not found inside the swc, when i am using swc with other
application, as generally we use any swc in FlexSDK. Here i am attaching the
settings screen shot. Please check & suggest.
<http://apache-flex-users.2333346.n4.nabble.com/file/n12130/Capture1.jpg>
<http://apache-flex-users.2333346.n4.nabble.com/file/n12130/Capture2.jpg>
-----
Regards,
Prashant
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-FileUploader-Control-tp12072p12130.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: FlexJS: FileUploader Control
Posted by Alex Harui <ah...@adobe.com>.
In my FB projects, the .actionScriptProperties file's
additionalCompilerArguments looks like this:
additionalCompilerArguments="-locale
en_US -define=COMPILE::AS3,true -define=COMPILE::JS,false
"
Or this:
additionalCompilerArguments="-locale
en_US -define=COMPILE::AS3,true -define=COMPILE::JS,false -load
-config=../resources/compile-config.xml"
Shut down Flash Builder before changing these files.
-Alex
On 3/3/16, 8:28 AM, "PKumar" <pr...@gmail.com> wrote:
>Here I am attaching the file that were asking about. Please check.
>.actionScriptProperties
><http://apache-flex-users.2333346.n4.nabble.com/file/n12119/.actionScriptP
>roperties>
>.flexLibProperties
><http://apache-flex-users.2333346.n4.nabble.com/file/n12119/.flexLibProper
>ties>
>.project
><http://apache-flex-users.2333346.n4.nabble.com/file/n12119/.project>
>
>
>
>-----
>Prashant
>Sr. Product Specialist, Sungard
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/FlexJS-FileUploader-Control
>-tp12072p12119.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: FlexJS: FileUploader Control
Posted by PKumar <pr...@gmail.com>.
Here I am attaching the file that were asking about. Please check.
.actionScriptProperties
<http://apache-flex-users.2333346.n4.nabble.com/file/n12119/.actionScriptProperties>
.flexLibProperties
<http://apache-flex-users.2333346.n4.nabble.com/file/n12119/.flexLibProperties>
.project
<http://apache-flex-users.2333346.n4.nabble.com/file/n12119/.project>
-----
Prashant
Sr. Product Specialist, Sungard
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-FileUploader-Control-tp12072p12119.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: FlexJS: FileUploader Control
Posted by Alex Harui <ah...@adobe.com>.
Hmm. So what do you have for additional compiler arguments in project
properties?
You could open a JIRA so we have a place for you to attach files and
attach your .project, .flexlibProperties and .actionScriptProperties files.
-Alex
On 3/2/16, 12:30 AM, "PKumar" <pr...@gmail.com> wrote:
>I did not run ANT on flexJS source. But i am using FlexJS 0.5.0 binary
>version and core.swc & couple of others swc already present in my library
>build path. Still i am getting these errors.
>
>
>
>-----
>Prashant
>Sr. Product Specialist, Sungard
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/FlexJS-FileUploader-Control
>-tp12072p12108.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: FlexJS: FileUploader Control
Posted by PKumar <pr...@gmail.com>.
I did not run ANT on flexJS source. But i am using FlexJS 0.5.0 binary
version and core.swc & couple of others swc already present in my library
build path. Still i am getting these errors.
-----
Prashant
Sr. Product Specialist, Sungard
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-FileUploader-Control-tp12072p12108.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: FlexJS: FileUploader Control
Posted by Peter Ent <pe...@adobe.com>.
I think I spoke too soon. The Storage project for FlexJS is really about
"permanent" file storage: reading and writing bytes, not uploading. So if
I were to do this, it would be at some point in the future. What we can do
is help you along to get your idea working, which as far as I can tell, is
on the right path.
Have you tried what Alex suggested?
Regards,
Peter
On 2/28/16, 10:41 AM, "Peter Ent" <pe...@adobe.com> wrote:
>I'm working on a Storage project for FlexJS which includes local storage
>(web storage/Flash Shared Object) as well as more permanent file storage
>via AIR File and Cordova File plugin. I will try to work in the File
>uploading aspect as well.
>
>‹Peter Ent
>Adobe Systems/Apache Flex Project
>
>On 2/28/16, 1:16 AM, "Alex Harui" <ah...@adobe.com> wrote:
>
>>
>>
>>On 2/27/16, 9:04 PM, "PKumar" <pr...@gmail.com> wrote:
>>>
>>>
>>>*E:\FlexWorkspace47\FlexJSLib\src\comp\FileUploader.as:8
>>>Can not resolve config constant: 'JS'
>>> COMPILE::JS
>>> ^
>>>
>>>E:\FlexWorkspace47\FlexJSLib\src\comp\FileUploader.as:14
>>>Access of possibly undefined property COMPILE.
>>> COMPILE::JS
>>> ^
>>
>>In Project menu, Properties, Flex Library Compiler, make sure you have
>>specified as additional arguments:
>> -define=COMPILE::JS,true -define=COMPILE::AS3,false
>>
>>>
>>>E:\FlexWorkspace47\FlexJSLib\src\comp\FileUploader.as:15
>>>The definition of base class UIBase was not found.
>>> public class FileUploader extends UIBase implements IStrand,
>>>IEventDispatcher, IUIBase*
>>
>>Do you have the source code from the flex-asjs repo? Try running "ant"
>>in
>>the root of that working copy. It should build a set of swcs in
>>frameworks/externs like Core.swc, and you want to include that SWC in
>>your
>>Library Path.
>>
>>I guess the nightly build should package those SWCs to make it easier for
>>folks to create JS code for their own SWCs.
>>
>>Thanks,
>>-Alex
>>
>
Re: FlexJS: FileUploader Control
Posted by Peter Ent <pe...@adobe.com>.
I'm working on a Storage project for FlexJS which includes local storage
(web storage/Flash Shared Object) as well as more permanent file storage
via AIR File and Cordova File plugin. I will try to work in the File
uploading aspect as well.
‹Peter Ent
Adobe Systems/Apache Flex Project
On 2/28/16, 1:16 AM, "Alex Harui" <ah...@adobe.com> wrote:
>
>
>On 2/27/16, 9:04 PM, "PKumar" <pr...@gmail.com> wrote:
>>
>>
>>*E:\FlexWorkspace47\FlexJSLib\src\comp\FileUploader.as:8
>>Can not resolve config constant: 'JS'
>> COMPILE::JS
>> ^
>>
>>E:\FlexWorkspace47\FlexJSLib\src\comp\FileUploader.as:14
>>Access of possibly undefined property COMPILE.
>> COMPILE::JS
>> ^
>
>In Project menu, Properties, Flex Library Compiler, make sure you have
>specified as additional arguments:
> -define=COMPILE::JS,true -define=COMPILE::AS3,false
>
>>
>>E:\FlexWorkspace47\FlexJSLib\src\comp\FileUploader.as:15
>>The definition of base class UIBase was not found.
>> public class FileUploader extends UIBase implements IStrand,
>>IEventDispatcher, IUIBase*
>
>Do you have the source code from the flex-asjs repo? Try running "ant" in
>the root of that working copy. It should build a set of swcs in
>frameworks/externs like Core.swc, and you want to include that SWC in your
>Library Path.
>
>I guess the nightly build should package those SWCs to make it easier for
>folks to create JS code for their own SWCs.
>
>Thanks,
>-Alex
>
Re: FlexJS: FileUploader Control
Posted by Alex Harui <ah...@adobe.com>.
On 2/27/16, 9:04 PM, "PKumar" <pr...@gmail.com> wrote:
>
>
>*E:\FlexWorkspace47\FlexJSLib\src\comp\FileUploader.as:8
>Can not resolve config constant: 'JS'
> COMPILE::JS
> ^
>
>E:\FlexWorkspace47\FlexJSLib\src\comp\FileUploader.as:14
>Access of possibly undefined property COMPILE.
> COMPILE::JS
> ^
In Project menu, Properties, Flex Library Compiler, make sure you have
specified as additional arguments:
-define=COMPILE::JS,true -define=COMPILE::AS3,false
>
>E:\FlexWorkspace47\FlexJSLib\src\comp\FileUploader.as:15
>The definition of base class UIBase was not found.
> public class FileUploader extends UIBase implements IStrand,
>IEventDispatcher, IUIBase*
Do you have the source code from the flex-asjs repo? Try running "ant" in
the root of that working copy. It should build a set of swcs in
frameworks/externs like Core.swc, and you want to include that SWC in your
Library Path.
I guess the nightly build should package those SWCs to make it easier for
folks to create JS code for their own SWCs.
Thanks,
-Alex