[Flashcoders] IOError on https under IE7

2007-08-14 Thread Ammon Lauritzen
I have a swf that is being loaded off of an https server. As it fires
up, it attempts to call a simple authentication service that lives on
the same host. This works fine under Firefox, Opera, and Safari.

However, under IE, it throws an exception:

[IOErrorEvent type="ioError" bubbles=false cancelable=false
eventPhase=2 text="Error #2032: Stream Error. URL:
https://host/path/script.php?username=allaryin&passwd=hash";]

Obviously, if I just load the url directly into IE, it loads fine.
This problem only occurs when flash tries to load the url for me.

When I monitor the query with Charles, it shows that the request is
being made correctly and that the information I am expecting is
successfully being returned. However, Flash is apparently ignoring the
response.

This behavior has been observed on different machines, running both XP
and Vista.

Thoughts?

Ammon
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Best Practices question...

2007-06-01 Thread Ammon Lauritzen

On 6/1/07, Steven Sacks <[EMAIL PROTECTED]> wrote:

> And since we're talking best practices, you don't
 > have any public instance variables anyhow, hmm? :)

I don't know what "best practice" you're referring to that claims that
you shouldn't have public instance variables.


Grin. Well, he said OO best practices, not ActionScript ;)

Traditional OO design rules state that you should always encapsulate
your instance data in getters and setters. The general idea being that
external classes should never have the ability or need to manipulate
your data for you - they should have to ask nicely and then accept
whatever you're willing to do in stead. And I agree with that for the
most part.

While I can understand the use of public instance variables in AS2 and
AS3 them because of backwards mental compatibility with AS1... I only
use them in AS2 when the project already does - which is often since
most of the AS2 I work with was written by former AS1 devs ;) It's
also kind of unreasonable to expect people to use private properties
in such a weakly typed language anyway.

I find this regrettable in AS2 but acceptable in AS3 since you can
still just hook into the property and listen for changes and respond
accordingly. That gives you the control you need to safeguard your
internal data.

Ammon
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Best Practices question...

2007-06-01 Thread Ammon Lauritzen
[EMAIL PROTECTED] wrote:
>this should be kind of a simple one. I have been creating my Private
> variables as simple camelCased names.
> 
>private var variableName:VariableType;
> 
> I have seen other people creating them as underscore camelCased names and
> recently I was challenged that the underscore was the correct and best
> practice.
> 
>private var _variableName:VariableType;
> 
> I'm not convinced. Does any one have any definative information or
> experience of this from an OO best practices perspective and an
> explanation of why the right answer is right?

When it comes to "best" practices, the best thing you can do is be
consistent. Whether that means consistent with your other library of
work or consistent with the rest of the code in a project you have
joined, making your code as reliably similar to other associated code
should probably be your highest priority.

Thus, if you are editing a class that uses underscores for instance
variables, you should too. If they don't, then you probably shouldn't
either - it gets confusing fast.

Personally, I do lean toward using underscores for my instance variables
if I can get away with it. This allows for a clean distinction between
instance and local variables and is a very easy habit to get into. It's
certainly a whole lot nicer and easier to parse visually than having
bunches of myThis and myThat ;)

It is especially handy to use underscores when you are writing getters
and setters for those variables to further distinguish them - you don't
have to pick a different name for your public property. And since we're
talking best practices, you don't have any public instance variables
anyhow, hmm? :)

Some people will use two underscores for private vars and one for
protected or will come up with some other way to use more underscores. I
would recommend against mixing and matching - that degrades readability
and gets confusing.

You should use either one or two... and two doesn't really gain you
anything. I don't know when the last time I used two underscores before
a variable name was. Probably in another language when I'm not camel
casing things, private instance vars might be named __core_temperature,
or something like that. But it's been a while, and since the AS
convention is camel casing... consistency above all else ;)

Ammon
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] zinc instability

2006-10-20 Thread Ammon Lauritzen

