Re: [Flashcoders] Re: swf doesn't work the same online

2010-03-11 Thread Valentin Schmidt
John Singleton wrote:
 From: Valentin Schmidt v...@dasdeck.com To: Flash Coders List
 flashcoders@chattyfig.figleaf.com Sent: Tue, March 9, 2010 3:28:52
 PM Subject: Re: [Flashcoders] Re: swf doesn't work the same online
 
 
 quote first, your emails are a bit hard to read, I'd suggest to
 quote correctly (see e.g. http://mailformat.dan.info/quoting/), or
 better, use an email client that takes care of correct quoting (and
 configure it accordingly). /quote
 
 I don't see that yahoo affords me the opportunity to do other than I
 have done above. Bummer ;(

in case this is Yahoo! Mail:
go to Options-Mail Options
at the bottom you will see a checkbox:

When replying  forwarding: Mark original message with  (plain text only)

activate it and save the changes (and only use plain text mails for
mailing lists, of course).

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: swf doesn't work the same online

2010-03-11 Thread Valentin Schmidt
 If you are using Firefox, can you use something like the
 LiveHTTPHeaders add on to see the request for the SWF and whether the
 server sends back NOT MODIFIED.

or the Firebug addon (which IMHO every web developper should have
installee in his firefox anyway), in the Network Tab in can also show
you the exact details of all HTTP transactions, of course also those
started by the flash (or director shockwave) plugin.

concerning cache, in firefox you can use those 2 about-URLs to get
detailed infos about all cache entries, including last update and total
number of fetches:

about:cache?device=memory
about:cache?device=disk

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: swf doesn't work the same online

2010-03-11 Thread Valentin Schmidt
Glen Pike wrote:
 Each to their own I guess, Firebug for me is too much like using a 
 sledgehammer to crack a nut for Flash applications - it's unwieldy and I 
 have found it to be a bigger memory hog than Adobe products. 

who cares? of course you only activate it when you really need it - and
I'm quite sure that in deactivated state it doesn't consume any xtra memory.

I do a lot of PHP/XHTML/CSS/JS/Ajax stuff, and I defintely couldn't live
(well: work) without firebug, no way :-)

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] OT: was swf doesn't work the same online

2010-03-11 Thread Valentin Schmidt
Glen Pike wrote:
 I'm quite sure that in deactivated state it doesn't consume any xtra memory.
   
 Not sure - I think there used to be a nasty memory leak, even when it 
 was disabled - I had it upto 1.5 GB, a bit like FF 3 years ago.  PITA 
 when you have tons of pages open and your browser dies!

don't know about this specific leak, but firebug is under active
development, and in the last few years firebug definetly doesn't have
such a leak anymore (at least not in deactivated state) - millions of
users use it every day, many (like me) with less than 1,5 GB RAM available.

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: swf doesn't work the same online

2010-03-11 Thread Valentin Schmidt
John Singleton wrote:
 From: Glen Pike g...@engineeredarts.co.uk To: Flash Coders List
 flashcoders@chattyfig.figleaf.com Sent: Thu, March 11, 2010
 10:45:38 AM Subject: Re: [Flashcoders] Re: swf doesn't work the same
 online
 
 
 Let's see if my changes to Yahoo options translate this to plain text
 now ;)

so why didn't you activate the automatic quote settings in yahoo mail,
as I had shown you?

again, this is what correct quoting looks like, and yahoo can very well
do this for you, if you only change those settings accordingly:
http://mailformat.dan.info/quoting/
http://en.wikipedia.org/wiki/Usenet_quoting
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: swf doesn't work the same online

