After a recent reinstallation of my computer I have encoutered a very frustrating and strange issue with JetBrains IntelliJ.
I have this line of code
this.path_.data.push(r.left, r.top, r.right, r.top, r.right, r.bottom, r.left, r.bottom);
And similar ones around my project.
path_ = new GraphicsPath(GraphicsUtil.QUAD_COMMANDS, new Vector.<Number>());
data inside of path_ is a Vector.<Number> but for some reason I am unable to use the function native AS3 function push(... rest):uint; on it. It just shows me this error
I have tried to find a solution to this issue for the past 6 hours and haven't found anything so far... Hoping anyone here might be able to give some assistance with this issue.
Note: This has never happened to me in the past.
I have looked into the declaration of push() and it points to my library.swf for everything except the code that uses GraphicsPath.data... That file seem to point to ECMAScript.js2 which doesn't contain anything for Vector Objects at all.
Related
I'm trying to package some code up as an ANE, something we've done before in house. However we're currently stuck on an ADT error which I can't seem to wrap my head around.
When running the following from a sh file, I'm getting an error.
Shell script:
ADT="/Applications/air/bin/adt"
NAME="VideoRoll"
AFILE="libVideoRollANE.a"
$ADT -package -target ane $NAME.ane extension.xml -swc $NAME.swc -platform iPhone-ARM -platformoptions platformoptions.xml library.swf $AFILE
Error:
platformoptions.xml is not part of a Mac OS X Native Extensions
framework
All of the files are in the correct place and being clearly picked up by adt, as I'd assume there would be something else I'd be getting back. If you're after the source code, it's an open source library on bitbucket that I've forked and made a couple of changes to. I'm trying to compile it with Adobe AIR SDK 20 to try and fix an issue we're getting but I'm struggling to just build it from the base source right now. The source can be found here: https://bitbucket.org/lostirc/videoroll/src .
Any suggestions would be great, I'm up for trying anything now. I've modified nearly everything I can think of and tried various different orders for the command, it seems if I remove the platformoptions flag and value, then it gives the same error about library.swf, so I'm not sure it's directly related to the platformoptions.xml.
I worked around the problem by running the same command on Windows. This isn't really a solution but a potential workaround for anyone having the same issue. If anyone can post a good answer then I'll accept that, but for now this is the best answer I've got.
I've been googling around for the past 2 hours looking for some simple instructions on how to add my own custom metadata tag in as3 with no success. I'm starting to think that I'm probably not searching for the correct terms.
The Problem
Ultimately, what I want to do is add a custom metadata on a function that takes a function as a parameter and makes sure that the given function has the correct parameters.
I.e. I have the following function:
public function testCallback(callback:Function):void
{
callback("test");
}
and I want to get a compiler error when I call it like this:
public function doNothing():void
{
// doing nothing
}
public function someRandomFunction():void
// ...
testCallback(doNothing);
}
The way I'm thinking of doing this is by having this metadata:
[Callback(paramName="callback",callbackParams="string")]
public function testCallback(callback:Function):void
{
callback("test");
}
The extension would run during compilation and, if the function passed does not contain the correct parameters, a compile-time error will be thrown. I THINK by using flex2.compiler.util.ThreadLocalToolkit.logError(path, line, errorMessage); I can accomplish this.
The Search
I've been googling for a couple of hours now and couldn't find a simple tutorial that could get me started. I found some SDK bug reports (SDK-18718, SDK-26041), an unfinished forum post, a tutorial (?) on how to add a custom metadata in FlexBuilder (I'm using FlashDevelop), a not-so-useful answer in StackOverflow and many many more dead ends.
The Help
So far, as far as I could understand, I will use Java to create the extension and then, using a compiler command, I'll add it into my project. However, I don't know what do I need to get started.
My two main questions are:
A) What do I need to create the extension in Java? (do I need Flex Builder? Eclipse? what libraries do I need in my classpath?)
B) Once I have compiled this into something (a swc?), how do I include this in FlashDevelop in my AS3 Project?
Thanks in advance!
Update
I've been able to create a Java project in eclipse, add the Flex libraries, implement the IMxmlcExtension interface and compile the project into a jar with the correct MANIFEST file. Unfortunately, adding the extra -extension=MyTest.jar in FlashDevelop, did nothing.
In case it is useful, the resulting command line for the compiler was
mxmlc -load-config+=obj\MyProject.xml -debug=true -incremental=true
-swf-version=10 -extension=flex_test.jar -o obj\MyProject634846490611881374
Update 2
Timofei Davydik helped me narrow down the problem. It seems that FlashDevelop is the main problem. Creating an extension and compiling it in command line works. I started a thread in FlashDeveloper's forums. In case you're interested, the thread is: -extension compiler option
Update 3
Pilippe is correct, it seems that the problem comes from the fact that FlashDevelop uses Flex Compiler SHell (fcsh). I am now looking into how can I switch compilers.
Really interesting question. I've done some research. Yes, we can write mxmlc extensions and add some custom functionality. But processing custom metadata is really complicated, and much time is needed debug and explore flex compiler sources. I've created a post in my blog about extensions, you can check it:
http://tim-davydik.blogspot.com/2012/09/flex-compiler-mxmlc-extensions-forcing.html
How to make meta-data tags work in Action Script
Timofei Davydik's wrote a quick and simple tutorial in his blog to answer my question, named Flex compiler mxmlc extensions. Forcing compiler language, and helped me a bunch to track down what is the problem (which is why I'm giving him the bounty). In his post, he is using Flash Builder and not FlashDevelop, which brings us to the answer of the next question:
How to program them using Flash Develop
Unfortunately, as Phillipe pointed out, for AS3 projects, FlashDevelop uses the Flex Compiler SHell (FCSH), which doesn't support meta-data. Since FlashDevelop is open-source, I'll try (and probably fail) to switch the compiler for testing purposes. For anybody else interested in this, I think this forum post is a good start: [ GIFT ] Try new AS3 compiler (ASC 2.0) in flashDevelop 4.x
Hey there quick question,
The auto-completion in FD started to do something weird.
Usually when you type
var position:Point
FD simply had the game.geom path in the Imports.
In one of my class when I type that it autocomplete with
var position:flash.geom.Point
everywhere. And does the same with the Rectangle class.
I had that kind of behavior when there was two classes with the same name (ambiguous call) but I don't have that problem here.
If someone have an idea ?
Many thanks
EDIT
Found the issue ...
I had a variable called "flash"
var flash:Blink;
So ambiguous call indeed.
I have had this happen once when I added a swc to my project which had the same classes as the sdk which was setup for Flash Develop.
I would make sure you are not referencing any other swc or sdk which may have duplicates of these classes.
Failing that I'd probably backup my user settings and do a reinstall.
I'm having a very strange bug in Flex Builder where none of the changes I make are appearing when I debug/run my program. It only happens with a particular AS3 project, on others, it works fine.
For example, I have a line,var x:int = this.prevX + this.x;, whose value is 400 if I don't make any changes. I change the line to var x:int = 0; and set a breakpoint on the line. When I debug the program, it breakpoints just where it should, but the value is set to 400, even when the line is x = 0! What gives!
I've tried cleaning the project and deleting the project and re-importing it. No matter what I do, it won't show any changes I make, even if I just toggle a boolean. It still won't let me compile with errors, but once its done compiling, it completely ignore whatever changes I made. It's like it has the bytecode for the swf cached somewhere and its just ignoring doing the actual build step.
Any ideas?
Check if you have a copy of the swf in the html-template folder. The newly compiled swf will be overwritten by that old one after each build. Happened to me once.
Right click the project in the Flex Navigator and then click Refresh. Refreshing the project worked for me.
Changing from IE to Chrome worked for me.
I was having trouble with this as well, and deleting the html-template folder didn't fix the problem for me. I then renamed the project and it worked after that.
I get this too.
This is the first time I've found this referenced on the net. It's a BIG problem. I get it periodically. For me, it's not the html-template folder.
I've got a couple of ways around the problem at the moment
Delete the bin-debug swf
Overwrite it with a release build.
Delete the release swf
Export the release build elsewhere.
Build a debug version again.
This works - sometimes immediately sometimes after a few repetitions.
One other technique I tried today was to change the compiler options to -dump-config=somefile.
This worked immediately, however, I'll need to wait next time to try again.
It might be a situation of changing the -dump-config filename output when this happens.
Just tried another possible fix (which seems to be working really well) - Change the browser that Flex builder is using to a different one. This immediately fixed the problem. I'll post back here later if I find that this is a reliable fix. - Casp
I tried everything but no success.I am having big problems in importing files.So many error.... spent 5 hours but nothing. I successfully able to create project using collada parser but all the problems are coming when i am using import org.papervision3d.objects.parsers.DAE; There were some files missing and when i tried to download the missing files then it is showing me errors in files that i downloaded. Please suggest me how to get solve it.I wonder w'd it be possible for anyone to upload the configuration of papervision+libspark+ascollada which you used for creating a demo(like Brian Hodge used). Thanks alot in advance.And i am extremely sorry for posting this question in a thread AS3 DAE Augmented Reality PaperVision 3D as an answere.I am new to this forum and havent noticed the question tag.Extremely sorry...
The following is a link to a rather large explanation on PV3D/Flar toolkit AR
AS3 DAE Augmented Reality PaperVision 3D
-Questions
What IDE are you developing in? Flex Builder 3, Flash Develop, and Flash CS4 are all capable of handling embeds utilizing the Flex 3 SDK, BUT, Adobe Flash CS3 does not allow you to used embed and will not recognize it.
-Flash CS3 produces the following
TypeError: Error #1007: Instantiation attempted on a non-constructor.
at Untitled_fla::MainTimeline/Untitled_fla::frame1()
-The Following works in all the others listed above
[Embed(source="foo.jpg")] //<--- NO SEMICOLON OR BREAKS
private var foo:Class;
var testFoo:Bitmap = new foo();
-Important
One thing that I would like to note, notice there is no semicolon on the embed line!
Hope this helps, apparently the original poster figured his/her problem out, but wanted to answer sid.