Ok, so I've finally upgraded from the trial to a full licensed version
of Zinc. I have a swf that when compiled on this machine segfaults
immediately. Other swf's compile just fine, it's only this one file. I
uninstalled the trial, the full version, even the mProjector demo that
was still floating around on the machine. Rebooted twice. Reinstalled
Zinc. No change.

On a neighboring machine (which never had the trial installed), I did
a fresh install and the troublesome file builds into a lovely exe w/o
a hitch.

So, my question is this. Have other people had similar reliability
problems with Zinc? Is there any procedure I can go through to beat
this into submission so I don't have to switch workstations to build?

Ammon
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] flv not playing in IE with Flash 9

2006-10-06 Thread Ammon Lauritzen

On 10/6/06, Jim Berkey <[EMAIL PROTECTED]> wrote:

I notice that you are using: so.addParam("wmode", "transparent");
Do you need that? I've heard that the wmode paramater can do strange things to 
some browsers?


Yeah, we did need the transparent because of the skin we were using
for our player. We actually had a discussion about the wmode parameter
in this office last week but it seems to work reliably in all modern
browsers these days?

Unfortunately, removing the wmode setting didn't actually make any
difference in this case. (We removed _all_ parameters and just tried
using the default settings for one run).

Anyhow. Issue has been resolved for now.

Thank you JC, Mike, and Jim. :)

Ammon
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] flv not playing in IE with Flash 9

2006-10-06 Thread Ammon Lauritzen

On 10/6/06, Mike Mountain <[EMAIL PROTECTED]> wrote:

http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_04157

Does this help?


That might have helped, but the problem wasn't with loading the SWF.
It was with the SWF in turn loading the FLV. We had the following
structure:

something.html
/dir/something.swf
/dir/something.flv

The SWF itself was then trying to load the FLV from the same
directory. This worked in flash 8 and in flash 9 for firefox.
Unfortunately, flash 9 for IE apparently told the SWF (somewhere...
not in _url as just proven) it lived in the same folder as the HTML...
not where it was actually being loaded from.

Again, we found a workaround. By making the swf more generic and
passing in a parameter telling it where to find the video, it seems to
work reliably across different plugin versions.

Ammon
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] flv not playing in IE with Flash 9

2006-10-06 Thread Ammon Lauritzen

On 10/6/06, Hans Wichman <[EMAIL PROTECTED]> wrote:

don't know if it helps, but for example ._url might yield something
different in flash 9 then in flash 8.
Which means the resulting path in 9 is different from that in 8, which might
in turn cause content to break.
Not saying that was the problem here, but it might well be.


Yeah... I checked that and it doesn't seem to have made any
difference. My test case is at http://enemyhideout.com/~ammon/urltest.

It simply loads a swf in a subdir that displays this._url to a text
field on a green background.

Works the same in different browsers.

Ammon
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] flv not playing in IE with Flash 9

2006-10-05 Thread Ammon Lauritzen

On 10/5/06, John Dowdell <[EMAIL PROTECTED]> wrote:

If you can't see other SWF in that browser, then that's a clue.


Sigh. And here I was wasting my time trying to be polite to you. YES I
could see other SWF's in that browser. Sheesh.

Anyways. Resolution to the problem has been achieved. In stead of hard
coding the flv into the swf, we're passing it in as an argument when
instantiating it from the html. And it works.

There seems to be an issue with directory locations. The flv was
trying to load relative to the swf, NOT the html file. So why this
happens in flash 9 for IE, I don't know, nor do I care any more at
this point. But the incident has been logged for future reference when
we encounter the bug again.

Ammon
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] flv not playing in IE with Flash 9

2006-10-05 Thread Ammon Lauritzen

On 10/5/06, Ammon Lauritzen <[EMAIL PROTECTED]> wrote:

I'm sorry, I thought I was clearer than that. By "without swfobject" I
meant that I had also tried manually as well:


And yes, now that I look back on it, I realise that my poor attempt at
humor might not have parsed very well visually... but shrug.