2010-03-09 Thread Valentin Schmidt
John Singleton wrote:
 From: Glen Pike postmas...@glenpike.co.uk To: Flash Coders List
 flashcoders@chattyfig.figleaf.com Sent: Mon, March 8, 2010 3:04:47
 PM Subject: Re: [Flashcoders] Re: swf doesn't work the same online
 
 var nNavs:Array = new Array(); for(var i:int = 0; i  numLinks;i++) {
  var nav:Sprite = nav(nNames[i], nUrls[i], positions[i], 0x0e778a);
 
 It throws error 1067 on the above line: implicit coercion of value
 type void to an unrelated type flash.display.Sprite, which frankly
 makes sense; however, I'm not sure how I should create the variable
 to push it onto the stack by doing otherwise. Thanks, John

are you really using glen's nav() function that returns a sprite, and
not accidently your original version?

and a remark: I'd recomemnd to avoid to sue the same variable name both
for a function and a local variable, this means asking for trouble
(althouight it propably works in your code as long as the nav variable
is local and the nav function is global).

cheers,
valentin

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: swf doesn't work the same online

2010-03-09 Thread Valentin Schmidt
hi john,

John Singleton wrote:
 Sorry, my typo / error.
 
 You need to change bgcolor to backgroundColor in the event handler 
 functions (bgcolor is not a property of TextField), e.g.
 
 TextField(nsprite.mynav).backgroundColor = 0x...
 
 No, I caught that and made the appropriate substitution. My vars are
 actually different than what I'm posting. That's not the problem.
 Please take a look at what I sent earlier. Thanks, John

first, your emails are a bit hard to read, I'd suggest to quote
correctly (see e.g. http://mailformat.dan.info/quoting/), or better, use
an email client that takes care of correct quoting (and configure it
accordingly).

second, I have the impression that this thread could go on forever
without getting anywhere. Maybe it would be a good idea to do a fresh
start, and this time first create a clear conception of what you want to
achieve (in each function), e.g. by describing it in plain english,
before writing your actual code?
but if you don't want to this, maybe you could extract the problematic
part into a simple demo movie and put the FLA online, so anyone
interested can download and fix the code? I think that makes more sense
than posting longe code extracts here which then even aren't your actual
code.

just my 2 cts.

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] swf doesn't work the same online

2010-03-08 Thread Valentin Schmidt
 Hi; I built a swf that works the way I want it in Flash, but when I
 upload it, it acts differently! I built buttons in as3 like this:

your code is corrupted:

 function onRollOutHandler(e:MouseEvent)
 {
 if (e.currentTarget.name == ' Home ') 
 {
 Navigation(' Home ', 'index', 235, 0x0e778a);
 }

the IF statement is not closed!

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] OOP Tutorial

2010-03-05 Thread Valentin Schmidt
Susan Day wrote:
 Hi;
 Now I would like to call my class Star from another class, but pass
 different values to its variables. Do I need to implement the inheriting
 class as Star? I'm kinda lost here. I've been googling as3 oop but the
 tutorials don't seem to address my needs. Can you help me understand what it
 is I'm looking to do so I can google up the appropriate tutorials?

omit as3 in your google search, your questions are not AS3 related at
all, but rather related to general OOP concepts.

as usual a good place to start:
http://en.wikipedia.org/wiki/Object-oriented_programming

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] web video

2010-03-03 Thread Valentin Schmidt
Sam Brown wrote:
 you can embed cuepoints in the flv and listen for them to cue events. Most
 reliable way to embed them is via the Adobe Media Encoder

there is no need to embedd such end cuepoints into the file, you can as
well add them programmatically at runtime (using the addASCuePoint
method), which results in much higher flexibility.

but actually I don't think you need any cuepoints at all just to detect
the end of your video, for this purpose you can simply use the existing
VideoEvents (and check e.g. for VideoEvent.COMPLETE).

cheers,
valentin

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] web video

2010-03-03 Thread Valentin Schmidt
Valentin Schmidt wrote:
 Sam Brown wrote:
 you can embed cuepoints in the flv and listen for them to cue events. Most
 reliable way to embed them is via the Adobe Media Encoder
 
 there is no need to embedd such end cuepoints into the file, you can as
 well add them programmatically at runtime (using the addASCuePoint
 method), which results in much higher flexibility.
 
 but actually I don't think you need any cuepoints at all just to detect
 the end of your video, for this purpose you can simply use the existing
 VideoEvents (and check e.g. for VideoEvent.COMPLETE).

