When I hit F11 I'm getting this message: File not found: flashplayer. No
more explanations given. Any ideas of what went wrong? (I'm on Linux, and of
course I have flash player...)
Ah, sorry, it seems like the problem is I'm on x86_64, and there is no
standalone debugger for that... how strange... Anyways, does anyone have an
idea on how to make 32-bit standalone debugger work on 64 bit Linux?
Ant generally requires only JRE (some extensions may require other things,
but, if you have Flex / Flash Builder, chances are you already have JRE).
Both your variants are... strange... you use literal and create a new object
by passing it an already created object...
var xml:XML = foo{bar}/foo;
This is how you'd normally do it. E4X uses couple of special opcodes
allocated only for it, so, my guess that using E4X expressions for
constructing
I believe it's somewhere in the context menu of the file in the project
view. It should say something like Copy to output folder. Sorry, I don't
have FB at this machine atm. Could be the assets weren't embedded originally
and this setting suck to them since they were loaded at runtime?
If you make the class bindable, the compiler will extend it from
EventDispatcher, or implement IEventDispatcher, this means you can use all
event dispatcher methods in that class. However, making a class bindable
isn't the best coding practice, I'd rather do it by hand, it' be a more
obvious code.
The definition for Sprite is in playerglobals.swc. However, you are asking
wrong question. You cannot compile an AS3 project w/o SDK, or you would need
at least an alternative compiler, and only one that exists is the one
developed by SWFTools few years ago. But it's outdated now... so,
You need to package the application using ADT, and launch it for testing
using ADL. AIR runtime is different from player and it has more classes, one
of them is NativeApplication. Player doesn't have that, so, you cannot run
the SWF compiled for AIR in the player because some classes won't be
{sdk}/frameworks/libs/air
look there for swc files. airglobal.swc is the must, all the rest are
optional, or so I think.
You shouldn't send sensitive data to begin with, you need to calculate it on
server and call saveHighScore() without parameters, so only server will know
what the score was. No matter what your client technology is, the client
cannot be trusted.
http://bugs.adobe.com/jira/secure/QuickSearch.jspa
By the way, while you are on it... sometimes the window opened by
FileReference isn't modal, Flash will also not dispatch key release events
after the dialog box appears... I hadn't have the time to post these :)
(Make sure it wasn't posted
@id must be a simple identifier, it's the same as variable name in AS3. What
you can do though is like this: add creationComplete handler to the
repeating components and collect them into vector / array / dictionary /
etc, whatever suites you better. Something like this:
mx:Array id=labels/
mx:Array id=labels/
mx:Repeater id=rp dataProvider={[0, 1, 2, 3]}
mx:Label
mx:creationComplete
var event:Event = arguments[0] as Event;
this.labels.push(event.currentTarget);
/mx:creationComplete
/mx:Label
/mx:Repeater
* Sorry, incorrect opening and closing tags.
Exactly, what Gk said.
You can make it difficult to forge the data on client, but you cannot 100%
prevent it from being cracked, so, better, keep the score on the server.
Remove the single quotes and put the brackets around the entire expression.
You cannot bind to function arguments, not in that way for sure.
Better yet, don't use binding:
mx:LinkButton label=more enabled=true themeColor=#FF2A00
mx:click
navigateToURL(new URLRequest(data.link));
Claudiu:
That's exactly what my code does...
Gustavo:
Read what the error says. You are trying to coerce String to URLRequest. Of
course you cannot do it. The code from the first example should work. If it
didn't, what was the problem?
Hey, np, sleep more, work less - profit! ;)
Despite this whole FP issue coming back into fashion in the last years,
there's really no use for that in ECMAScript-like languages. Every piece of
code you can write using nested functions can be rewritten in a way that no
nested functions will be used and the program will work better.
I'm not
You cannot really have custom types in AS3 or any other ECMAScript language.
I'd go for a class with 2 fields for integer and string.
The one that comes with this SDK: 4.0.0.14159 (this is what was released
with Flash Builder 4).
I've compiled from trunk (it has revision 17228), and the DimensionEvent is
still there, in the osfm.swc, check the catalog.xml line 957.
Did you try to change the order they are included?
OK, I've just checked and DimensionEvent is compiled into osmf.swc, so, my
guess is that you need to include that library too. The dependency is made
through VideoDisplay spark component, however, you cannot avoid making that
dependency, it's introduced in the generated code.
If I can guess, then, probably you've loaded the SWF into the same domain,
and if the URLs were relative to the loaded SWF they become relative to the
loading SWF. Does it make sense?
When you embed an image, the path is resolved relative to the file, where
you put the Embed meta. If you load it, the path is resolved relatively to
the file that loads an image.
Julian. That's really not so relevant... if you embed an image, the image
goes inside SWF, when you load it, it remains outside of the SWF, just lives
somewhere on the HD. When loading, the way you load a SWF may affect the how
the player will resolve relative URLs. I believe, that if the SWF is
Load them and draw to a single bitmapdata and then unload? Anyways, just out
of curiosity, what kind of application would need to display that many
images at once?
Just have one Loader and one Bitmap (or probably 16 or about that number in
the second case). When you handle the load complete you get the loader's
content and draw it to the bitmapdata, remember where it was the last time,
load next image, draw again and so on... However it will work, I would
That's not a call, that's an import. You are missing sources or SWC in your
project.
Do you expect value.item to be an XML with a single root node? If so,
trace() isn't going to print out the contents of that node. Use
trace(value.item.toXMLString()) instead.
You can do that with Ant. Just compile the same project twice with different
settings.
Maybe someone will correct me... but I think that the antTask from the SDK
doesn't cache do the iterative compilation, so that's why it may be slower.
This may not be the best technique, but I build with Ant in a way, I set it
as an alternative builder... so, it's the same as running the Ant
1. Using weak references is the last thing you should do, whenever possible
you should avoid it. By doing so you leave all means of control of the
object, and if the object has some kind of behavior that will keep it
alive, you won't be able to delete it ever (example, the *deleted* object
did not
Sorry to chum in :)
var re:RegExp = /((|').*(?=\2)\2)|(\s[^\s]+(?!\s))/g;
var text:String = ![CDATA[Lacrimosa dies illa,
qua resurget ex favilla
iudicandus homo reus.
Huic ergo parce, Deus:
Pie Iesu Domine,
dona eis requiem.]].toString();
var result:Object;
while (result = re.exec(text))
{
Ouch, actually, it has a flaw, but I'm not sure you need a fix for that, but
it's possible to fix it, if you want. It only checks for the double quotes,
when it checks for the non-quoted words, but it checks for both single and
double quoted groups of words. If you need both single and double
Hi.
Did you know that you can compare stings using operators and as well as
== ? Anyways, I'd usually just do the sorting on source and reset the view.
I think that sorting of the view is just strange and the way it is
implemented is convoluted... I could never understand why anyone would want
Just use try-catch, I don't think there's anything special for this case.
I think that E4X is the default for the WebService. E4X isn't exactly a
format... it's a language extension added to ECMAScript, just like regular
expressions language in many other languages, or LinQ in .NET.
Essentially, when you did this:
myDataXML = XML(evt.result);
You have already
I haven't tried it, but my guess is that File either cannot be extended, or
there may be some other limitations related to this kind of classes. I'd go
for composition then, that is I'd create a class extending EventDispatcher
and expose the name property through it's getter (which you can make
Is firing the server team an option?
I am running IIS and Apache on my machine (home dualcore Intell
PC purchased 4 years ago) as well as MySQL server and many other
applications. I have only 2GB of RAM available - I can still see SWFs, no
problem. (And I can play recent 3D shooter games while
Nope, not really, what happens is like this: the document class is a sprite,
which has some code in it, which is called first in the application and this
class is automatically added to stage, if it is not loaded. However, if the
SWF is loaded, then the class isn't automatically added to stage,
That won't also work because there's a redundant dot before the bracket. ;)
Hi, I think square brackets may be an obstacle here. I think they didn't
always work, or maybe they don't work even now? Anyways, if that's an array
collection, you'd better use getItemAt() and if that's an XML or XMLList,
you'd be better of with the XML / XMLList methods corresponding to what you
Well, that wasn't a good idea from the start, as instance name isn't a
reliable identification (you can assign two identical names to different
instances and that will compile, while the second instance will not
be available). What I usually do in such case is: I prepare the class with
the fields
Hm... this is a good point... however, I think that you can secure yourself
by parsing a/ tags in that text and see if they don't dispatch any events
that your SWF may be listening to. But, the worst thing that can happen is
that the anchor in the text will call some handler inside your
Security files are served from the socket on the server side. You don't need
to change flex code for that. Well, they are not precisely files, they are
the content of the security file being sent over the socket in response
to policy-file-request/.
For more info see this:
These properties may be overridden. My gut feeling says there should be
something like commitProperties / validate or some similar method to apply
all changes to the changed display object.
Hi. I remember that MDM Zinc offered this (only for texts, not graphics) at
some point (of course, only for desktop applications). Other than that, I'd
say that if it is a browser based application, it should not be possible,
and if it's a desktop, you should be looking into making some custom
Adobe encoder can conditionally ad linebreaks, that is all the difference
between all RFCs basically. But, honestly, Base64 is a very simple
algorithm, if you are not concerned about performance, let's say and you had
started writing it at the time you've posted you would have a dozen of
different
Hey... HaXe compiles to CPP... all you need is just to compile it to flash
and CPP, that's it... well, almost, flash memory uses big endians, so you
may want to remove the flipping of the first and third bytes in decode
function, and, of course, don't use Memory.select() when compiling to CPP
$WORKSPACE/.metadata/plugins/org.eclipse.core.runtime/.settings/com.adobe.flexbuilder.project.prefs
on my machine, I've found it using:
# cd $WORKSPACE/.metadata
# find . | xargs grep 'sdk' -sl
was the first result for me, or maybe second.
Best.
Oleg
Events bubble up (from child to parent, but not the other way). You must
explicitly dispatch a bubbling event in order for it to bubble (bubbling is
expensive in terms of performance). SWIZ uses couple of different techniques
to bind the dispatchers and listeners, one of those techniques is to add
[foo, bar, foobar].join(\r);
Use FileReference instead? Or call some JavaScript so it could call back to
Flash?
FileReference.save availability depends on the player version, the version
of the SDK or Flex Builder doesn't affect that.
Regarding JavaScript, I'd go for an iframe, which would load try to navigate
to the URL to the file you want to load and then a script in the parent
document that would check
http://blooddy.by/en/
I'd recommend this library instead, it is much faster then the one from the
SDK. I had taken part in testing it, but I'm not the author. I had written
however Base64 implementation (very similar to the one in the library), and
it's fairly basic. You can find it here if you
Should work. Works for us anyway.
var i:int = myArray.length;
var obj:Object;
while (i--)
{
obj = myArray[i];
if (myArray.indexOf(obj) !== myArray.lastIndexOf(obj))
myArray.splice(i, 1);
}
Anything like this?
E4X prints the content of self closing nodes as an empty string (if it's not
the root node). You may want to use toXMLString() to print the structure of
the node.
E4X always reduces the foo/foo kind of nodes to foo/ because first is
redundant and ambiguous. It is not clear whether the first kind is in fact
two nodes - an element node with a child text node with the value of empty
string, or is it a single element node. It is also longer than needed, if it
If those are simple dynamic objects you can write them to ByteArray and
compare them, it will be faster than using ObjectUtils.
Everything in AS, except for numeric types (but not Date), strings and
booleans are references, Array.indexOf() uses strict equality (compares
references), so even if
You can do pretty well with only two ByteArrays,
var ba0:ByteArray = new ByteArray();
var ba1:ByteArray = new ByteArray();
var len:int;
var tail:int;
for ( ... )
{
ba0.writeObject( ... );
ba1.writeObject( ... );
if (ba0.length !== ba1.length) // objects are different
len =
var ba0:ByteArray = new ByteArray();
var ba1:ByteArray = new ByteArray();
var len:int;
var tail:int;
for ( ... )
{
ba0.writeObject( ... );
ba1.writeObject( ... );
if (ba0.length !== ba1.length) // objects are different
len = (ba0.length 2) 2;
while (ba0.position len)
{
Duh! Gmail isn't the best place to write the code! :)
var ba0:ByteArray = new ByteArray();
var ba1:ByteArray = new ByteArray();
var len:int;
for ( ... )
{
ba0.writeObject( ... );
ba1.writeObject( ... );
if (ba0.length !== ba1.length) // objects are different
len = (ba0.length 2)
Actually, here it is:
package
{
import flash.display.Sprite;
import flash.utils.ByteArray;
/**
* ...
* @author wvxvw
*/
public class RemoveDuplicatesThroughByteArray extends Sprite
{
private var _patternA:ByteArray = new ByteArray();
private var _patternB:ByteArray = new ByteArray();
public
Hey, you are welcome so far it works! :) I'm only afraid of the situation
when properties are not written in the same order. To be honest, I need to
read up the AMF specs to see if that was by chance, or was that the how AMF
is supposed to work. (I tried to initialize the properties in different
ObjectUtils sorts them on purpose, that's a bit different ;)
Woops, sorry, it appears that objects created using new Object syntax are
sorted differently from objects created using literal...
var o:Object = new Object();
o.bar = 345;
o.foo = 123;
var result:Array = this.removeDuplicates(
[
{ foo:123, bar:345 },
{ foo:123, bar:345, foobar:789 },
{ foo:123,
Well, then my take would be this: since you are sending them from CF, you
are probably using AMF, and since you do so, you can use strongly typed
objects, and (again, I'm not sure but...) I think that strongly typed
objects are written accordingly to their describeType - this means objects
are
DPI is a relative value... I mean, if you stretch the image, it will
change... you can only find it out by comparing the number of pixels to the
size of the rectangle you are going to put them in... Also, I'm afraid that
given the runtime limitation on bitmapdata size, you will only be able to
Something like:
root.getRect(stage).intersects(clip.getRect(stage)) clip.visible
clip.alpha
I'm not sure about mask / clipRect / ColorMatrixFilter (they all may make
the clip appear as invisible) + of course, there may be another display
object on top of the clip, which you can roughly check by
Hi.
Regarding that class, you are welcome to vote:
http://bugs.adobe.com/jira/browse/SDK-26196
I didn't have those other problems you describe though, this is what our Ant
task looks like for creating documentation:
target name=generate-documentation
mkdir dir=${basedir}/docs/
delete
fileset
I would rather implement a clone() function in the objects I want to clone
(just like Event.clone() or XML.copy() or BitmapData.clone()). This gives
you most control of what / how they are cloned with less side effects.
public function filterFolderFromPath(fullPath:String,
children:Vector.Folder):Folder
{
var foundChild:Folder;
for each (var currentFolder:Folder in children)
{
if (currentFolder.path === fullPath) return currentFolder;
else if (currentFolder.children.length)
{
foundChild =
Actually, just for kicks:
public function filterFolderFromPath(fullPath:String,
children:Vector.Folder):Folder
{
for each (var currentFolder:Folder in children)
{
if (currentFolder.path === fullPath) return currentFolder;
else if (currentFolder.children.length)
{
currentFolder =
Hi, does anyone else experience the same thing? Having to close-open all
browser windows only to be able to remove old traces from the log
is extraordinarily annoying. This was a bug in AIR once ago, now it happens
with both AIR and player.
Check that you have minor player version specified and it is exactly 01.
To check this compile with -dump-config and look for the player version
there.
It is also possible that your SDK doesn't have the required
playerglobals.swc. If this is the case, download it from Adobe labs site.
Can you cd to the sdk root and then ls it and paste here the results?
$ cd ~/flex/sdk
$ ls
(something like this)
It sounds like you maybe didn't extract that into a proper folder / removed
something accidentally.
Another idea:
- try compiling from command line, will it compile? If it won't
This is called type inference, it exists in several languages, C# would be
one the most popular, HaXe would be the one most close to AS.
@Rick Genter:
It depends, most probably the compiler would give you an error/warning
because of ambiguous code, and if not - would choose a common denominator
No, that's different from type inference. Type inference preserves strict
typing. It is most useful for anonymous classes or templates. That is the
cases when it is preferred to let compiler to decide on the type of a
variable.
Think of retrieving values from the database and wanting to have
Hi, they are in the repository in the same folder. I think that the better
way to use it is like so:
var list:DataList = DataList.fromArray([1, 2, 3], int);
or
var list:DataList = DataList.fromVector(new int[1, 2, 3]);
Can the player display the SWF otherwise?
How did you get the SWF you are trying to embed?
Some issues you may want to check:
- SWF contains newer tags then the SDK can handle (DefineFont4 for example
cannot be handled in SDK 3.2).
- SWF contains shape tweens - some such tweens will cause the SDK
This mostly happens when you forget var keyword but you intend to put it.
The label must be simple identifier error means that the compiler believed
that construction to be a loop label. The error isn't in the code as you
show it, but you probably have more of it. Basically, just check the syntax
Hi, I think I know this implementation, and, I don't really like it, so I've
made my own, you're welcome to try:
http://code.google.com/p/e4xu/source/browse/trunk/src/org/wvxvws/data/DataList.as
(+ dependencies)
Or from templates, if you are using FD:
Look up the manual on describeType. Note that local variables type isn't
possible to get at runtime.
Nope, sorry Amy, it's not possible to get the type of a local variable, you
can only get the type of a value it references. Example:
function foo():void {
var bar:IBitmapDrawable = new BitmapData();
}
you can only know what the type of the value is ( BitmapData ) the type of
the bar variable
Well, it's not exactly like that... the type of the local variable is
checked at compile time. Later on local variables kind of don't exist,
that is the bytecode doesn't have a concept of get local function variable
strict because what's used is the address. I.e. take for example something
as
If you build that with Ant you may just ignore that and use your own
variable - that's how I did that anyway. Used mxmlc task output attribute.
I don't know about a way to set that thing from Flash Builder, it seems like
that's one more thing that Flash Builder knows better than you ;)
Oh, sorry, me wrong... I didn't realize that if you put [Bindable] tag
anywhere (not necessarily on class definition), then it will make compiler
add extends EventDispatcher... how silly of me
Cool, really, thanks for sharing.
Although I didn't like the idea of extending Proxy... I think the bug where
the dataProvider is accessed in a dataProvider[i] way should've been fixed
now... There are also couple of wrong assumption that ListCollection makes
when treating data as Arrays, thus not
I think that it says on the nochump site that it is not the fastest. In
fact, using BiteArray.compress() with deflate would be the fastest, but
that's only if you can use FP10.
If it ever worked that may be because of the patched compiler /
preprocessor, and so all dispatchEvent calls were translated to what is
marked as [Dispatcher]. Maybe it does the same as [Bindable] on class, or
maybe like HaXe using directive. Otherwise - just a confusing piece of
code... Well, you
OK... dispatchEvent is an undocumented global function...
test case:
var ns:Namespace = new Namespace();
trace(ns::dispatchEvent);
Another hack in AS3... well... I have couple of strong words about this, but
these should be only spoken in private... crap :(
You can load it with JavaScript synchronously, ExternalInterface is also
synchronous, however, it is possible that you will run out of time and the
application will crash because of that. Because, even though you can
try-catch timeout error, if the function that produced the error won't exit,
you
I'm afraid you won't find a solution that covers all cases. We at some point
decided to not have any business / value objects and return the SQL data
unparsed parse it on the client, of course not the other way, when sending
the data. This may be really controversially to the best practices, but
If you are adding handlers to events dispatched by the objects that are
going to be removed along with the listener, then why not? However, it is
true that Flex components have no dispose() or similar methods.
Well, it's really hard to tell since all those objects inherit from
UIComponent and it has almost every method overridden and to tell you the
truth I just don't know what happens when these handlers are added or
removed. I think in every particular case only the profiler will tell what
is really
Try Chrome, it won't crush because of plugins.
Well, if you will just say it crashed, you'll get nowhere. It is possible
that programs have bugs, but if you want to have less bugs, you have to
provide info to help identify them. At least post a link of the banner that
caused the crash.
Just for the record - a quick search in the bug database for
LocalConnection gives 88 results, about one half of them unresolved. AFAIK
there are some issues related to the new security model regarding Macs and
LocalConnection, though it's hard to imagine it would crash the browser...
It would be
1 - 100 of 292 matches
Mail list logo