Ammon
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] flv not playing in IE with Flash 9

2006-10-05 Thread Ammon Lauritzen

On 10/5/06, John Dowdell <[EMAIL PROTECTED]> wrote:

You're using a JavaScript routine to write the tags. When you do a test
file with straight OBJECT/EMBED markup, then do you see that content in
that browser? That's the quickest way to start finding where the
difference is.


I'm sorry, I thought I was clearer than that. By "without swfobject" I
meant that I had also tried manually as well:

http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0";
width="360" height="320" id="VideoPreview" align="middle">




http://www.macromedia.com/go/getflashplayer"; />


(URL for this snippet on my dev server is at
http://enemyhideout.com/walkez/VideoPreview.html)

Again. This works fine in Firefox and in IE/Flash8. But in IE/Flash9,
flash loads, I'm just getting a contentless box.

My point was that I'm not finding _anything_ that makes a difference
other than flash player version.

Ammon
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] flv not playing in IE with Flash 9

2006-10-05 Thread Ammon Lauritzen

Ok, simple issue really, and I seem to have found evidence of other
people experiencing it as well - just no answers posted to their pleas
for help :)

I have a flash video (the player swf is compiled for flash 8) that
should be visible at the bottom of http://walk-ez.com/fans.aspx.

And it is visible. Under Firefox and Opera. Under IE, it does not work
on machines with flash 9, only those that have yet to be upgraded from
8.

I've tried with and without fla-i mean swfobject, with and without
various parameters being passed in to the swf, and off of a variety of
servers. None of this seems to make any sort of difference.

Thoughts? Is this a known issue?

Ammon
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Array Empowerment

2006-07-26 Thread Ammon Lauritzen

On 7/26/06, Steven Sacks | BLITZ <[EMAIL PROTECTED]> wrote:

Backspace and Delete, Enter and Return...which is right?  :)


^H
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


re: [Flashcoders] Array Empowerment

2006-07-25 Thread Ammon Lauritzen

A few thoughts on optimization. Just thoughts.

Steven Sacks | BLITZ wrote:

// Remove all elements from Array
Array.prototype.clear = function() {
this.length = 0;
};


This function scares me to death. I understand that the garbage
collection in any decent VM should take care of this... but wow, it
feels like some dangerous voodoo. :)


// Removes all null and undefined elements from Array
Array.prototype.compact = function() {
this.delete_all(null);
this.delete_all(undefined);
};


Which is faster, iterating over an array of size N once and checking
for elements that are either null or undefined in a single pass, or
iterating over an array of size N checking for nulls and then
iterating again over an array of size N-x and checking for the
undefineds?


// Deletes items from the Array that are equal to obj
Array.prototype.delete_all = function(obj) {
var i = -1;
var a = this.length;
while (--a -(-1)) {
if (this[a] == obj) {
i = a;
break;
} else if (this[a] instanceof Array && obj instanceof
Array) {
if (this[a].eql(obj)) i = a;
break;
}
}
if (i > -1) {
this.splice(i, 1);
this.delete_all(obj);
}
};


You do this sort of thing in several of your functions and I think you
_might_ be able to squeeze a bit of theoretical speed out of things by

if obj is an array
  loop checking for array equality
else
  loop checking for value equality

In stead of

loop over the entire array
 check value equality
 if obj is an array
   check array equality

It's not much, but over a few thousand comparrisions it might make a difference?

Also, what's the performance hit for splice()? I know it's bad in some
languages. Would it be potentially faster to build a new array in
stead of re-splicing the old one? I guess it depends on the length of
the array as compared to the number of elements being removed. What is
the threshold where one becomes preferrable to the other?


// Runs a function on every item in the array
// Returns an array of all items for which the function returns true.
Array.prototype.filter = function(block) {
var r = [];
var n = this.length;
for (var a = 0; a < n; a++) {
if (block(this[a])) r.push(this[a]);
}
return r;
};


I love this one. I use it absolutely all the time in other languages.

Ammon
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com