my bad, for some reason I had thought the OP just wanted know when the
file has reached the end, but actually he asked for reaching second 45.

anyway, it should be no problem to prammatically add a cuepont at second
45 using FLVPlayback's addASCuePoint() method.

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] web video

2010-03-03 Thread Valentin Schmidt
in case you want to follow my suggestion and simply use programmatical
ASCuepoints of hardcoded cuepopints, here same simple sdemo code that
works fine:

import fl.video.*;

var myFLV:FLVPlayback = new FLVPlayback();
myFLV.source = test.flv;
myFLV.addASCuePoint({time:0.5, name:cp1});
myFLV.addASCuePoint({time:1.0, name:cp2});
myFLV.addEventListener(MetadataEvent.CUE_POINT,
function(e:MetadataEvent):void{
  trace(Cuepoint reached: +e.info.name);
});
myFLV.x = myFLV.y = 0;
addChild(myFLV);
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] web video

2010-03-03 Thread Valentin Schmidt
Valentin Schmidt wrote:
 in case you want to follow my suggestion and simply use programmatical
 ASCuepoints of hardcoded cuepopints, here same simple sdemo code that
 works fine:

I'm sorry, I was very distracted :-)

once more:
... use programmatical ASCuepoints instead of hardcoded cuepoints, here
some simple demo code that works fine:

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Can u combine....

2010-02-26 Thread Valentin Schmidt
Juan Pablo Califano wrote:
 Another option:
 function loadXML(dfile:String,arg1:Object,arg2:Array):void
 {
 
   urlLoader.load(new URLRequest(dfile));
   urlLoader.addEventListener(Event.COMPLETE, function(e:Event):void {
 parseXml(e,arg1,arg2);
   });
 }

and another option:

save this as file myURLLoader.as

package {
  import flash.net.URLLoader;
  public class myURLLoader extends URLLoader {
public var params:Object;
  }
}

and then use something like this:

function loadXML(dfile:String):void
{
  var urlLoader:myURLLoader = new myURLLoader();

  // add arbitrary custom parameters here
  urlLoader.params = {foo:23, bar:hello world};

  urlLoader.load(new URLRequest(dfile));
  urlLoader.addEventListener(Event.COMPLETE, parseXML);
}

function parseXML(e:Event):void
{
  trace(e.target.params.foo);
  trace(e.target.params.bar);

  xmlFile:new XML(e.target.data);
  // ...
}

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] bytesAvailable, readUTF() and ProgressEvent.SOCKET_DATA

2010-02-23 Thread Valentin Schmidt

 private function handleTcpData(event:Event):void {
while (_socket.bytesAvailable) {
   var str:String = _socket.readUTF();
   updateGUI(str);
}
 }

maybe you shouldn't ignore thrown errors: AFAIK if the UTF8-data is not
complete (ie.. the last UTF-8 byte sequence is truncated), readUTF()
will throw an EOFError error. so if you handle this error correctly, you
might be safe?

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] bytesAvailable, readUTF() and ProgressEvent.SOCKET_DATA

2010-02-23 Thread Valentin Schmidt
Alexander Farber wrote:
 I've come up with this, but still have a flaw there:
 
 private function handleTcpData(event:Event):void {
   var len:uint;

what about this simple alternative:

private function handleTcpData(event:Event):void {
  if(_socket.bytesAvailable) {
try{
  var str:String = _socket.readUTF();
  updateGUI(str);
}catch(e:Error){}
  }
}


I havn't tested, but if the socket class is well designed, the buffer
should only be flushed if readUTF() was sucessful, and therefor the
above code should work fine.

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] bytesAvailable, readUTF() and ProgressEvent.SOCKET_DATA

2010-02-23 Thread Valentin Schmidt
Alexander Farber wrote:
 Yes, that's with what I had started and what doesn't work :-)

so then why did you start with posting code here (pasted below) that
didn't contain any exception catching? that's the crucial point: you
have to catch the exception, otherwise you would either get corrupted
UTF strings or and be caught in an infinite loop (because you used
while instead of if!).

here the code you had posted (that is quite different to mine):

  _socket = new Socket();
  _socket.addEventListener(ProgressEvent.SOCKET_DATA, handleTcpData);
.
private function handleTcpData(event:Event):void {
   while (_socket.bytesAvailable) {
  var str:String = _socket.readUTF();
  updateGUI(str);
   }
}

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] bytesAvailable, readUTF() and ProgressEvent.SOCKET_DATA

2010-02-23 Thread Valentin Schmidt
some comments added to make it easier for you to spot the differences :-)

private function handleTcpData(event:Event):void {
  if(_socket.bytesAvailable) { // USE IF, NOT WHILE!
try{ // CATCH THE EXCEPTION
  var str:String = _socket.readUTF();
  updateGUI(str);
}catch(e:Error){}
  }
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] bytesAvailable, readUTF() and ProgressEvent.SOCKET_DATA

2010-02-23 Thread Valentin Schmidt
 And if you use an if instead of while,
 then you lose even more incoming data.

how come?
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] bytesAvailable, readUTF() and ProgressEvent.SOCKET_DATA

2010-02-23 Thread Valentin Schmidt
Alexander Farber wrote:
 After some thought... the 2nd case (not enough data arrived)
 is not a problem for your code, because the handleTcpData()
 will get called again - once the rest of the data arrived.
 
 But for the 1st case (several UTF strings arrived at once)...
 Maybe I should try the following (and don't need a ByteArray):
 
 private function handleTcpData(event:Event):void {
 // KEEP EXTRACTING UTF-STRINGS
  while(_socket.bytesAvailable) {
   try{
 var str:String = _socket.readUTF();
 updateGUI(str);
}catch(e:Error){
  // INCOMPLETE STRING, WILL BE READ LATER
  return;
}
  }
 }

yes, I think that might be a good idea: the problem I saw peviously was
that if bytesAvailable0, but for some reason the try-statement fails
(and therefor bytesAvailable isn't set to 0), you would be caught in an
infinite loop, because I don't think the socket data will be updated
from outside while you are inside such an endless repeat-loop.

but by adding this return statement that leaves the loop this can't
happen anymore. good luck :-)

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: import documents into flash

2010-02-18 Thread Valentin Schmidt
Benny wrote:
 @valentin: Air 2 is able to call commandline tools just fine.

thanks for sharing! but of course I was talking about calling a command
line tool *and* returning the STDOUT/STDERR result to the main app. can
AIR 2 do this? do you maybe have any links/documentation for this
feature? it would be really interesting to know it this is finally
possible in Air 2.

I think I also heard rumours that in Air 2 it's possible to embed the
runtime into your app, so no prior runtime installation is required, is
that correct?

this would be a crucial feature for me, as with Air 1.x you can't create
standalone desktop apps (like a flash, director or haxe/neko projector
would be), but your result depends on a runtime that first needs to be
installed. therefor for my desktop app projects AIR was never really an
option, since I usually want real standalone apps.

cheers,
valentin


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: import documents into flash

2010-02-18 Thread Valentin Schmidt
Valentin Schmidt wrote:
 Benny wrote:
 @valentin: Air 2 is able to call commandline tools just fine.
 
 thanks for sharing! but of course I was talking about calling a command
 line tool *and* returning the STDOUT/STDERR result to the main app. can
 AIR 2 do this? do you maybe have any links/documentation for this
 feature? it would be really interesting to know it this is finally
 possible in Air 2.

this part I could answer myself, it's the new
flash.desktop.NativeProcess class:

http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/desktop/NativeProcess.html

one restriction (that e.g, a director projector doesn't have) is that
your app needs to be isntalled by a special natove installer:

The NativeProcess class and its capabilities are only available to AIR
applications installed with a native installer (extended desktop profile
applications)


 I think I also heard rumours that in Air 2 it's possible to embed the
 runtime into your app, so no prior runtime installation is required, is
 that correct?
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Has everyone seen this yet?

2010-02-17 Thread Valentin Schmidt
Ktu wrote:
 Looks like a great example of how Flash with AIR can create
 experiences that would otherwise be impossible. Too bad it will be on
 the iPad.

looks like the return of multimedia to me. but what do you mean with
otherwise impossible? I don't see any fundamental difference between
this app and any advanced multimedia app from the late nineties, created
e.g. with macromedia director. the only important difference is that we
have now touchscreens with much higher resolutions and multi-touch
capabilities.

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: import documents into flash

2010-02-17 Thread Valentin Schmidt
tom huynen wrote:
 Hey Guys,
 
 Thanks for the reply. To give a bit more information: The application  
 would be one that runs standalone on the desktop.
 It would be able to import .html files, word documents and pdf files.  

did you read my previous post? all 3 formats can be imported by this
little director standalone demo app I had written for you (in about 10
minutes):
http://dasdeck.com/staff/valentin/tmp/textExtract.zip

as I mentioned before, I think flash alone is not the right tool for
this because you can't easily combine it with existing commandline
tools, and I'm not aware of any DOC or PDF parsing AS3 libraries.

therefor you either need a flash wrapper (e.g. zinc or
haXe/neko/sreenweaverHX) that allows to call commmand line tools, or
another RAD environnment like director, runtimeRev or REALbasic.

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] import documents into flash

2010-02-15 Thread Valentin Schmidt
Tom Huynen wrote:
 Hi!
 
 A client asked me to create a application that imports different data
 documents into flash.
 
 Html pages, word documents and pdf's. It's about the text only and the
 layout doesn't matter.
 
 Is flash the right choice for this?

if your are talking about a standalone app (projector), I think the
answer is: no

parsing word docs and PDF files to extract the text data isn't trivial,
in my opinion the best solution is to use existing open source
commandline tools for this, like e.g. pdftotext (part of xpdf) and
antiword or wvText (part of wv library). since there is no easy way to
call commandline tools from flash projectors, I'd recommend to either
use a flash wrapper (like zinc or ScreenweaverHX/HaXe) that can do this,
or another RAD solution like e.g. director, RuntimeRev or REALbasic.

if you are talking about an online app, the frontend doesn't really
matter, it could be either flash or plain HTML, the actual parsing would
be done on the (*nix) server, again using open source solutions like
xpdf or antiword/wvText.

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] import documents into flash

2010-02-15 Thread Valentin Schmidt
 Html pages, word documents and pdf's. It's about the text only and the
 layout doesn't matter.
 
 Is flash the right choice for this?
 
 if your are talking about a standalone app (projector), I think the
 answer is: no
 
 parsing word docs and PDF files to extract the text data isn't trivial,
 in my opinion the best solution is to use existing open source
 commandline tools for this, like e.g. pdftotext (part of xpdf) and
 antiword or wvText (part of wv library). since there is no easy way to
 call commandline tools from flash projectors, I'd recommend to either
 use a flash wrapper (like zinc or ScreenweaverHX/HaXe) that can do this,
 or another RAD solution like e.g. director, RuntimeRev or REALbasic.

just to show what a great tool director used to be :-), here a little
standalone windows app that can extract the text contents of both PDF
and MS Word files (using xpdf and antiword under the hood):
http://dasdeck.com/staff/valentin/tmp/textExtract.zip

it took me about 10 minutes to write it, and it would maybe take another
5 minutes to add basic HTML support, and another 5 minutes to port it to
Mac.

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] AS3LCR as CHM

2008-12-27 Thread Valentin Schmidt
hi,

just a little hint for all adherents of the CHM format:
there is a good CHM version of the ActionScript 3.0 Language and
Components Reference (english CS4 version) at
http://rapidshare.com/files/177383554/as3lcr.chm

cheers,
valentin

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders