Re: [Flashcoders] Problem embedding and using a font variant

2011-04-13 Thread John R. Sweeney Jr
Slate Pro (light,book,bold) is one. Driving me nutz right now. ;)


on 4/11/11 1:56 PM, Merrill, Jason at jason.merr...@bankofamerica.com wrote:

 I have found every now and then certain fonts don't play well with Flash and
 there isn't much you can do if they don't work.  There are a few fonts I have
 which simply don't embed, and the failure is silent.


John R. Sweeney Jr.
Interactive Multimedia Developer


OnDemand Interactive Inc
945 Washington Blvd.
Hoffman Estates, IL 60169
Office/Fax: 847.310.5959
Cellular: 847.651.4469
www.ondemandinteractive.com


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


RE: [Flashcoders] Problem embedding and using a font variant

2011-04-12 Thread Merrill, Jason
Also, what is the font extension?  I have found fonts with an .otf extension 
(like MyriadPro-Regular.otf) don't seem to embed with code.  TTF fonts work for 
me though,  could that be the issue?  Also, in Flex (can't recall in the Flash 
framework off the top of my head), when you embed fonts, there is an option to 
embedAsCFF - if something like that is available, try toggling true or false, 
sometimes that makes a difference.  Lastly, if your font is otf or something 
non-TTF, there are some Myriad fonts for free out there that have the .ttf 
extension, you could try downloading one of those instead.

 Jason Merrill
 Instructional Technology Architect
 Bank of America  Global Learning 





___


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason
Sent: Monday, April 11, 2011 3:11 PM
To: Flash Coders List
Subject: RE: [Flashcoders] Problem embedding and using a font variant

 Well, the textField as library symbol will work fine -

I believe the font embedding works differently with library symbols, but I 
could be wrong.

 Jason Merrill
 Instructional Technology Architect
 Bank of America  Global Learning 





___


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Matt Perkins
Sent: Monday, April 11, 2011 3:04 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Problem embedding and using a font variant

Well, the textField as library symbol will work fine - I tested that, but would 
rather keep it pure AS.


On Mon, Apr 11, 2011 at 2:56 PM, Merrill, Jason  
jason.merr...@bankofamerica.com wrote:

 I have found every now and then certain fonts don't play well with 
 Flash and there isn't much you can do if they don't work.  There are a 
 few fonts I have which simply don't embed, and the failure is silent.

  Jason Merrill
  Instructional Technology Architect
  Bank of America  Global Learning





 ___


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
 flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Matt Perkins
 Sent: Monday, April 11, 2011 2:25 PM
 To: Flash Coders List
 Subject: [Flashcoders] Problem embedding and using a font variant

 I'm using Myriad Pro for regular (non TLF) dynamic text fields in my 
 project and it's working fine. Now the client wants to use Myriad Pro 
 Condensed Bold for titles and I cannot get it to show up. I can't get 
 just Myriad Pro Condensed to show either. I don't have any problems 
 with Myriad Pro - I think the condensed variant/style is causing 
 issues. I've checked over and over that I have it embedded properly.

 Looks like Condensed Bold is treated as a style like bold but 
 there's no way to set a style on a text format object.

 I even tried setting the font style via html in the text content:
 textfild.htmlText = font face='Myriad Pro 
 Condensed'+mytext+/font; Didn't work.

 Any tips for using font variants like this? I'd rather keep doing it 
 dynamically like this and not have to create a textfield symbol in the 
 library to use (which would work). Also, this is an AS3/CS5 project.

 The TLF TextLayoutFormat has a font style property, but not sure if it 
 would work - but the last time I tried to use TLF my FLA wouldn't 
 compile because of some error with my assets SWC and the TLF SWC. So 
 I'd rather not go there.

 Maybe I can fake it by tweaking the scaleX property.

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

 --
 This message w/attachments (message) is intended solely for the use of 
 the intended recipient(s) and may contain information that is 
 privileged, confidential or proprietary. If you are not an intended 
 recipient, please notify the sender, and then please delete and 
 destroy all copies and attachments, and be advised that any review or 
 dissemination of, or the taking of any action in reliance on, the 
 information contained in or attached to this message is prohibited.
 Unless specifically indicated, this message is not an offer to sell or 
 a solicitation of any investment products or other financial product 
 or service, an official confirmation of any transaction, or an 
 official statement of Sender. Subject to applicable law, Sender may 
 intercept, monitor, review and retain e-communications (EC) traveling 
 through its networks/systems and may produce any such EC to 
 regulators, law enforcement, in litigation and as required by law.
 The laws of the country of each sender/recipient may impact the 
 handling of EC, and EC may be archived, supervised and produced in 
 countries other than the country in which you are located

Re: [Flashcoders] Problem embedding and using a font variant

2011-04-12 Thread Jens Struwe

Don't ask me for details, but just a week ago I got this running.

[Embed(source=myfont.otf, fontFamily=myfont, 
mimeType=application/x-font-opentype)]

public var MyFont : Class;

To support otf, it is necessary to tell the compiler the a certain font 
manager is to use. I put it into my build.xml, but its easy to find the 
according command line option in the docs.


mxmlc
file=${SRC}/Movie.as
...


fonts
manager class=flash.fonts.AFEFontManager/
/fonts
...

That's not all, you need to compile with the Free SDK not the Open 
Source SDK. The reason is, that the AFEFontManager is not open source 
and not included into the Open Source SDK. Took me a while to find it out.


Best,

Jens



Am 12.04.2011 08:04, schrieb Merrill, Jason:

Also, what is the font extension?  I have found fonts with an .otf extension 
(like MyriadPro-Regular.otf) don't seem to embed with code.  TTF fonts work for 
me though,  could that be the issue?  Also, in Flex (can't recall in the Flash 
framework off the top of my head), when you embed fonts, there is an option to 
embedAsCFF - if something like that is available, try toggling true or false, 
sometimes that makes a difference.  Lastly, if your font is otf or something 
non-TTF, there are some Myriad fonts for free out there that have the .ttf 
extension, you could try downloading one of those instead.

  Jason Merrill
  Instructional Technology Architect
  Bank of America  Global Learning





___


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason
Sent: Monday, April 11, 2011 3:11 PM
To: Flash Coders List
Subject: RE: [Flashcoders] Problem embedding and using a font variant


Well, the textField as library symbol will work fine -


I believe the font embedding works differently with library symbols, but I 
could be wrong.

  Jason Merrill
  Instructional Technology Architect
  Bank of America  Global Learning





___


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Matt Perkins
Sent: Monday, April 11, 2011 3:04 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Problem embedding and using a font variant

Well, the textField as library symbol will work fine - I tested that, but would 
rather keep it pure AS.


On Mon, Apr 11, 2011 at 2:56 PM, Merrill, Jason  
jason.merr...@bankofamerica.com  wrote:


I have found every now and then certain fonts don't play well with
Flash and there isn't much you can do if they don't work.  There are a
few fonts I have which simply don't embed, and the failure is silent.

  Jason Merrill
  Instructional Technology Architect
  Bank of America  Global Learning





___


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Matt Perkins
Sent: Monday, April 11, 2011 2:25 PM
To: Flash Coders List
Subject: [Flashcoders] Problem embedding and using a font variant

I'm using Myriad Pro for regular (non TLF) dynamic text fields in my
project and it's working fine. Now the client wants to use Myriad Pro
Condensed Bold for titles and I cannot get it to show up. I can't get
just Myriad Pro Condensed to show either. I don't have any problems
with Myriad Pro - I think the condensed variant/style is causing
issues. I've checked over and over that I have it embedded properly.

Looks like Condensed Bold is treated as a style like bold but
there's no way to set a style on a text format object.

I even tried setting the font style via html in the text content:
textfild.htmlText = font face='Myriad Pro
Condensed'+mytext+/font; Didn't work.

Any tips for using font variants like this? I'd rather keep doing it
dynamically like this and not have to create a textfield symbol in the
library to use (which would work). Also, this is an AS3/CS5 project.

The TLF TextLayoutFormat has a font style property, but not sure if it
would work - but the last time I tried to use TLF my FLA wouldn't
compile because of some error with my assets SWC and the TLF SWC. So
I'd rather not go there.

Maybe I can fake it by tweaking the scaleX property.

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

--
This message w/attachments (message) is intended solely for the use of
the intended recipient(s) and may contain information that is
privileged, confidential or proprietary. If you are not an intended
recipient, please notify the sender, and then please delete and
destroy all copies and attachments, and be advised that any review or
dissemination of, or the taking of any action in reliance

Re: [Flashcoders] Problem embedding and using a font variant

2011-04-12 Thread Glen Pike
Have you tried enumerating your embedded fonts to see what name Flash 
gives it?


If you embed just your Myriad Pro Condensed into a document and add the 
actionscript to list out the font name, etc.


http://www.google.com/search?ie=UTF-8oe=UTF-8sourceid=navclientgfns=1q=as3+enumerate+font

You might find the system gives it a different name?

Glen

On 11/04/2011 19:24, Matt Perkins wrote:

I'm using Myriad Pro for regular (non TLF) dynamic text fields in my project
and it's working fine. Now the client wants to use Myriad Pro Condensed
Bold for titles and I cannot get it to show up. I can't get just Myriad
Pro Condensed to show either. I don't have any problems with Myriad Pro -
I think the condensed variant/style is causing issues. I've checked over
and over that I have it embedded properly.

Looks like Condensed Bold is treated as a style like bold but there's no
way to set a style on a text format object.

I even tried setting the font style via html in the text content:
textfild.htmlText = font face='Myriad Pro Condensed'+mytext+/font;
Didn't work.

Any tips for using font variants like this? I'd rather keep doing it
dynamically like this and not have to create a textfield symbol in the
library to use (which would work). Also, this is an AS3/CS5 project.

The TLF TextLayoutFormat has a font style property, but not sure if it would
work - but the last time I tried to use TLF my FLA wouldn't compile because
of some error with my assets SWC and the TLF SWC. So I'd rather not go
there.

Maybe I can fake it by tweaking the scaleX property.

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




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


Re: [Flashcoders] Problem embedding and using a font variant

2011-04-12 Thread Matt Perkins
Thanks Glen! That did it! I was named Myriad Pro Cond

This is the little snip of Actionscript that I used:
http://snipplr.com/view/15835/list-registered-font-files/

And, Jason, it is an OTF font.

Matt


On Tue, Apr 12, 2011 at 7:18 AM, Glen Pike g...@engineeredarts.co.ukwrote:

 Have you tried enumerating your embedded fonts to see what name Flash
 gives it?

 If you embed just your Myriad Pro Condensed into a document and add the
 actionscript to list out the font name, etc.


 http://www.google.com/search?ie=UTF-8oe=UTF-8sourceid=navclientgfns=1q=as3+enumerate+font

 You might find the system gives it a different name?

 Glen


 On 11/04/2011 19:24, Matt Perkins wrote:

 I'm using Myriad Pro for regular (non TLF) dynamic text fields in my
 project
 and it's working fine. Now the client wants to use Myriad Pro Condensed
 Bold for titles and I cannot get it to show up. I can't get just Myriad
 Pro Condensed to show either. I don't have any problems with Myriad Pro
 -
 I think the condensed variant/style is causing issues. I've checked over
 and over that I have it embedded properly.

 Looks like Condensed Bold is treated as a style like bold but there's
 no
 way to set a style on a text format object.

 I even tried setting the font style via html in the text content:
 textfild.htmlText = font face='Myriad Pro Condensed'+mytext+/font;
 Didn't work.

 Any tips for using font variants like this? I'd rather keep doing it
 dynamically like this and not have to create a textfield symbol in the
 library to use (which would work). Also, this is an AS3/CS5 project.

 The TLF TextLayoutFormat has a font style property, but not sure if it
 would
 work - but the last time I tried to use TLF my FLA wouldn't compile
 because
 of some error with my assets SWC and the TLF SWC. So I'd rather not go
 there.

 Maybe I can fake it by tweaking the scaleX property.

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



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

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


RE: [Flashcoders] Problem embedding and using a font variant

2011-04-12 Thread Merrill, Jason
 To support otf, it is necessary to tell the compiler the a certain font 
 manager is to use. 
 That's not all, you need to compile with the Free SDK not the Open Source 
 SDK. 
The reason is, that the AFEFontManager is not open source and not included 
into the Open Source SDK.

Woah, good to know!  

 Jason Merrill
 Instructional Technology Architect
 Bank of America  Global Learning 





___

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Jens Struwe
Sent: Tuesday, April 12, 2011 2:39 AM
To: Flash Coders List
Subject: Re: [Flashcoders] Problem embedding and using a font variant

Don't ask me for details, but just a week ago I got this running.

[Embed(source=myfont.otf, fontFamily=myfont, 
mimeType=application/x-font-opentype)]
public var MyFont : Class;

To support otf, it is necessary to tell the compiler the a certain font manager 
is to use. I put it into my build.xml, but its easy to find the according 
command line option in the docs.

mxmlc
file=${SRC}/Movie.as
...


fonts
manager class=flash.fonts.AFEFontManager/
/fonts
...

That's not all, you need to compile with the Free SDK not the Open Source SDK. 
The reason is, that the AFEFontManager is not open source and not included into 
the Open Source SDK. Took me a while to find it out.

Best,

Jens



Am 12.04.2011 08:04, schrieb Merrill, Jason:
 Also, what is the font extension?  I have found fonts with an .otf extension 
 (like MyriadPro-Regular.otf) don't seem to embed with code.  TTF fonts work 
 for me though,  could that be the issue?  Also, in Flex (can't recall in the 
 Flash framework off the top of my head), when you embed fonts, there is an 
 option to embedAsCFF - if something like that is available, try toggling true 
 or false, sometimes that makes a difference.  Lastly, if your font is otf or 
 something non-TTF, there are some Myriad fonts for free out there that have 
 the .ttf extension, you could try downloading one of those instead.

   Jason Merrill
   Instructional Technology Architect
   Bank of America  Global Learning





 ___


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com 
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of 
 Merrill, Jason
 Sent: Monday, April 11, 2011 3:11 PM
 To: Flash Coders List
 Subject: RE: [Flashcoders] Problem embedding and using a font variant

 Well, the textField as library symbol will work fine -

 I believe the font embedding works differently with library symbols, but I 
 could be wrong.

   Jason Merrill
   Instructional Technology Architect
   Bank of America  Global Learning





 ___


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com 
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Matt 
 Perkins
 Sent: Monday, April 11, 2011 3:04 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] Problem embedding and using a font variant

 Well, the textField as library symbol will work fine - I tested that, but 
 would rather keep it pure AS.


 On Mon, Apr 11, 2011 at 2:56 PM, Merrill, Jason  
 jason.merr...@bankofamerica.com  wrote:

 I have found every now and then certain fonts don't play well with 
 Flash and there isn't much you can do if they don't work.  There are 
 a few fonts I have which simply don't embed, and the failure is silent.

   Jason Merrill
   Instructional Technology Architect
   Bank of America  Global Learning





 ___


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
 flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Matt Perkins
 Sent: Monday, April 11, 2011 2:25 PM
 To: Flash Coders List
 Subject: [Flashcoders] Problem embedding and using a font variant

 I'm using Myriad Pro for regular (non TLF) dynamic text fields in my 
 project and it's working fine. Now the client wants to use Myriad 
 Pro Condensed Bold for titles and I cannot get it to show up. I 
 can't get just Myriad Pro Condensed to show either. I don't have 
 any problems with Myriad Pro - I think the condensed 
 variant/style is causing issues. I've checked over and over that I have it 
 embedded properly.

 Looks like Condensed Bold is treated as a style like bold but 
 there's no way to set a style on a text format object.

 I even tried setting the font style via html in the text content:
 textfild.htmlText = font face='Myriad Pro 
 Condensed'+mytext+/font; Didn't work.

 Any tips for using font variants like this? I'd rather keep doing it 
 dynamically like this and not have to create a textfield symbol in 
 the library to use (which would work). Also, this is an AS3/CS5 project.

 The TLF TextLayoutFormat has a font style property, but not sure if 
 it would work - but the last time I tried to use TLF my FLA wouldn't 
 compile

[Flashcoders] Problem embedding and using a font variant

2011-04-11 Thread Matt Perkins
I'm using Myriad Pro for regular (non TLF) dynamic text fields in my project
and it's working fine. Now the client wants to use Myriad Pro Condensed
Bold for titles and I cannot get it to show up. I can't get just Myriad
Pro Condensed to show either. I don't have any problems with Myriad Pro -
I think the condensed variant/style is causing issues. I've checked over
and over that I have it embedded properly.

Looks like Condensed Bold is treated as a style like bold but there's no
way to set a style on a text format object.

I even tried setting the font style via html in the text content:
textfild.htmlText = font face='Myriad Pro Condensed'+mytext+/font;
Didn't work.

Any tips for using font variants like this? I'd rather keep doing it
dynamically like this and not have to create a textfield symbol in the
library to use (which would work). Also, this is an AS3/CS5 project.

The TLF TextLayoutFormat has a font style property, but not sure if it would
work - but the last time I tried to use TLF my FLA wouldn't compile because
of some error with my assets SWC and the TLF SWC. So I'd rather not go
there.

Maybe I can fake it by tweaking the scaleX property.

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


Re: [Flashcoders] Problem embedding and using a font variant

2011-04-11 Thread Andrew Sinning
Are you on a Mac?  Apple did an update about 10 days ago that broke
embedded fonts.

If this is the cause of your woes, you'll need to roll back to 10.6.6,
which is huge PITA.

To roll back you need to first re-install the version of 10.6.x
shipped with your machine, and then install the 10.6.6 update.

See:  http://kb2.adobe.com/cps/896/cpsid_89637.html

One other thing to note:  If you use AS to overwrite the text in a TF,
you have to use something like the following or you will lose Bold and
Italics:

tf.setNewTextFormat(tf.getTextFormat());



On Mon, Apr 11, 2011 at 1:24 PM, Matt Perkins nudoru.m...@gmail.com wrote:
 I'm using Myriad Pro for regular (non TLF) dynamic text fields in my project
 and it's working fine. Now the client wants to use Myriad Pro Condensed
 Bold for titles and I cannot get it to show up. I can't get just Myriad
 Pro Condensed to show either. I don't have any problems with Myriad Pro -
 I think the condensed variant/style is causing issues. I've checked over
 and over that I have it embedded properly.

 Looks like Condensed Bold is treated as a style like bold but there's no
 way to set a style on a text format object.

 I even tried setting the font style via html in the text content:
 textfild.htmlText = font face='Myriad Pro Condensed'+mytext+/font;
 Didn't work.

 Any tips for using font variants like this? I'd rather keep doing it
 dynamically like this and not have to create a textfield symbol in the
 library to use (which would work). Also, this is an AS3/CS5 project.

 The TLF TextLayoutFormat has a font style property, but not sure if it would
 work - but the last time I tried to use TLF my FLA wouldn't compile because
 of some error with my assets SWC and the TLF SWC. So I'd rather not go
 there.

 Maybe I can fake it by tweaking the scaleX property.

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




-- 
Andrew Sinning
LearningWare Engineer
Desk: 651-289-7373
Cell: 612-296-3646
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Problem embedding and using a font variant

2011-04-11 Thread Merrill, Jason
I have found every now and then certain fonts don't play well with Flash and 
there isn't much you can do if they don't work.  There are a few fonts I have 
which simply don't embed, and the failure is silent.  

 Jason Merrill
 Instructional Technology Architect
 Bank of America  Global Learning 





___


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Matt Perkins
Sent: Monday, April 11, 2011 2:25 PM
To: Flash Coders List
Subject: [Flashcoders] Problem embedding and using a font variant

I'm using Myriad Pro for regular (non TLF) dynamic text fields in my project 
and it's working fine. Now the client wants to use Myriad Pro Condensed Bold 
for titles and I cannot get it to show up. I can't get just Myriad Pro 
Condensed to show either. I don't have any problems with Myriad Pro - I 
think the condensed variant/style is causing issues. I've checked over and 
over that I have it embedded properly.

Looks like Condensed Bold is treated as a style like bold but there's no 
way to set a style on a text format object.

I even tried setting the font style via html in the text content:
textfild.htmlText = font face='Myriad Pro Condensed'+mytext+/font; 
Didn't work.

Any tips for using font variants like this? I'd rather keep doing it 
dynamically like this and not have to create a textfield symbol in the library 
to use (which would work). Also, this is an AS3/CS5 project.

The TLF TextLayoutFormat has a font style property, but not sure if it would 
work - but the last time I tried to use TLF my FLA wouldn't compile because of 
some error with my assets SWC and the TLF SWC. So I'd rather not go there.

Maybe I can fake it by tweaking the scaleX property.

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

--
This message w/attachments (message) is intended solely for the use of the 
intended recipient(s) and may contain information that is privileged, 
confidential or proprietary. If you are not an intended recipient, please 
notify the sender, and then please delete and destroy all copies and 
attachments, and be advised that any review or dissemination of, or the taking 
of any action in reliance on, the information contained in or attached to this 
message is prohibited. 
Unless specifically indicated, this message is not an offer to sell or a 
solicitation of any investment products or other financial product or service, 
an official confirmation of any transaction, or an official statement of 
Sender. Subject to applicable law, Sender may intercept, monitor, review and 
retain e-communications (EC) traveling through its networks/systems and may 
produce any such EC to regulators, law enforcement, in litigation and as 
required by law. 
The laws of the country of each sender/recipient may impact the handling of EC, 
and EC may be archived, supervised and produced in countries other than the 
country in which you are located. This message cannot be guaranteed to be 
secure or free of errors or viruses. 

References to Sender are references to any subsidiary of Bank of America 
Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are 
Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a 
Condition to Any Banking Service or Activity * Are Not Insured by Any Federal 
Government Agency. Attachments that are part of this EC may have additional 
important disclosures and disclaimers, which you should read. This message is 
subject to terms available at the following link: 
http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you 
consent to the foregoing.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Problem embedding and using a font variant

2011-04-11 Thread Matt Perkins
Nah, I'm on Windows 7. I've seen the mess with 10.6.7 - glad I'm not on a
Mac now!


On Mon, Apr 11, 2011 at 2:54 PM, Andrew Sinning and...@learningware.comwrote:

 Are you on a Mac?  Apple did an update about 10 days ago that broke
 embedded fonts.

 If this is the cause of your woes, you'll need to roll back to 10.6.6,
 which is huge PITA.

 To roll back you need to first re-install the version of 10.6.x
 shipped with your machine, and then install the 10.6.6 update.

 See:  http://kb2.adobe.com/cps/896/cpsid_89637.html

 One other thing to note:  If you use AS to overwrite the text in a TF,
 you have to use something like the following or you will lose Bold and
 Italics:

tf.setNewTextFormat(tf.getTextFormat());



 On Mon, Apr 11, 2011 at 1:24 PM, Matt Perkins nudoru.m...@gmail.com
 wrote:
  I'm using Myriad Pro for regular (non TLF) dynamic text fields in my
 project
  and it's working fine. Now the client wants to use Myriad Pro Condensed
  Bold for titles and I cannot get it to show up. I can't get just Myriad
  Pro Condensed to show either. I don't have any problems with Myriad
 Pro -
  I think the condensed variant/style is causing issues. I've checked
 over
  and over that I have it embedded properly.
 
  Looks like Condensed Bold is treated as a style like bold but there's
 no
  way to set a style on a text format object.
 
  I even tried setting the font style via html in the text content:
  textfild.htmlText = font face='Myriad Pro
 Condensed'+mytext+/font;
  Didn't work.
 
  Any tips for using font variants like this? I'd rather keep doing it
  dynamically like this and not have to create a textfield symbol in the
  library to use (which would work). Also, this is an AS3/CS5 project.
 
  The TLF TextLayoutFormat has a font style property, but not sure if it
 would
  work - but the last time I tried to use TLF my FLA wouldn't compile
 because
  of some error with my assets SWC and the TLF SWC. So I'd rather not go
  there.
 
  Maybe I can fake it by tweaking the scaleX property.
 
  Thanks,
  Matt
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 



 --
 Andrew Sinning
 LearningWare Engineer
 Desk: 651-289-7373
 Cell: 612-296-3646
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


Re: [Flashcoders] Problem embedding and using a font variant

2011-04-11 Thread Matt Perkins
Well, the textField as library symbol will work fine - I tested that, but
would rather keep it pure AS.


On Mon, Apr 11, 2011 at 2:56 PM, Merrill, Jason 
jason.merr...@bankofamerica.com wrote:

 I have found every now and then certain fonts don't play well with Flash
 and there isn't much you can do if they don't work.  There are a few fonts I
 have which simply don't embed, and the failure is silent.

  Jason Merrill
  Instructional Technology Architect
  Bank of America  Global Learning





 ___


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
 flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Matt Perkins
 Sent: Monday, April 11, 2011 2:25 PM
 To: Flash Coders List
 Subject: [Flashcoders] Problem embedding and using a font variant

 I'm using Myriad Pro for regular (non TLF) dynamic text fields in my
 project and it's working fine. Now the client wants to use Myriad Pro
 Condensed Bold for titles and I cannot get it to show up. I can't get just
 Myriad Pro Condensed to show either. I don't have any problems with
 Myriad Pro - I think the condensed variant/style is causing issues. I've
 checked over and over that I have it embedded properly.

 Looks like Condensed Bold is treated as a style like bold but there's
 no way to set a style on a text format object.

 I even tried setting the font style via html in the text content:
 textfild.htmlText = font face='Myriad Pro Condensed'+mytext+/font;
 Didn't work.

 Any tips for using font variants like this? I'd rather keep doing it
 dynamically like this and not have to create a textfield symbol in the
 library to use (which would work). Also, this is an AS3/CS5 project.

 The TLF TextLayoutFormat has a font style property, but not sure if it
 would work - but the last time I tried to use TLF my FLA wouldn't compile
 because of some error with my assets SWC and the TLF SWC. So I'd rather not
 go there.

 Maybe I can fake it by tweaking the scaleX property.

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

 --
 This message w/attachments (message) is intended solely for the use of the
 intended recipient(s) and may contain information that is privileged,
 confidential or proprietary. If you are not an intended recipient, please
 notify the sender, and then please delete and destroy all copies and
 attachments, and be advised that any review or dissemination of, or the
 taking of any action in reliance on, the information contained in or
 attached to this message is prohibited.
 Unless specifically indicated, this message is not an offer to sell or a
 solicitation of any investment products or other financial product or
 service, an official confirmation of any transaction, or an official
 statement of Sender. Subject to applicable law, Sender may intercept,
 monitor, review and retain e-communications (EC) traveling through its
 networks/systems and may produce any such EC to regulators, law enforcement,
 in litigation and as required by law.
 The laws of the country of each sender/recipient may impact the handling of
 EC, and EC may be archived, supervised and produced in countries other than
 the country in which you are located. This message cannot be guaranteed to
 be secure or free of errors or viruses.

 References to Sender are references to any subsidiary of Bank of America
 Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are
 Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a
 Condition to Any Banking Service or Activity * Are Not Insured by Any
 Federal Government Agency. Attachments that are part of this EC may have
 additional important disclosures and disclaimers, which you should read.
 This message is subject to terms available at the following link:
 http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you
 consent to the foregoing.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


RE: [Flashcoders] Problem embedding and using a font variant

2011-04-11 Thread Merrill, Jason
 Well, the textField as library symbol will work fine -

I believe the font embedding works differently with library symbols, but I 
could be wrong.

 Jason Merrill
 Instructional Technology Architect
 Bank of America  Global Learning 





___


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Matt Perkins
Sent: Monday, April 11, 2011 3:04 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Problem embedding and using a font variant

Well, the textField as library symbol will work fine - I tested that, but would 
rather keep it pure AS.


On Mon, Apr 11, 2011 at 2:56 PM, Merrill, Jason  
jason.merr...@bankofamerica.com wrote:

 I have found every now and then certain fonts don't play well with 
 Flash and there isn't much you can do if they don't work.  There are a 
 few fonts I have which simply don't embed, and the failure is silent.

  Jason Merrill
  Instructional Technology Architect
  Bank of America  Global Learning





 ___


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
 flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Matt Perkins
 Sent: Monday, April 11, 2011 2:25 PM
 To: Flash Coders List
 Subject: [Flashcoders] Problem embedding and using a font variant

 I'm using Myriad Pro for regular (non TLF) dynamic text fields in my 
 project and it's working fine. Now the client wants to use Myriad Pro 
 Condensed Bold for titles and I cannot get it to show up. I can't get 
 just Myriad Pro Condensed to show either. I don't have any problems 
 with Myriad Pro - I think the condensed variant/style is causing 
 issues. I've checked over and over that I have it embedded properly.

 Looks like Condensed Bold is treated as a style like bold but 
 there's no way to set a style on a text format object.

 I even tried setting the font style via html in the text content:
 textfild.htmlText = font face='Myriad Pro 
 Condensed'+mytext+/font; Didn't work.

 Any tips for using font variants like this? I'd rather keep doing it 
 dynamically like this and not have to create a textfield symbol in the 
 library to use (which would work). Also, this is an AS3/CS5 project.

 The TLF TextLayoutFormat has a font style property, but not sure if it 
 would work - but the last time I tried to use TLF my FLA wouldn't 
 compile because of some error with my assets SWC and the TLF SWC. So 
 I'd rather not go there.

 Maybe I can fake it by tweaking the scaleX property.

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

 --
 This message w/attachments (message) is intended solely for the use of 
 the intended recipient(s) and may contain information that is 
 privileged, confidential or proprietary. If you are not an intended 
 recipient, please notify the sender, and then please delete and 
 destroy all copies and attachments, and be advised that any review or 
 dissemination of, or the taking of any action in reliance on, the 
 information contained in or attached to this message is prohibited.
 Unless specifically indicated, this message is not an offer to sell or 
 a solicitation of any investment products or other financial product 
 or service, an official confirmation of any transaction, or an 
 official statement of Sender. Subject to applicable law, Sender may 
 intercept, monitor, review and retain e-communications (EC) traveling 
 through its networks/systems and may produce any such EC to 
 regulators, law enforcement, in litigation and as required by law.
 The laws of the country of each sender/recipient may impact the 
 handling of EC, and EC may be archived, supervised and produced in 
 countries other than the country in which you are located. This 
 message cannot be guaranteed to be secure or free of errors or viruses.

 References to Sender are references to any subsidiary of Bank of 
 America Corporation. Securities and Insurance Products: * Are Not FDIC 
 Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank 
 Deposit * Are Not a Condition to Any Banking Service or Activity * Are 
 Not Insured by Any Federal Government Agency. Attachments that are 
 part of this EC may have additional important disclosures and disclaimers, 
 which you should read.
 This message is subject to terms available at the following link:
 http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender 
 you consent to the foregoing.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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

[Flashcoders] Problem with XML.childIndex()

2011-02-17 Thread Glen Pike

Hi,

I am having a problem with getting the childIndex value from an e4x 
result:


Both these functions work - e.g. they return an XML node from a 
list, but the childIndex property always traces as -1 for the first 
function.


Can anyone see what the problem is?

TIA

Glen

public function getAssetDetails(prop:*):XML {
if (!_assets) {
return null;
}
var res:XMLList = _assets.(child(number) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}
}

override public function getAssetDetails(prop:*):XML {
if (!_assets) {
return null;
}
   var res:XMLList = _assets.(attribute(icon) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Problem with XML.childIndex()

2011-02-17 Thread Jens Struwe

Try:

var res : XMLList = _assets.child(number).(text() == prop);
var res:XMLList = _assets.*.(attribute(icon) == String(prop));

Jens


Am 17.02.2011 11:08, schrieb Glen Pike:

Hi,

I am having a problem with getting the childIndex value from an e4x result:

Both these functions work - e.g. they return an XML node from a list,
but the childIndex property always traces as -1 for the first function.

Can anyone see what the problem is?

TIA

Glen

public function getAssetDetails(prop:*):XML {
if (!_assets) {
return null;
}
var res:XMLList = _assets.(child(number) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}
}

override public function getAssetDetails(prop:*):XML {
if (!_assets) {
return null;
}
var res:XMLList = _assets.(attribute(icon) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



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


Re: [Flashcoders] Problem with XML.childIndex()

2011-02-17 Thread Glen Pike
Hmm, they just return the number node from a matching asset in the 
list, but if I do this:


var res : XMLList = _assets.child(number).(text() == prop);
if (0 != res.length()) {
trace(this, getAssetDetails  + res[0].parent().childIndex());
return res[0].parent();
}

I still have the same problem even using the parent???


On 17/02/2011 11:24, Jens Struwe wrote:

Try:

var res : XMLList = _assets.child(number).(text() == prop);
var res:XMLList = _assets.*.(attribute(icon) == String(prop));

Jens


Am 17.02.2011 11:08, schrieb Glen Pike:

Hi,

I am having a problem with getting the childIndex value from an e4x 
result:


Both these functions work - e.g. they return an XML node from a list,
but the childIndex property always traces as -1 for the first function.

Can anyone see what the problem is?

TIA

Glen

public function getAssetDetails(prop:*):XML {
if (!_assets) {
return null;
}
var res:XMLList = _assets.(child(number) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}
}

override public function getAssetDetails(prop:*):XML {
if (!_assets) {
return null;
}
var res:XMLList = _assets.(attribute(icon) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



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




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


Re: [Flashcoders] Problem with XML.childIndex()

2011-02-17 Thread Jens Struwe

May I refine your question?

I have an XML tree. How can I select nodes depending on the value of 
subnodes or the value of subnode attributes.


Anyway, you should provide a simple test XML that does not work.

Here my next try. When I understand right then you want to select assets 
depending on their number or icon. To make it even more illustrative, I 
have nested the asset values within a data tag.


private var _assets : XML =
assets
asset
data
number1/number
item icon=topTOP/item
/data
/asset
asset
data
number2/number
item icon=rightRIGHT/item
/data
/asset
asset
data
number3/number
item icon=bottomBOTTOM/item
/data
/asset
asset
data
number4/number
item icon=downDOWN/item
/data
/asset
/assets
;

public function XMLTest() {
trace(_assets.*.(data.number == 2));
trace(_assets.*.(data.*.@icon == down));
}




Am 17.02.2011 12:58, schrieb Glen Pike:

Hmm, they just return the number node from a matching asset in the
list, but if I do this:

var res : XMLList = _assets.child(number).(text() == prop);
if (0 != res.length()) {
trace(this, getAssetDetails  + res[0].parent().childIndex());
return res[0].parent();
}

I still have the same problem even using the parent???


On 17/02/2011 11:24, Jens Struwe wrote:

Try:

var res : XMLList = _assets.child(number).(text() == prop);
var res:XMLList = _assets.*.(attribute(icon) == String(prop));

Jens


Am 17.02.2011 11:08, schrieb Glen Pike:

Hi,

I am having a problem with getting the childIndex value from an e4x
result:

Both these functions work - e.g. they return an XML node from a list,
but the childIndex property always traces as -1 for the first function.

Can anyone see what the problem is?

TIA

Glen

public function getAssetDetails(prop:*):XML {
if (!_assets) {
return null;
}
var res:XMLList = _assets.(child(number) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}
}

override public function getAssetDetails(prop:*):XML {
if (!_assets) {
return null;
}
var res:XMLList = _assets.(attribute(icon) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



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




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



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


Re: [Flashcoders] Problem with XML.childIndex()

2011-02-17 Thread Glen Pike

Hi,

The problem is not getting the assets - this works for both example 
functions.


The problem is that when I try to trace the childIndex() of the 
asset that has been found, it always returns -1 for the asset obtained 
by matching the child rather than the attribute.


So the following e4x works, but the childIndex value does not.

var res:XMLList = _assets.(child(number) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}

Here is a much shortened list of assets:

entity
id524/id
number2001/number
name![CDATA[Hello]]/name
description![CDATA[Compose Audio]]/description
type1/type
events_count1/events_count

length0.85/length
outputs
/outputs
/entity
entity
id527/id
number2004/number

name![CDATA[Cry]]/name
description![CDATA[Compose Audio]]/description
type1/type
events_count1/events_count
length2.63/length
outputs
/outputs

/entity
entity
id530/id
number2007/number
name![CDATA[Sob]]/name
description![CDATA[Compose Audio]]/description
type1/type

events_count1/events_count
length2.02/length
outputs
/outputs
/entity

On 17/02/2011 12:30, Jens Struwe wrote:

May I refine your question?

I have an XML tree. How can I select nodes depending on the value of 
subnodes or the value of subnode attributes.


Hi,


I am having a problem with getting the childIndex value from an e4x
result:

Both these functions work - e.g. they return an XML node from a list,
but the childIndex property always traces as -1 for the first 
function.


Can anyone see what the problem is?

TIA

Glen

public function getAssetDetails(prop:*):XML {
if (!_assets) {
return null;
}
var res:XMLList = _assets.(child(number) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}
}

override public function getAssetDetails(prop:*):XML {
if (!_assets) {
return null;
}
var res:XMLList = _assets.(attribute(icon) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



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




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



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




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


Re: [Flashcoders] Problem with XML.childIndex()

2011-02-17 Thread Jens Struwe

Thanks for the XML. Given this, the method works as expected:

getAssetByNumber(2001);
getAssetByNumber(2004);
getAssetByNumber(2007);

public function getAssetByNumber(theNumber : int):XML {
if (!_assets) return null;
var res : XMLList = _assets.*.(number == theNumber);
if (0 != res.length()) {
trace(this, getAssetDetails  + XML(res[0]).childIndex());
return res[0];
} else {
return null;
}
}

-

[object XMLTest] getAssetDetails 0
[object XMLTest] getAssetDetails 1
[object XMLTest] getAssetDetails 2



Am 17.02.2011 13:43, schrieb Glen Pike:

Hi,

The problem is not getting the assets - this works for both example
functions.

The problem is that when I try to trace the childIndex() of the asset
that has been found, it always returns -1 for the asset obtained by
matching the child rather than the attribute.

So the following e4x works, but the childIndex value does not.

var res:XMLList = _assets.(child(number) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}

Here is a much shortened list of assets:

entity
id524/id
number2001/number
name![CDATA[Hello]]/name
description![CDATA[Compose Audio]]/description
type1/type
events_count1/events_count

length0.85/length
outputs
/outputs
/entity
entity
id527/id
number2004/number

name![CDATA[Cry]]/name
description![CDATA[Compose Audio]]/description
type1/type
events_count1/events_count
length2.63/length
outputs
/outputs

/entity
entity
id530/id
number2007/number
name![CDATA[Sob]]/name
description![CDATA[Compose Audio]]/description
type1/type

events_count1/events_count
length2.02/length
outputs
/outputs
/entity

On 17/02/2011 12:30, Jens Struwe wrote:

May I refine your question?

I have an XML tree. How can I select nodes depending on the value of
subnodes or the value of subnode attributes.

Hi,


I am having a problem with getting the childIndex value from an e4x
result:

Both these functions work - e.g. they return an XML node from a list,
but the childIndex property always traces as -1 for the first
function.

Can anyone see what the problem is?

TIA

Glen

public function getAssetDetails(prop:*):XML {
if (!_assets) {
return null;
}
var res:XMLList = _assets.(child(number) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}
}

override public function getAssetDetails(prop:*):XML {
if (!_assets) {
return null;
}
var res:XMLList = _assets.(attribute(icon) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



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




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



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




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



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


Re: [Flashcoders] Problem with XML.childIndex()

2011-02-17 Thread Glen Pike
Thank you - I have discovered the problem now - I was making a copy the 
XML for an asset when creating a list of items, which broke the indexing 
because the copy was not related to the original, e.g.


for (var i:int = 0; i  len;i++ ) {
//Making a copy of the node means that getAssetDetails.
var asset:XML = _assets[i].copy();
dp.addItem({label:asset.child(number) + :  
+asset.child(name), data:asset.name});

}

Incidentally - the getAssetByNumber would not have been possible as I am 
programming to an API which compares objects of various types against 
the XML so I have to use getAssetDetails(prop:*)


Thank you for your help :)

Glen

On 17/02/2011 13:13, Jens Struwe wrote:

Thanks for the XML. Given this, the method works as expected:

getAssetByNumber(2001);
getAssetByNumber(2004);
getAssetByNumber(2007);

public function getAssetByNumber(theNumber : int):XML {
if (!_assets) return null;
var res : XMLList = _assets.*.(number == theNumber);
if (0 != res.length()) {
trace(this, getAssetDetails  + XML(res[0]).childIndex());
return res[0];
} else {
return null;
}
}

-

[object XMLTest] getAssetDetails 0
[object XMLTest] getAssetDetails 1
[object XMLTest] getAssetDetails 2



Am 17.02.2011 13:43, schrieb Glen Pike:

Hi,

The problem is not getting the assets - this works for both example
functions.

The problem is that when I try to trace the childIndex() of the asset
that has been found, it always returns -1 for the asset obtained by
matching the child rather than the attribute.

So the following e4x works, but the childIndex value does not.

var res:XMLList = _assets.(child(number) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}

Here is a much shortened list of assets:

entity
id524/id
number2001/number
name![CDATA[Hello]]/name
description![CDATA[Compose Audio]]/description
type1/type
events_count1/events_count

length0.85/length
outputs
/outputs
/entity
entity
id527/id
number2004/number

name![CDATA[Cry]]/name
description![CDATA[Compose Audio]]/description
type1/type
events_count1/events_count
length2.63/length
outputs
/outputs

/entity
entity
id530/id
number2007/number
name![CDATA[Sob]]/name
description![CDATA[Compose Audio]]/description
type1/type

events_count1/events_count
length2.02/length
outputs
/outputs
/entity

On 17/02/2011 12:30, Jens Struwe wrote:

May I refine your question?

I have an XML tree. How can I select nodes depending on the value of
subnodes or the value of subnode attributes.

Hi,


I am having a problem with getting the childIndex value from an e4x
result:

Both these functions work - e.g. they return an XML node from a 
list,

but the childIndex property always traces as -1 for the first
function.

Can anyone see what the problem is?

TIA

Glen

public function getAssetDetails(prop:*):XML {
if (!_assets) {
return null;
}
var res:XMLList = _assets.(child(number) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}
}

override public function getAssetDetails(prop:*):XML {
if (!_assets) {
return null;
}
var res:XMLList = _assets.(attribute(icon) == String(prop));
if (0 != res.length()) {
debug(this, getAssetDetails  + res[0].childIndex());
return res[0];
} else {
return null;
}
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



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




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



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




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



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




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


Re: [Flashcoders] problem with adding two digits

2010-12-19 Thread Anthony Pace

to prevent anyone answering on this thread:
after toying with it again, and reading the docs + wikipedia I figured 
out that I can only trust a result of 15 digits or less, unless I have 
the string be returned instead of the number.


n 12/18/2010 8:34 PM, Anthony Pace wrote:


function floatSumV3(roundDown:Boolean = true, ... nums):Number{
var nl:uint = nums.length;
var ls:Number=0; //left side
var pp:int; //period position
var rs:Number = 1; //right side
var rsl:int; //right side length
var ml:int = 0; //max length right side
var powerCounter:int = 1;
var powerResult:int;
var s:String;
for (var i:int = 0; i nl; ++i) {
s = nums[i].toString();
pp = s.indexOf('.');
if(pp!=-1){
rsl = s.length - pp-1;
if(rslml){
p


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


Re: [Flashcoders] problem with adding two digits

2010-12-18 Thread Anthony Pace

whoa... hold on Help Please.

After I posted yesterday, (or the night before??? can't remember) as I 
realized how badly the code sucked, I was just messing around with this 
code below to see if I could separate the halves and recompose them 
properly; however,

if you pop the code below on the timeline, you will see why I am confused.

I know it's not the greatest piece of code in the world, especially 
since I was just messing around mentally, but it should work.  Why is 
the process of converting to a Number adding .1


function floatSumV3(roundDown:Boolean = true, ... nums):Number{
var nl:uint = nums.length;
var ls:Number=0; //left side
var pp:int; //period position
var rs:Number = 1; //right side
var rsl:int; //right side length
var ml:int = 0; //max length right side
var powerCounter:int = 1;
var powerResult:int;
var s:String;
for (var i:int = 0; i nl; ++i) {
s = nums[i].toString();
pp = s.indexOf('.');
if(pp!=-1){
rsl = s.length - pp-1;
if(rslml){
powerCounter = rsl - ml;
powerResult=1;
while(powerCounter!=0){
powerResult *= 10;
powerCounter -= 1;
}
rs *= powerResult;
rs += Number(s.substr(pp+1));
ml=rsl;
//trace('ml = '+ml+', rs = '+ rs);
}else if (rslml){
powerCounter = ml-rsl;
powerResult=1;
while(powerCounter!=0){
powerResult*= 10;
powerCounter -= 1;
}
rs += Number(s.substr(pp+1)) * powerResult;
}else {
rs+=Number(s.substr(pp+1));
}

ls += Number(s.substr(0,pp));
//trace('numls = ' + s.substr(0,pp));
//trace('ls = ' + ls);
}else{
ls +=Number(s);
//trace('ls = ' + s);
//trace('ls = ' + ls);
}

}
s = rs.toString();
if(s.lengthml){
ls += Number(s.substr(0,s.length - ml))-1;
}
s=ls+.+s.substr(s.length-ml);
trace(s, = initial string value);
if(s.length  16  roundDown == true){
if(ls.toString().length==16){
s = s.substr(0,18);

}else if(ls.toString().length16){
s = ls.toString();
}
else{
s = s.substr(0,17);

}
}
trace(s, = string value after checks);
return Number(s);
}
trace(floatSumV3(false,990.9,.09,.009,0.0009,1,0.2,0.01,0.01,0.01,1000.0001));
trace(floatSumV3(true, 
990.9,.09,.009,0.0009,1,0.2,0.01,0.01,0.01,1000.0001));







On 12/15/2010 2:31 PM, Anthony Pace wrote:

Oh yeah, I forgot to give some examples to test it with, so...

trace(floatSum(-0.1,0.9155,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1));
//vs
trace(-0.1+0.9155+0.1+0.1+0.1+0.1+0.1+0.1+0.1+0.1);
//and
trace(floatProduct(2.1,0.1,1.0001,.0001));
//vs
trace(2.1*0.1*1.0001*.0001);


On 12/15/2010 2:25 PM, Anthony Pace wrote:
I wrote the functions below in literally just a few min, so, even 
though they do seem to work for me, I wouldn't necessarily say they 
are production ready.


Also, I would only use these if you will know that the numbers past 
the mantissa are of small amounts.


Oh yeah, and please tell me if I screwed up somewhere, or if you 
think you can do it better :)


function floatProduct(... nums){
var ml:int = 0; //max length past mantissa
var ln:uint = nums.length;
var rsl:int; //right side length
var p:Number = 1;
var s:String;
for (var i:uint = 0; i ln; ++i) {
s = nums[i].toString();
rsl = s.length - s.indexOf('.');
ml += rsl;
p *= nums[i];
}
return Number(p.toFixed(ml));
}
function floatSum(... nums){
var ml:int = 0; //max length past mantissa
var ln:uint = nums.length;
var rsl:int; //right side length
var p:Number = 0;
var s:String;
for (var i:int = 0; i ln; ++i) {
s = nums[i].toString();
rsl = s.length - s.indexOf('.');
if (rsl  ml) {
ml = rsl;
}
p += nums[i];
}
return Number(p.toFixed(ml));
}


-




On 12/14/2010 12:05 PM, Kerry Thompson wrote:

Adrian ZajÄ…c wrote:



trace (0.27 + 0.03);   // output --  0.30004

Can anyone tell me why I get this weird result in output window?


As people have said, it's a problem with decimals. It's not a 
problem with

Flash--it's a problem with binary numbers.

Integers are accurate because all integers are a multiple of 1, and 
binary
does just fine with combining 0's and 1's, the only possibile values 
of a

digit in the binary system.

If you think of decimals as fractions, maybe it will help you 
understand the
issue. In binary, a digit can only be a multiple of 2: 1/2, 1/4, 
1/8/ 1/16,

1/32, and so on. You can create numbers that aren't 

Re: [Flashcoders] problem with adding two digits

2010-12-15 Thread Anthony Pace
I wrote the functions below in literally just a few min, so, even though 
they do seem to work for me, I wouldn't necessarily say they are 
production ready.


Also, I would only use these if you will know that the numbers past the 
mantissa are of small amounts.


Oh yeah, and please tell me if I screwed up somewhere, or if you think 
you can do it better :)


function floatProduct(... nums){
var ml:int = 0; //max length past mantissa
var ln:uint = nums.length;
var rsl:int; //right side length
var p:Number = 1;
var s:String;
for (var i:uint = 0; i ln; ++i) {
s = nums[i].toString();
rsl = s.length - s.indexOf('.');
ml += rsl;
p *= nums[i];
}
return Number(p.toFixed(ml));
}
function floatSum(... nums){
var ml:int = 0; //max length past mantissa
var ln:uint = nums.length;
var rsl:int; //right side length
var p:Number = 0;
var s:String;
for (var i:int = 0; i ln; ++i) {
s = nums[i].toString();
rsl = s.length - s.indexOf('.');
if (rsl  ml) {
ml = rsl;
}
p += nums[i];
}
return Number(p.toFixed(ml));
}


-




On 12/14/2010 12:05 PM, Kerry Thompson wrote:

Adrian ZajÄ…c wrote:



trace (0.27 + 0.03);   // output --  0.30004

Can anyone tell me why I get this weird result in output window?


As people have said, it's a problem with decimals. It's not a problem with
Flash--it's a problem with binary numbers.

Integers are accurate because all integers are a multiple of 1, and binary
does just fine with combining 0's and 1's, the only possibile values of a
digit in the binary system.

If you think of decimals as fractions, maybe it will help you understand the
issue. In binary, a digit can only be a multiple of 2: 1/2, 1/4, 1/8/ 1/16,
1/32, and so on. You can create numbers that aren't multiples of two by
adding multiple digits. For example, 1/4 + 1/8 = 3/8, or .375.

This works pretty well, until you get numbers with a lot of decimal places.
At some point, you will find a decimal that is impossible to make using
powers of 2.

Cordially,

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



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


Re: [Flashcoders] problem with adding two digits

2010-12-15 Thread Anthony Pace

Oh yeah, I forgot to give some examples to test it with, so...

trace(floatSum(-0.1,0.9155,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1));
//vs
trace(-0.1+0.9155+0.1+0.1+0.1+0.1+0.1+0.1+0.1+0.1);
//and
trace(floatProduct(2.1,0.1,1.0001,.0001));
//vs
trace(2.1*0.1*1.0001*.0001);


On 12/15/2010 2:25 PM, Anthony Pace wrote:
I wrote the functions below in literally just a few min, so, even 
though they do seem to work for me, I wouldn't necessarily say they 
are production ready.


Also, I would only use these if you will know that the numbers past 
the mantissa are of small amounts.


Oh yeah, and please tell me if I screwed up somewhere, or if you think 
you can do it better :)


function floatProduct(... nums){
var ml:int = 0; //max length past mantissa
var ln:uint = nums.length;
var rsl:int; //right side length
var p:Number = 1;
var s:String;
for (var i:uint = 0; i ln; ++i) {
s = nums[i].toString();
rsl = s.length - s.indexOf('.');
ml += rsl;
p *= nums[i];
}
return Number(p.toFixed(ml));
}
function floatSum(... nums){
var ml:int = 0; //max length past mantissa
var ln:uint = nums.length;
var rsl:int; //right side length
var p:Number = 0;
var s:String;
for (var i:int = 0; i ln; ++i) {
s = nums[i].toString();
rsl = s.length - s.indexOf('.');
if (rsl  ml) {
ml = rsl;
}
p += nums[i];
}
return Number(p.toFixed(ml));
}


-




On 12/14/2010 12:05 PM, Kerry Thompson wrote:

Adrian ZajÄ…c wrote:



trace (0.27 + 0.03);   // output --  0.30004

Can anyone tell me why I get this weird result in output window?


As people have said, it's a problem with decimals. It's not a problem 
with

Flash--it's a problem with binary numbers.

Integers are accurate because all integers are a multiple of 1, and 
binary
does just fine with combining 0's and 1's, the only possibile values 
of a

digit in the binary system.

If you think of decimals as fractions, maybe it will help you 
understand the
issue. In binary, a digit can only be a multiple of 2: 1/2, 1/4, 1/8/ 
1/16,

1/32, and so on. You can create numbers that aren't multiples of two by
adding multiple digits. For example, 1/4 + 1/8 = 3/8, or .375.

This works pretty well, until you get numbers with a lot of decimal 
places.

At some point, you will find a decimal that is impossible to make using
powers of 2.

Cordially,

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



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



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


[Flashcoders] problem with adding two digits

2010-12-14 Thread Adrian ZajÄ…c

Hello,

First of all, I want to say Hi to everyone here. This is my first post.


Please, take a look at this part of code:

trace (0.27 + 0.03);   // output -- 0.30004

Can anyone tell me why I get this weird result in output window?


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


RE: [Flashcoders] problem with adding two digits

2010-12-14 Thread Steve Abaffy
It has to do with the fact that computers have to convert all numbers to binary 
then perform math on those numbers and then convert back to decimal. In the 
process of this conversion you get results like these.

If you need the addition to be accurate and you know that the numbers will 
always be decimals you can multiply the numbers by 100 and then you will add 27 
+ 3 which  will return 30 and then divide it by 100 to get your .3 (or at least 
I think that will work as I have not tried it)

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Adrian Zajac
Sent: Tuesday, December 14, 2010 8:43 AM
To: Flash Coders List
Subject: [Flashcoders] problem with adding two digits

Hello,

First of all, I want to say Hi to everyone here. This is my first post.


Please, take a look at this part of code:

 trace (0.27 + 0.03);   // output -- 0.30004

Can anyone tell me why I get this weird result in output window?


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


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


Re: [Flashcoders] problem with adding two digits

2010-12-14 Thread tom rhodes
same here compiling for flash player 10 and flash player 9, 8 and below give
0.3 as expected


On 14 December 2010 15:42, Adrian ZajÄ…c zajac.adr...@gmail.com wrote:

 trace (0.27 + 0.03);
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] problem with adding two digits

2010-12-14 Thread Adrian ZajÄ…c


If you need the addition to be accurate and you know that the numbers will 
always be decimals you can multiply the numbers by 100 and then you will add 27 
+ 3 which  will return 30 and then divide it by 100 to get your .3 (or at least 
I think that will work as I have not tried it)
   


Yes Steve, probably this is the best solution. But still I want to know 
why is it working in that way.

Funny thing with  flash player versions...  Tom, thanks for checking it out.


W dniu 2010-12-14 16:15, tom rhodes pisze:

same here compiling for flash player 10 and flash player 9, 8 and below give
0.3 as expected


On 14 December 2010 15:42, Adrian ZajÄ…czajac.adr...@gmail.com  wrote:

   

trace (0.27 + 0.03);
 

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


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


Re: [Flashcoders] problem with adding two digits

2010-12-14 Thread Karim Beyrouti
It's an issue with floating point accuracy/calculations, 

Here is some info:
http://joshblog.net/2007/01/30/flash-floating-point-number-errors/
saw more about it somewhere else... don't think it's an issue with the FP tho'.


- Karim

On 14 Dec 2010, at 15:15, tom rhodes wrote:

 same here compiling for flash player 10 and flash player 9, 8 and below give
 0.3 as expected
 
 
 On 14 December 2010 15:42, Adrian ZajÄ…c zajac.adr...@gmail.com wrote:
 
 trace (0.27 + 0.03);
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


Re: [Flashcoders] problem with adding two digits

2010-12-14 Thread Zeh Fernando
I like to quote this, from PHP.net's Floating Point documentation:

Floating point numbers have limited precision. Although it depends on the
system, PHP typically uses the IEEE 754 double precision format, which will
give a maximum relative error due to rounding in the order of 1.11e-16. Non
elementary arithmetic operations may give larger errors, and, of course,
error propagation must be considered when several operations are compounded.

Additionally, rational numbers that are exactly representable as floating
point numbers in base 10, like 0.1 or 0.7, do not have an exact
representation as floating point numbers in base 2, which is used
internally, no matter the size of the mantissa. Hence, they cannot be
converted into their internal binary counterparts without a small loss of
precision. This can lead to confusing results: for example,
floor((0.1+0.7)*10) will usually return 7 instead of the expected 8, since
the internal representation will be something like 7.9991118

So never trust floating number results to the last digit, and never compare
floating point numbers for equality.

Additional, interesting read:
http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
On Tue, Dec 14, 2010 at 10:15 AM, tom rhodes tom.rho...@gmail.com wrote:

 same here compiling for flash player 10 and flash player 9, 8 and below
 give
 0.3 as expected


 On 14 December 2010 15:42, Adrian ZajÄ…c zajac.adr...@gmail.com wrote:

  trace (0.27 + 0.03);
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


Re: [Flashcoders] problem with adding two digits

2010-12-14 Thread John R. Sweeney Jr
Howdy Adrian,

Here is one way.

trace (int((0.27 + 0.03)*100)/100)   // output --  0.3


Later,
John


on 12/14/10 8:42 AM, Adrian ZajÄ…c at zajac.adr...@gmail.com wrote:

 Hello,
 
 First of all, I want to say Hi to everyone here. This is my first post.
 
 
 Please, take a look at this part of code:
 
  trace (0.27 + 0.03);   // output -- 0.30004
 
 Can anyone tell me why I get this weird result in output window?
 
 
 Regards
 Adrian


John R. Sweeney Jr.
Interactive Multimedia Developer


OnDemand Interactive Inc
945 Washington Blvd.
Hoffman Estates, IL 60169
Office/Fax: 847.310.5959
Cellular: 847.651.4469
www.ondemandinteractive.com



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


Re: [Flashcoders] problem with adding two digits

2010-12-14 Thread tom rhodes
yup interesting that the old AVM gives you what you'd think...


On 14 December 2010 16:36, Zeh Fernando z...@zehfernando.com wrote:

 I like to quote this, from PHP.net's Floating Point documentation:

 Floating point numbers have limited precision. Although it depends on the
 system, PHP typically uses the IEEE 754 double precision format, which will
 give a maximum relative error due to rounding in the order of 1.11e-16. Non
 elementary arithmetic operations may give larger errors, and, of course,
 error propagation must be considered when several operations are
 compounded.

 Additionally, rational numbers that are exactly representable as floating
 point numbers in base 10, like 0.1 or 0.7, do not have an exact
 representation as floating point numbers in base 2, which is used
 internally, no matter the size of the mantissa. Hence, they cannot be
 converted into their internal binary counterparts without a small loss of
 precision. This can lead to confusing results: for example,
 floor((0.1+0.7)*10) will usually return 7 instead of the expected 8, since
 the internal representation will be something like
 7.9991118

 So never trust floating number results to the last digit, and never compare
 floating point numbers for equality.

 Additional, interesting read:
 http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
 http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
 On Tue, Dec 14, 2010 at 10:15 AM, tom rhodes tom.rho...@gmail.com wrote:

  same here compiling for flash player 10 and flash player 9, 8 and below
  give
  0.3 as expected
 
 
  On 14 December 2010 15:42, Adrian ZajÄ…c zajac.adr...@gmail.com wrote:
 
   trace (0.27 + 0.03);
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


Re: [Flashcoders] problem with adding two digits

2010-12-14 Thread Henrik Andersson

tom rhodes skriver:

yup interesting that the old AVM gives you what you'd think...


Pure luck, you might have compiled against something that happened to 
drop the decimal instead .


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


Re: [Flashcoders] problem with adding two digits

2010-12-14 Thread Adrian ZajÄ…c

Thanks Zeh, now I understand.

So do we have to keep an eye on our variables so we don't have for 
example:7.998 * 0,3004  ?
Because I think it is a little heavier for processors to count than:  8 
* 0.3



W dniu 2010-12-14 16:36, Zeh Fernando pisze:

I like to quote this, from PHP.net's Floating Point documentation:

Floating point numbers have limited precision. Although it depends on the
system, PHP typically uses the IEEE 754 double precision format, which will
give a maximum relative error due to rounding in the order of 1.11e-16. Non
elementary arithmetic operations may give larger errors, and, of course,
error propagation must be considered when several operations are compounded.

Additionally, rational numbers that are exactly representable as floating
point numbers in base 10, like 0.1 or 0.7, do not have an exact
representation as floating point numbers in base 2, which is used
internally, no matter the size of the mantissa. Hence, they cannot be
converted into their internal binary counterparts without a small loss of
precision. This can lead to confusing results: for example,
floor((0.1+0.7)*10) will usually return 7 instead of the expected 8, since
the internal representation will be something like 7.9991118

So never trust floating number results to the last digit, and never compare
floating point numbers for equality.

Additional, interesting read:
http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
On Tue, Dec 14, 2010 at 10:15 AM, tom rhodestom.rho...@gmail.com  wrote:

   

same here compiling for flash player 10 and flash player 9, 8 and below
give
0.3 as expected


On 14 December 2010 15:42, Adrian ZajÄ…czajac.adr...@gmail.com  wrote:

 

trace (0.27 + 0.03);
   

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

 

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


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


Re: [Flashcoders] problem with adding two digits

2010-12-14 Thread Kerry Thompson
Adrian ZajÄ…c wrote:


trace (0.27 + 0.03);   // output -- 0.30004

 Can anyone tell me why I get this weird result in output window?


As people have said, it's a problem with decimals. It's not a problem with
Flash--it's a problem with binary numbers.

Integers are accurate because all integers are a multiple of 1, and binary
does just fine with combining 0's and 1's, the only possibile values of a
digit in the binary system.

If you think of decimals as fractions, maybe it will help you understand the
issue. In binary, a digit can only be a multiple of 2: 1/2, 1/4, 1/8/ 1/16,
1/32, and so on. You can create numbers that aren't multiples of two by
adding multiple digits. For example, 1/4 + 1/8 = 3/8, or .375.

This works pretty well, until you get numbers with a lot of decimal places.
At some point, you will find a decimal that is impossible to make using
powers of 2.

Cordially,

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


Re: [Flashcoders] problem with strongly typed actionscript

2010-06-08 Thread Henrik Andersson

Juan Pablo Califano wrote:

I agree with you, but I'add for the sake of completeness that, sometimes,
relaxing the rules a bit becomes a necessary evil, like for instance, when
doing a cast.



I have another example of where a typecast can be useful. When you 
really do need only BaseClass, but want to add some processing, if and 
only if, the object is of a specific DerivedClass.


An examples of this example would be a display list crawler. You are 
just outputting all the objects, you need nothing other than 
DisplayObject for that. However, you want to go deep, so you use the 
as operator to get a reference to a DisplayObjectContainer. If it 
succeeds, you recurse. If not, not a problem.

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


Re: [Flashcoders] problem with strongly typed actionscript

2010-06-08 Thread Jim Andrews
Here's my code which uses the SharedObject to implement a User Data Manager. 
This is my first ActionScript of any usefulness.


ja
http://vispo.com

package
{
// This is for managing the user's state from session to session.
// This saves their preferences and current state.

import flash.net.SharedObject;
import flash.net.URLRequest;
import flash.net.navigateToURL;


public class UserDataMgr
{
 protected var _version:String= 1.5;
 // The version of this program. The string is included in 
_userDataFilename.

 protected var _userDataFileName:String = Main_ + _version;
 // Customize this to set the name of the file stored on disk.
 protected var _sharedObj:SharedObject;

 public function UserDataMgr()
 {
  //The constructor of the UserDataMgr class.
  readPrefs();
 }

 protected function readPrefs():void
 {
  // Called only by the constructor.
  // At the end of this method, _sharedObj is valid or we've exited
  // the program. It's either the previously stored info or, if
  // none was found on disk, then it's default user data.
  try {
   _sharedObj = SharedObject.getLocal(_userDataFileName);
   if (_sharedObj.size == 0)
   {
// Then fill it with default data.
// This happens when the app is first run.
setDefaultUserData();
   }
  }
  catch(e:Error) {
   // Shared Object could not be created.
   javaScriptPopUp(This program cannot run properly if you do not allow it 
to save data to your hard disk. The program will now close.);

   closeApp();
  }
 }


 protected function closeApp():void
 {
  // Called by readPrefs.
  // This is supposed to close the app.
  // This probably doesn't work for AIR apps and who knows what other types 
of Flash apps.
  // This code should check to see if we're in an AIR app (etc), and act 
accordingly.

  // For more info, search CHC for 'close program'
  var urlString:String = javascript:window.opener = self; self.close();;
  var request:URLRequest = new URLRequest(urlString);
  navigateToURL(request, _self);
 }

 protected function javaScriptPopUp(s:String):void
 {
  // Called by readPrefs.
  // This opens a JavaScript pop up alert that displays s.
  var arg:String=javascript:alert(\' + s + \')
  var alert:URLRequest = new URLRequest(arg);
  navigateToURL(alert, _self);
 }

 protected function setDefaultUserData():void
 {
  // Sets the default User Data in the SharedObject type.
  setProperty(userId, testId);
  setProperty(userNumbers, {one:Math.random(), two:Math.random()});
  setProperty(bobo, 3.0);
 }

 public function setProperty(name:String, value:*):void
 {
  // Call this from outside the object to set a property.
  _sharedObj.data[name]=value;
 }

 public function getProperty(name:String)
 {
  // Call this from outside the object to get a property.
  return _sharedObj.data[name];
 }

} 


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


Re: [Flashcoders] problem with strongly typed actionscript

2010-06-08 Thread Juan Pablo Califano
Simple and gloriously concise example (as opposed to mine!). Here, whether
the classes are native, or whether they are concrete instead of interfaces
won't change the need for a cast; all the involved objects have
commonalities but also important differences, and you want to treat them
differently. Refactoring (if it were possible) to support proper
polymorphism would obviously a bad idea, at least for me.

Cheers
Juan Pablo Califano
2010/6/8 Henrik Andersson he...@henke37.cjb.net

 Juan Pablo Califano wrote:

 I agree with you, but I'add for the sake of completeness that, sometimes,
 relaxing the rules a bit becomes a necessary evil, like for instance, when
 doing a cast.


 I have another example of where a typecast can be useful. When you really
 do need only BaseClass, but want to add some processing, if and only if, the
 object is of a specific DerivedClass.

 An examples of this example would be a display list crawler. You are just
 outputting all the objects, you need nothing other than DisplayObject for
 that. However, you want to go deep, so you use the as operator to get a
 reference to a DisplayObjectContainer. If it succeeds, you recurse. If not,
 not a problem.

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

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


[Flashcoders] problem with strongly typed actionscript

2010-06-07 Thread Jim Andrews
i want to write a method x which takes an argument y. i cannot anticipate 
what type the argument is going to be until run-time. it might be a number 
or a string or an array or who knows what?


but i am not sure how to do this in actionscript because it is strongly 
typed. normally what is done is


public function x(y:String):void
{

}

but this won't do because y is limited to being of type String, whereas in 
the method i want to write, the type of y is not known until run-time.


how do i do this in actionscript?

ja?
http://vispo.com 


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


RE: [Flashcoders] problem with strongly typed actionscript

2010-06-07 Thread Cor
public function x(y:* = null):void
{

}


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Jim Andrews
Sent: maandag 7 juni 2010 12:41
To: Flash Coders List
Subject: [Flashcoders] problem with strongly typed actionscript

i want to write a method x which takes an argument y. i cannot anticipate 
what type the argument is going to be until run-time. it might be a number 
or a string or an array or who knows what?

but i am not sure how to do this in actionscript because it is strongly 
typed. normally what is done is

public function x(y:String):void
{

}

but this won't do because y is limited to being of type String, whereas in 
the method i want to write, the type of y is not known until run-time.

how do i do this in actionscript?

ja?
http://vispo.com 

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG - www.avg.com 
Versie: 9.0.829 / Virusdatabase: 271.1.1/2922 - datum van uitgifte: 06/06/10
20:35:00

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


Re: [Flashcoders] problem with strongly typed actionscript

2010-06-07 Thread Hans Wichman
public function x(y:Object):void
{

}

or

public function x(y:*):void
{

}

hth
jc

On Mon, Jun 7, 2010 at 12:40 PM, Jim Andrews j...@vispo.com wrote:

 i want to write a method x which takes an argument y. i cannot anticipate
 what type the argument is going to be until run-time. it might be a number
 or a string or an array or who knows what?

 but i am not sure how to do this in actionscript because it is strongly
 typed. normally what is done is

 public function x(y:String):void
 {

 }

 but this won't do because y is limited to being of type String, whereas in
 the method i want to write, the type of y is not known until run-time.

 how do i do this in actionscript?

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

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


Re: [Flashcoders] problem with strongly typed actionscript

2010-06-07 Thread Steven Sacks
Architecturally speaking, that's a bad idea. There's probably a strongly typed 
solution to what you're doing.  Can you provide detail about what you need to 
accomplish so we can help you figure out a better solution?




On 6/7/2010 3:40 AM, Jim Andrews wrote:

i want to write a method x which takes an argument y. i cannot
anticipate what type the argument is going to be until run-time. it
might be a number or a string or an array or who knows what?

but i am not sure how to do this in actionscript because it is strongly
typed. normally what is done is

public function x(y:String):void
{

}

but this won't do because y is limited to being of type String, whereas
in the method i want to write, the type of y is not known until run-time.

how do i do this in actionscript?

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


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


Re: [Flashcoders] problem with strongly typed actionscript

2010-06-07 Thread Patrick Matte
public function x(y:Object):void
{

}

Or this

public function x(y:*):void
{

}


 From: Steven Sacks flash...@stevensacks.net
 Reply-To: Flash Coders List flashcoders@chattyfig.figleaf.com
 Date: Mon, 07 Jun 2010 11:38:07 -0700
 To: Flash Coders List flashcoders@chattyfig.figleaf.com
 Subject: Re: [Flashcoders] problem with strongly typed actionscript
 
 Architecturally speaking, that's a bad idea. There's probably a strongly typed
 solution to what you're doing.  Can you provide detail about what you need to
 accomplish so we can help you figure out a better solution?
 
 
 
 On 6/7/2010 3:40 AM, Jim Andrews wrote:
 i want to write a method x which takes an argument y. i cannot
 anticipate what type the argument is going to be until run-time. it
 might be a number or a string or an array or who knows what?
 
 but i am not sure how to do this in actionscript because it is strongly
 typed. normally what is done is
 
 public function x(y:String):void
 {
 
 }
 
 but this won't do because y is limited to being of type String, whereas
 in the method i want to write, the type of y is not known until run-time.
 
 how do i do this in actionscript?
 
 ja?
 http://vispo.com
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



This e-mail is intended only for the named person or entity to which it is 
addressed and contains valuable 
business information that is proprietary, privileged, confidential and/or 
otherwise protected from disclosure.

If you received this e-mail in error, any review, use, dissemination, 
distribution or copying of this e-mail 
is strictly prohibited. Please notify us immediately of the error via e-mail to 
disclai...@tbwachiat.com and 
please delete the e-mail from your system, retaining no copies in any media. We 
appreciate your cooperation.

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


Re: [Flashcoders] problem with strongly typed actionscript

2010-06-07 Thread Kerry Thompson
Patrick Matte wrote:

 public function x(y:Object):void
 {

 }

 Or this

 public function x(y:*):void
 {

 }

Or, you can simply turn strict mode off. I tend to agree with Steven
Sacks, though. There's a really good reason for strong typing--mainly,
it's easier to find bugs at compile time than at run time.

Of course, C and C++ are strongly typed, and they allow you to pass in
a pointer, which could point to any type of data. I've always been
wary of that, but it's there.

Cordially,

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


RE: [Flashcoders] problem with strongly typed actionscript

2010-06-07 Thread Merrill, Jason
 Or, you can simply turn strict mode off. I tend to agree with Steven
Sacks, though. 
There's a really good reason for strong typing--mainly, it's easier to
find bugs at compile time than at 

Yep. IMO, there should never be a reason to turn strict typing off, it's
like saying, Don't tell me about my bugs, I don't want to hear it.,
which is like saying, doctor, only tell me I'm healthy, because I don't
want to hear I have cancer. But that's just me. :) 


Jason Merrill 

Instructional Technology Architect
Bank of  America  Global Learning 

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(note: these are for Bank of America employees only)



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


Re: [Flashcoders] problem with strongly typed actionscript

2010-06-07 Thread Hans Wichman
or maybe he is just writing a custom logger and wants to be able to pass any
type of object ;)

On Mon, Jun 7, 2010 at 9:44 PM, Merrill, Jason 
jason.merr...@bankofamerica.com wrote:

  Or, you can simply turn strict mode off. I tend to agree with Steven
 Sacks, though.
 There's a really good reason for strong typing--mainly, it's easier to
 find bugs at compile time than at

 Yep. IMO, there should never be a reason to turn strict typing off, it's
 like saying, Don't tell me about my bugs, I don't want to hear it.,
 which is like saying, doctor, only tell me I'm healthy, because I don't
 want to hear I have cancer. But that's just me. :)


 Jason Merrill

 Instructional Technology Architect
 Bank of  America  Global Learning

 Join the Bank of America Flash Platform Community  and visit our
 Instructional Technology Design Blog
 (note: these are for Bank of America employees only)



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

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


Re: [Flashcoders] problem with strongly typed actionscript

2010-06-07 Thread Hans Wichman
I send the same reply 8 hours ago, are my messages not coming through?:)

On Mon, Jun 7, 2010 at 9:05 PM, Patrick Matte
patrick.ma...@tbwachiat.comwrote:

 public function x(y:Object):void
 {

 }

 Or this

 public function x(y:*):void
 {

 }


  From: Steven Sacks flash...@stevensacks.net
  Reply-To: Flash Coders List flashcoders@chattyfig.figleaf.com
  Date: Mon, 07 Jun 2010 11:38:07 -0700
  To: Flash Coders List flashcoders@chattyfig.figleaf.com
  Subject: Re: [Flashcoders] problem with strongly typed actionscript
  
  Architecturally speaking, that's a bad idea. There's probably a strongly
 typed
  solution to what you're doing.  Can you provide detail about what you
 need to
  accomplish so we can help you figure out a better solution?
 
 
 
  On 6/7/2010 3:40 AM, Jim Andrews wrote:
  i want to write a method x which takes an argument y. i cannot
  anticipate what type the argument is going to be until run-time. it
  might be a number or a string or an array or who knows what?
 
  but i am not sure how to do this in actionscript because it is strongly
  typed. normally what is done is
 
  public function x(y:String):void
  {
 
  }
 
  but this won't do because y is limited to being of type String, whereas
  in the method i want to write, the type of y is not known until
 run-time.
 
  how do i do this in actionscript?
 
  ja?
  http://vispo.com
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



 This e-mail is intended only for the named person or entity to which it is
 addressed and contains valuable
 business information that is proprietary, privileged, confidential and/or
 otherwise protected from disclosure.

 If you received this e-mail in error, any review, use, dissemination,
 distribution or copying of this e-mail
 is strictly prohibited. Please notify us immediately of the error via
 e-mail to disclai...@tbwachiat.com and
 please delete the e-mail from your system, retaining no copies in any
 media. We appreciate your cooperation.

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

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


Re: [Flashcoders] problem with strongly typed actionscript

2010-06-07 Thread Jim Andrews


Architecturally speaking, that's a bad idea. There's probably a strongly 
typed
solution to what you're doing.  Can you provide detail about what you need 
to accomplish so we can help you figure out a better solution?


i expect

public function x(y:*):void
{
}

will do the job.

the public method is for an object that uses the sharedObject to implement 
'flash cookies'. the method is to set an arbitrary property of the 
sharedObject. so x would take two parameters. a property s and its value y. 
and it sets s to y.


ja 


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


Re: [Flashcoders] problem with strongly typed actionscript

2010-06-07 Thread Patrick Matte
Ah, didn't read the thread from the beginning.

You could also create an interface. For example

public function x(y:IEventDispatcher):void
{

}


 From: Hans Wichman j.c.wich...@objectpainters.com
 Reply-To: Flash Coders List flashcoders@chattyfig.figleaf.com
 Date: Mon, 7 Jun 2010 21:45:50 +0200
 To: Flash Coders List flashcoders@chattyfig.figleaf.com
 Subject: Re: [Flashcoders] problem with strongly typed actionscript
 
 I send the same reply 8 hours ago, are my messages not coming through?:)
 
 On Mon, Jun 7, 2010 at 9:05 PM, Patrick Matte
 patrick.ma...@tbwachiat.comwrote:
 
 public function x(y:Object):void
 {
 
 }
 
 Or this
 
 public function x(y:*):void
 {
 
 }
 
 
 From: Steven Sacks flash...@stevensacks.net
 Reply-To: Flash Coders List flashcoders@chattyfig.figleaf.com
 Date: Mon, 07 Jun 2010 11:38:07 -0700
 To: Flash Coders List flashcoders@chattyfig.figleaf.com
 Subject: Re: [Flashcoders] problem with strongly typed actionscript
 
 Architecturally speaking, that's a bad idea. There's probably a strongly
 typed
 solution to what you're doing.  Can you provide detail about what you
 need to
 accomplish so we can help you figure out a better solution?
 
 
 
 On 6/7/2010 3:40 AM, Jim Andrews wrote:
 i want to write a method x which takes an argument y. i cannot
 anticipate what type the argument is going to be until run-time. it
 might be a number or a string or an array or who knows what?
 
 but i am not sure how to do this in actionscript because it is strongly
 typed. normally what is done is
 
 public function x(y:String):void
 {
 
 }
 
 but this won't do because y is limited to being of type String, whereas
 in the method i want to write, the type of y is not known until
 run-time.
 
 how do i do this in actionscript?
 
 ja?
 http://vispo.com
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
 
 This e-mail is intended only for the named person or entity to which it is
 addressed and contains valuable
 business information that is proprietary, privileged, confidential and/or
 otherwise protected from disclosure.
 
 If you received this e-mail in error, any review, use, dissemination,
 distribution or copying of this e-mail
 is strictly prohibited. Please notify us immediately of the error via
 e-mail to disclai...@tbwachiat.com and
 please delete the e-mail from your system, retaining no copies in any
 media. We appreciate your cooperation.
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



This e-mail is intended only for the named person or entity to which it is 
addressed and contains valuable 
business information that is proprietary, privileged, confidential and/or 
otherwise protected from disclosure.

If you received this e-mail in error, any review, use, dissemination, 
distribution or copying of this e-mail 
is strictly prohibited. Please notify us immediately of the error via e-mail to 
disclai...@tbwachiat.com and 
please delete the e-mail from your system, retaining no copies in any media. We 
appreciate your cooperation.

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


Re: [Flashcoders] problem with strongly typed actionscript

2010-06-07 Thread Steven Sacks
Right so what you're essentially talking about is a Model, and the SharedObject 
is acting as a Service.


public class Model extends EventDispatcher
{
private var so:SharedObject;

public function Model()
{
super();
init();
}
private function init():void
{
so = SharedObject.getLocal(yourAppName);
}
public function set foo(value:int):void
{
so.data.foo = value;
so.flush();
dispatchUpdate();
}
public function get foo():int
{
return so.data.foo;
}
public function set bar(value:String):void
{
so.data.bar = value;
so.flush();
dispatchUpdate();
}
public function get foo():String
{
return so.data.bar;
}
private function dispatchUpdate():void
{
dispatchEvent(new ModelEvent(ModelEvent.UPDATE));
}
// etc.
}

Get the idea?  It might seem like a lot of extra work, but by mapping out all of 
the values you need, it will be extremely clear what's being stored and what 
type each property is. It will help you avoid missing things you should be 
storing (like a checklist), and you will always be able to guarantee that the 
value you're getting is what you're expecting, avoiding run-time errors.


By listening the model for its update event, you're also guaranteeing that if 
one thing updates a value in the SharedObject, anyone who cares about that value 
will be updated that the value has potentially changed.

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


Re: [Flashcoders] problem with strongly typed actionscript

2010-06-07 Thread Juan Pablo Califano
I agree with you, but I'add for the sake of completeness that, sometimes,
relaxing the rules a bit becomes a necessary evil, like for instance, when
doing a cast.

When you do this:

// bar is typed as ISomeInterface somewhere else
var foo:SomeConcreteClass = bar as SomeConcreteClass;  // or
SomeConcreteClass(bar)
foo.methodOnlyPresentInConcreteClass();

You are basically bypassing the rules of type system. You're telling the
compiler that an object declared as ISomeInterface at compile time will be
an instance of SomeConcreteClass at runtime. You're asking the compiler to
trust you and not blow up when compiling your code. Some times this is
avoidable with some refactoring (and or a better design). Sometimes it's not
possible or impractical (this also depends on how purist you are, I guess).
Nevertheless, having too many casts is usually considered a code smell for
this very reason.

Cheers
Juan Pablo Califano




2010/6/7 Merrill, Jason jason.merr...@bankofamerica.com

  Or, you can simply turn strict mode off. I tend to agree with Steven
 Sacks, though.
 There's a really good reason for strong typing--mainly, it's easier to
 find bugs at compile time than at

 Yep. IMO, there should never be a reason to turn strict typing off, it's
 like saying, Don't tell me about my bugs, I don't want to hear it.,
 which is like saying, doctor, only tell me I'm healthy, because I don't
 want to hear I have cancer. But that's just me. :)


 Jason Merrill

 Instructional Technology Architect
 Bank of  America  Global Learning

 Join the Bank of America Flash Platform Community  and visit our
 Instructional Technology Design Blog
 (note: these are for Bank of America employees only)



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

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


Re: [Flashcoders] problem with strongly typed actionscript

2010-06-07 Thread Steven Sacks
With due deference, what you just said I disagree with. The scenario you 
described is not a necessary evil, it's a hack.


The only situation where that isn't a hack is if your class extends a native 
type such as Sprite, but there's no ISprite. That problem is either solved by 
adding the Sprite functions you need to your interface, or, if you need to 
addChild() your interface, then you cast as Sprite because there's no other way.


Outside of that specific case, you should never run into the situation you 
described, and if you do, it's time for a quick refactor.


If you want a function in SomeConcreteClass to be accessible outside the 
class/inheritance/package (i.e. public) and you have an interface for that 
class, then you should include that function in the interface.  Sometimes you 
may not put public methods in the interface because you want them to be public 
to other packages inside your app, but not to the outside world, and you 
shouldn't be casting to the interface of that class in those cases. Why would 
you cast as the interface when you don't need the interface?


Using interfaces incorrectly or inappropriately is the disease, not a symptom of 
strict typing. If anything, strict typing forces these issues to appear in your 
code before it's too late.


No matter what, proper typing never leads to code smell. Improper typing or 
mixed typing like what you described is code smell in the sense that it's 
indicative of poor architecture decisions.




On 6/7/2010 3:46 PM, Juan Pablo Califano wrote:

I agree with you, but I'add for the sake of completeness that, sometimes,
relaxing the rules a bit becomes a necessary evil, like for instance, when
doing a cast.

When you do this:

// bar is typed as ISomeInterface somewhere else
var foo:SomeConcreteClass = bar as SomeConcreteClass;  // or
SomeConcreteClass(bar)
foo.methodOnlyPresentInConcreteClass();

You are basically bypassing the rules of type system. You're telling the
compiler that an object declared as ISomeInterface at compile time will be
an instance of SomeConcreteClass at runtime. You're asking the compiler to
trust you and not blow up when compiling your code. Some times this is
avoidable with some refactoring (and or a better design). Sometimes it's not
possible or impractical (this also depends on how purist you are, I guess).
Nevertheless, having too many casts is usually considered a code smell for
this very reason.

Cheers
Juan Pablo Califano

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


Re: [Flashcoders] problem with strongly typed actionscript

2010-06-07 Thread Juan Pablo Califano
Much obliged for your deference.

We would have to agree to disagree then, since I think I agree with you in
general terms, but you seem to disagree on this alleged agreement.

You say except for one specific case, the scenario I described is a hack.
Call it whatever you like. I might even agree to call it a hack, but that's
not the point.

The point is that, sometimes, rearchitechting is not possible, or it's
highly unpractical. It sucks, but that's life.

Changing an interface is generally not a problem if you have full control of
said interface and the code that consumes it. In most application code,
that's likely the case. Things change a bit when the code that declares that
interfaces is part of a library, rather than part of a specific app. It gets
worse if it's your library and you have other people using it (or maybe
you're using it in many other projects); or if you happen to be a user the
library, which was developed by a third party library.

The example you give about Sprite is not a problem because it's a native
class. Yes, some guy at Adobe forgot about adding an IDisplayObject. Bummer.
But the problem is not it's native. It's that it's code you don't have
control over.

Off the top of my head, I can remember a similar case that didn't involve
any native classes. I was using a CacheManager, that, as the name implies,
managed a cache of resources; I say resources because it was rather generic,
but my use case involved images (or actually, proxies to images, but I'll
try not to ramble too much); you could limit the max number of items in the
cache, specify a time-to-live, and other cool and handy features. The beauty
of it was that it worked really well and, as opposed to most similar APIs
you may find in the wild, it used strong references (a must for the
functionality ot provided), timers and whatnot, but cleaned up after itself
correctly (I memory-profiled it and stress-tested it before using it). Now,
coding such a manager is not terribly hard; but the code was availabel to
me, ready to use, properly debugged and optimized, and is the kind of code
where it's very easy to screw up (especially, memory-wise). This manager
accepted and returned some base CacheItem; a class, not an interface. An
interface would have been nicer, probably, but in any case, the author of
this lib couldn't have known in advance what I'd be putting there, so with
an interface maybe I could have wiped out the proxy and removed one level of
indirection (the object I wanted to cache already extended something else);
I still would have needed to cast the object when I retrieved from the
manager to do anything useful.

In such scenario, you can either: rewrite the beast; monkey-patch it
(assuming you have the source code, which is not always the case; even if
you have it, mokey-patching has problems of its own); adding this little
cast hack, which is a no-brainer that takes 5 seconds. Personally, I'd
choose the last option.

Now, I think more generally, there are two kinds of problems when changing
interfaces. (Again, this problem is minor if you have control of both the
lib and the app)

1) Source code compatibility.

This means any user of the lib will have to not only recompile their app,
but also change their code accordingly if they are using any method changed
in the library. By defintion a public interface should be stable (or at
least tend to be stable) and backwards compatible. (Ok, Facebook change
their mind about their API every other week, but they're big enough to get
away with it. If you don't appreciate how liberal they are about this, tough
luck. The client wants their app running smoothly and they --at least, most
of them-- don't know what API means or care the least about it, for that
matter).

As a user, I certainly appreciate a stable API that doesn't break my code
with every single release (and, oh so many times, gratuitously).

2) Binary compatibility

Ok, this is a less common case in Actionscript as it is in other languages,
but the consequences could be much worse than breaking source code
compatibility. I've actually worked on a project that had this problem.

I realize I have written a rather longish reply by now, so I'll try to be
brief (and hope you haven't feel asleep at this point). Some basic context
first: this project was structured as a number of small modules (about 25 of
them). Those modules were mostly self contained, but shared a good number of
interfaces. Building the whole project from scratch was a hard as running a
build script. Deploying it wasn't that simple, alas.

For reasons that are boring to detail, going from the staging environment to
QA and then to production was slow and painful. Full deploys were only
reserved for special cases. A deploy caused modified files to be purged from
CDN caches, which is a very bad thing for apps with high traffic; this
site's traffic is huge, and though there are load balanced dedicated servers
running it, completely purging the cache is 

Re: [Flashcoders] problem with import mx.controls.Alert

2010-06-02 Thread Dave Watts
 Thanks, Eric. So I guess none of the mx.controls are for Flash but, rather,
 are all for Flex?

Yes, they are part of the Flex class libraries. You may be able to use
them in Flash directly, but that's not their design intent.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] problem with import mx.controls.Alert

2010-06-02 Thread Eric E. Dolecki
I used Google and found this that seems decent enough:

http://developer.yahoo.com/flash/astra-flash/alertmanager/

I am assuming that you like the fact that the Flex background is
blurred while the alert is being displayed. Is this true? If you
rolled your own, the stage is a MovieClip, so you could apply a blur
filter to it, or take a bitmap snap of it and blur that  place your
own alert sprite on top, or whatever.

Eric


On Wed, Jun 2, 2010 at 10:46 AM, Dave Watts dwa...@figleaf.com wrote:
 Thanks, Eric. So I guess none of the mx.controls are for Flash but, rather,
 are all for Flex?

 Yes, they are part of the Flex class libraries. You may be able to use
 them in Flash directly, but that's not their design intent.

 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 http://training.figleaf.com/

 Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
 GSA Schedule, and provides the highest caliber vendor-authorized
 instruction at our training centers, online, or onsite.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
http://ericd.net
Interactive design and development
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] problem with import mx.controls.Alert

2010-06-01 Thread Jim Andrews

Am I on the right list for a question like this?

I get an error, in Flash Builder 4, with the following line, which is part 
of an ActionScript project.


import mx.controls.Alert;

The error is 1172: Definition mx.controls:Alert could not be found.

How do I fix this?

ja?
http://vispo.com


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


Re: [Flashcoders] problem with import mx.controls.Alert

2010-06-01 Thread Eric E. Dolecki
Make a Flex app - Alert is for Flex. Or make your own Alert class. I'm
not sure if linking the Flex SWCs would work for an Alert or not.

On Tue, Jun 1, 2010 at 10:34 PM, Jim Andrews j...@vispo.com wrote:
 Am I on the right list for a question like this?

 I get an error, in Flash Builder 4, with the following line, which is part
 of an ActionScript project.

 import mx.controls.Alert;

 The error is 1172: Definition mx.controls:Alert could not be found.

 How do I fix this?

 ja?
 http://vispo.com


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




-- 
http://ericd.net
Interactive design and development
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] problem with import mx.controls.Alert

2010-06-01 Thread Jim Andrews
Thanks, Eric. So I guess none of the mx.controls are for Flash but, rather, 
are all for Flex?


ja




Make a Flex app - Alert is for Flex. Or make your own Alert class. I'm
not sure if linking the Flex SWCs would work for an Alert or not.



I get an error, in Flash Builder 4, with the following line, which is 
part

of an ActionScript project.

import mx.controls.Alert;

The error is 1172: Definition mx.controls:Alert could not be found.

How do I fix this?

ja?
http://vispo.com


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


[Flashcoders] problem displaying shared objects in swf

2010-03-07 Thread cem sonmez
hi
At first I want to say this, this might not be an issue about red5.But I
thought that somewhere in deep it can be pertinent to red5.

At the red5 side I am creating a shared object called
*chatSharedObject*connecting from the client to this with no problem.
For the client side,I am using openlaszlo platform, but using actionscript
code for the shared object implementation. cilent application is connecting
to the shared object on the red5 side successfully(as I see on the red5
logs).

here is the calling code snippet:

[CODE]
button id=sendButtonsend
  handler name=onclick method=sendClicked /
  method name=sendClicked args=v=0
if (message.text != ) {
//Debug.write(Message sent!);
classroot.writeSharedObject(
message.text);
message.clearText();
message.setAttribute(text_y, 0);
}
/method
/button

method name=writeSharedObject args=message
[B]//shared object send method is being called[/B]
this.send(writeMessage,loginScreen.getUsername(),message);
/method

!--this method writes the messages to the debug window which will be shown
to all users--
method name=writeMessage args=username, msg
//Debug.debug(msg);
messageArea.addText(username+  : +msg+\n);
/method[/CODE]

When I generate the swf object and try to use this application, nothing is
being displayed although there is no problem on this issue on the
development enviroment. Problem causes when I try to run the swf10 object.

Is this about the red5 side issue, or about the flash side? As I see on the
red5 logs that there is no problem with the flash applciation connetion with
the red5 server application and the shared objedcts.
But I canT see the contents of shared object on the flash application. This
might be a security issue of flash, right? Even if it is, please can anyone
help me how to work out this problem.

Has anyone faced such like behaviour while running flash 9 object

Thanks in advance


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


Re: [Flashcoders] Problem Importing Class

2010-03-05 Thread Susan Day
This was a case of stripping down a class that worked to make the example
smaller and easier for you all, then accidentally stripping out a necessary
detail. Here's a different stripped down and tested version, different
because I'm actually working with an mc not a string:

package
{
import flash.display.MovieClip;
 public class Star extends MovieClip
{
 public function Star()
{
var star:MovieClip = new MovieClip();
addChild(star);
star.graphics.lineStyle(1, 0xFF);
star.graphics.beginFill(0xFF);
star.graphics.moveTo(144, 277);
star.graphics.lineTo(188, 184);
star.graphics.lineTo(288, 170);
star.graphics.lineTo(216, 98);
star.graphics.lineTo(232, 0);
star.graphics.lineTo(144, 47);
star.graphics.lineTo(55, 1);
star.graphics.lineTo(72, 100);
star.graphics.lineTo(0, 170);
star.graphics.lineTo(99, 184);
star.graphics.endFill();
}
}
}

This code works by itself. However, when I call it in the other package with
the following lines:

import Star;
// var star:Sprite = new Sprite();
(whether commented out or not)
Star();

I get the error:

1136 Incorrect number of arguments. Expected 1. Star.as

for the last of the lines in the importing pkg. What argument is it
expecting?
TIA,
Susan
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Problem Importing Class

2010-03-05 Thread Benny
Hi susan,

In the 'other package' try:

import Star;

var myStar:Star = new Star();
addChild(myStar);

---
Why are you getting the error? .. because you are trying to cast 'nothing'
as a Star. Because Flash can't cast 'nothing' it tells you it's missing an
argument. 
---

Regards, Benny

-Oorspronkelijk bericht-

..

This code works by itself. However, when I call it in the other package with
the following lines:

import Star;
// var star:Sprite = new Sprite();
(whether commented out or not)
Star();

I get the error:

1136 Incorrect number of arguments. Expected 1. Star.as

for the last of the lines in the importing pkg. What argument is it
expecting?
TIA,
Susan

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


RE: [Flashcoders] Problem Importing Class

2010-03-05 Thread Merrill, Jason
 Star();

Again Susan, as others have said, you're still just calling Star().
What you need to do in your other class is call 

var myStar:Star = new Star();
addChild(myStar);

By calling new Star(), the constructor function (the Star() function
inside your Star class) is called automatically and will run.


Jason Merrill 

Bank of  America  Global Learning 
Learning  Performance Solutions

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(note: these are for Bank of America employees only)

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


Re: [Flashcoders] Problem Importing Class

2010-03-05 Thread Susan Day
On Fri, Mar 5, 2010 at 8:34 AM, Benny b.vlug...@hccnet.nl wrote:

 Hi susan,

 In the 'other package' try:

 import Star;

 var myStar:Star = new Star();
 addChild(myStar);


That works.


 ---
 Why are you getting the error? .. because you are trying to cast 'nothing'
 as a Star. Because Flash can't cast 'nothing' it tells you it's missing an
 argument.


Gotcha.
Thanks,
Susan
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Problem Importing Class

2010-03-04 Thread Susan Day
Hi;
I have this line in the importing package:

import Star;

and this in the function of the same package:

Star();

Star package has this code:

package
{
import flash.display.MovieClip;
 public class Star extends MovieClip
{
 public function Star()
{
trace('star');
}
}
}
When I run the importing package, I get this error:

1136 Incorrect number of arguments. Expected 1. Star.as

What argument is it expecting?!
TIA,
Susan
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Problem Importing Class

2010-03-04 Thread Keith Reinfeld
This reproduces the error: 
 
package { 
import flash.display.MovieClip; 
import Star; 
public class App extends MovieClip { 
public function App() { 
trace('app'); 
Star(); 
} 
} 
} 
 
This fixes it: 
 
package { 
import flash.display.MovieClip; 
import Star; 
public class App extends MovieClip { 
private var _star:Star; 
public function App() { 
trace('app'); 
_star = new Star(); 
} 
} 
} 
 
Regards,

Keith Reinfeld
Home Page: http://keithreinfeld.home.comcast.net


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-
 boun...@chattyfig.figleaf.com] On Behalf Of Susan Day
 Sent: Thursday, March 04, 2010 10:03 AM
 To: Flash Coders List
 Subject: [Flashcoders] Problem Importing Class
 
 Hi;
 I have this line in the importing package:
 
 import Star;
 
 and this in the function of the same package:
 
 Star();
 
 Star package has this code:
 
 package
 {
 import flash.display.MovieClip;
  public class Star extends MovieClip
 {
  public function Star()
 {
 trace('star');
 }
 }
 }
 When I run the importing package, I get this error:
 
 1136 Incorrect number of arguments. Expected 1. Star.as
 
 What argument is it expecting?!
 TIA,
 Susan
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


Re: [Flashcoders] Problem Importing Class

2010-03-04 Thread Henrik Andersson

Susan Day wrote:

1136 Incorrect number of arguments. Expected 1. Star.as

What argument is it expecting?!


The object to convert to the type. You omitted the keyword new and got 
the function style typecast.

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


Re: [Flashcoders] problem with paths

2010-01-25 Thread sebastian
Hi everyone, thanks for all the advice and suggestions. I'm going to try 
John's replacement suggestion, as this seems very promising!


Thanks!

Sebastian.

John McCormack wrote:

Sorry,

In my application the scores file would have the same name as the SWF 
program, and so progam.swf becomes progamscores.txt


temp=this.loaderInfo.url;// Use the SWF path as 
a source

temp=temp.replace(.swf,scores.txt); // for the scores text file

John

John McCormack wrote:

If I understand this correctly:

html is in directory1
SWF in directory2/flash
SWF is trying to load the XML from directory2/flash/xml/

A SWF knows the directory it was loaded from and so can find the xml 
directory. For example I use this...


var temp:String;

temp=this.loaderInfo.url;// Use the SWF path 
as a source

temp=temp.replace(.swf,scores.txt); // for the scores text file

Also, you could email back to yourself the directories that you find.

If they were prepared to run it, they could help by running Charles' 
web proxy from www.xk72.com/charles

That would help them identify failed loading of files.

John

sebastian wrote:

Thanks Nathan and Dave,

The leading slash was just a typo in my email, but the code doesn't 
start with a leading slash, so that can't be the problem.


It's on an intranet, so an internal website that people like me, who 
are external, can't see or access [and they won't grant me access 
either]. We can't just tell them sorry because they are some huge 
multinational company, and we are a small local agency...


They sent me the path names of where they put the file, and where it 
is being loaded from, so I tried hardcoding the exact path into my AS 
file for the XML file, but it still wont load it.


I know that if I make them test my HTML file that I used, which sits 
in the same folder as the resources, it works for them JUST FINE...


So it is when they try and load it from a different directory on the 
same server that it doesn't.


Something like:

http://theirsite.com/flash

Is being read from:

http://theirsite.com/someotherplace/somesubfolder

Is there something else I need to set, it loads the SWF from:


http://theirsite.com/flash

just fine, but it won't load the XML from:


http://theirsite.com/flash/xml/data.xml

Any other ideas?

Thanks!

Seb.

Nathan Mynarcik wrote:
Is it published on the web? Or is the intranet on a shared drive on 
an internal network? If it is the ladder, your path has to be longer 
than it would be for a webserver.
Best bet would be to trace your butt off until you find the exact 
string you need for the path. Go back and forth about 20 to 30 times 
with them on file versions until they get fed up. Having you do it 
without being able to test is like having you code blindfolded with 
yours hands tied.


--Original Message--
From: sebastian
Sender: flashcoders-boun...@chattyfig.figleaf.com
To: Flash Coders List
ReplyTo: Flash Coders List
Subject: [Flashcoders] problem with paths
Sent: Jan 22, 2010 2:16 PM

Hello flash coders,

Simple question I believe, but I'm having problems with a delivery 
of a flash file.


My flash file loads an external XML and then from the external XML 
it loads images, videos text etc.


It works fine locally and on our test server, however at the 
client's server, which is on an intranet so I can't test or see what 
they see, it doesn't load the XML...


I tried hard coding the paths that they tell me the XML resides in, 
and they promise me that they have kept the file structure intact, 
and they have also informed me that there is no cross domain going 
on... meaning that the flash is being loaded from the same domain 
where the data is being kept.


My question is: how could this not be working? My only guess is that 
the file is being embeded in an HTML file that is NOT in the path of 
where the files are being kept, but then my hardcoded full-paths 
should (?) have resolved this...?


Am I right that I can replace: the load /xml/data.xml with 
http://domainname.com/flash/xml/data.xml; and then load the SWF 
from a directory like: 
http://domainname.com/somsubdirectory/index.html; and get it all to 
load correctly?


Thanks for any insight or thoughts you can offer!

Best,

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


Nathan Mynarcik
Interactive Web Developer
nat...@mynarcik.com
254.749.2525
www.mynarcik.com

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


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





___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http

Re: [Flashcoders] problem with paths

2010-01-23 Thread John McCormack

If I understand this correctly:

html is in directory1
SWF in directory2/flash
SWF is trying to load the XML from directory2/flash/xml/

A SWF knows the directory it was loaded from and so can find the xml 
directory. For example I use this...


var temp:String;

temp=this.loaderInfo.url;// Use the SWF path as 
a source

temp=temp.replace(.swf,scores.txt); // for the scores text file

Also, you could email back to yourself the directories that you find.

If they were prepared to run it, they could help by running Charles' web 
proxy from www.xk72.com/charles

That would help them identify failed loading of files.

John

sebastian wrote:

Thanks Nathan and Dave,

The leading slash was just a typo in my email, but the code doesn't 
start with a leading slash, so that can't be the problem.


It's on an intranet, so an internal website that people like me, who 
are external, can't see or access [and they won't grant me access 
either]. We can't just tell them sorry because they are some huge 
multinational company, and we are a small local agency...


They sent me the path names of where they put the file, and where it 
is being loaded from, so I tried hardcoding the exact path into my AS 
file for the XML file, but it still wont load it.


I know that if I make them test my HTML file that I used, which sits 
in the same folder as the resources, it works for them JUST FINE...


So it is when they try and load it from a different directory on the 
same server that it doesn't.


Something like:

http://theirsite.com/flash

Is being read from:

http://theirsite.com/someotherplace/somesubfolder

Is there something else I need to set, it loads the SWF from:


http://theirsite.com/flash

just fine, but it won't load the XML from:


http://theirsite.com/flash/xml/data.xml

Any other ideas?

Thanks!

Seb.

Nathan Mynarcik wrote:
Is it published on the web? Or is the intranet on a shared drive on 
an internal network? If it is the ladder, your path has to be longer 
than it would be for a webserver.
Best bet would be to trace your butt off until you find the exact 
string you need for the path. Go back and forth about 20 to 30 times 
with them on file versions until they get fed up. Having you do it 
without being able to test is like having you code blindfolded with 
yours hands tied.


--Original Message--
From: sebastian
Sender: flashcoders-boun...@chattyfig.figleaf.com
To: Flash Coders List
ReplyTo: Flash Coders List
Subject: [Flashcoders] problem with paths
Sent: Jan 22, 2010 2:16 PM

Hello flash coders,

Simple question I believe, but I'm having problems with a delivery of 
a flash file.


My flash file loads an external XML and then from the external XML it 
loads images, videos text etc.


It works fine locally and on our test server, however at the client's 
server, which is on an intranet so I can't test or see what they see, 
it doesn't load the XML...


I tried hard coding the paths that they tell me the XML resides in, 
and they promise me that they have kept the file structure intact, 
and they have also informed me that there is no cross domain going 
on... meaning that the flash is being loaded from the same domain 
where the data is being kept.


My question is: how could this not be working? My only guess is that 
the file is being embeded in an HTML file that is NOT in the path of 
where the files are being kept, but then my hardcoded full-paths 
should (?) have resolved this...?


Am I right that I can replace: the load /xml/data.xml with 
http://domainname.com/flash/xml/data.xml; and then load the SWF from 
a directory like: http://domainname.com/somsubdirectory/index.html; 
and get it all to load correctly?


Thanks for any insight or thoughts you can offer!

Best,

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


Nathan Mynarcik
Interactive Web Developer
nat...@mynarcik.com
254.749.2525
www.mynarcik.com

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


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





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


Re: [Flashcoders] problem with paths

2010-01-23 Thread John McCormack

Sorry,

In my application the scores file would have the same name as the SWF 
program, and so progam.swf becomes progamscores.txt


temp=this.loaderInfo.url;// Use the SWF path as 
a source

temp=temp.replace(.swf,scores.txt); // for the scores text file

John

John McCormack wrote:

If I understand this correctly:

html is in directory1
SWF in directory2/flash
SWF is trying to load the XML from directory2/flash/xml/

A SWF knows the directory it was loaded from and so can find the xml 
directory. For example I use this...


var temp:String;

temp=this.loaderInfo.url;// Use the SWF path 
as a source

temp=temp.replace(.swf,scores.txt); // for the scores text file

Also, you could email back to yourself the directories that you find.

If they were prepared to run it, they could help by running Charles' 
web proxy from www.xk72.com/charles

That would help them identify failed loading of files.

John

sebastian wrote:

Thanks Nathan and Dave,

The leading slash was just a typo in my email, but the code doesn't 
start with a leading slash, so that can't be the problem.


It's on an intranet, so an internal website that people like me, who 
are external, can't see or access [and they won't grant me access 
either]. We can't just tell them sorry because they are some huge 
multinational company, and we are a small local agency...


They sent me the path names of where they put the file, and where it 
is being loaded from, so I tried hardcoding the exact path into my AS 
file for the XML file, but it still wont load it.


I know that if I make them test my HTML file that I used, which sits 
in the same folder as the resources, it works for them JUST FINE...


So it is when they try and load it from a different directory on the 
same server that it doesn't.


Something like:

http://theirsite.com/flash

Is being read from:

http://theirsite.com/someotherplace/somesubfolder

Is there something else I need to set, it loads the SWF from:


http://theirsite.com/flash

just fine, but it won't load the XML from:


http://theirsite.com/flash/xml/data.xml

Any other ideas?

Thanks!

Seb.

Nathan Mynarcik wrote:
Is it published on the web? Or is the intranet on a shared drive on 
an internal network? If it is the ladder, your path has to be longer 
than it would be for a webserver.
Best bet would be to trace your butt off until you find the exact 
string you need for the path. Go back and forth about 20 to 30 times 
with them on file versions until they get fed up. Having you do it 
without being able to test is like having you code blindfolded with 
yours hands tied.


--Original Message--
From: sebastian
Sender: flashcoders-boun...@chattyfig.figleaf.com
To: Flash Coders List
ReplyTo: Flash Coders List
Subject: [Flashcoders] problem with paths
Sent: Jan 22, 2010 2:16 PM

Hello flash coders,

Simple question I believe, but I'm having problems with a delivery 
of a flash file.


My flash file loads an external XML and then from the external XML 
it loads images, videos text etc.


It works fine locally and on our test server, however at the 
client's server, which is on an intranet so I can't test or see what 
they see, it doesn't load the XML...


I tried hard coding the paths that they tell me the XML resides in, 
and they promise me that they have kept the file structure intact, 
and they have also informed me that there is no cross domain going 
on... meaning that the flash is being loaded from the same domain 
where the data is being kept.


My question is: how could this not be working? My only guess is that 
the file is being embeded in an HTML file that is NOT in the path of 
where the files are being kept, but then my hardcoded full-paths 
should (?) have resolved this...?


Am I right that I can replace: the load /xml/data.xml with 
http://domainname.com/flash/xml/data.xml; and then load the SWF 
from a directory like: 
http://domainname.com/somsubdirectory/index.html; and get it all to 
load correctly?


Thanks for any insight or thoughts you can offer!

Best,

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


Nathan Mynarcik
Interactive Web Developer
nat...@mynarcik.com
254.749.2525
www.mynarcik.com

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


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





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





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

RE: [Flashcoders] problem with paths

2010-01-23 Thread Nathan Mynarcik
You could download Fiddler2 and see where it is trying to locate the file as
well.  I think Safari has something like this built in.  Forgot how to show
that in Safari tho...

http://www.fiddler2.com/fiddler2/


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of John
McCormack
Sent: Saturday, January 23, 2010 4:45 AM
To: Flash Coders List
Subject: Re: [Flashcoders] problem with paths

If I understand this correctly:

html is in directory1
SWF in directory2/flash
SWF is trying to load the XML from directory2/flash/xml/

A SWF knows the directory it was loaded from and so can find the xml 
directory. For example I use this...

var temp:String;

temp=this.loaderInfo.url;// Use the SWF path as 
a source
temp=temp.replace(.swf,scores.txt); // for the scores text file

Also, you could email back to yourself the directories that you find.

If they were prepared to run it, they could help by running Charles' web 
proxy from www.xk72.com/charles
That would help them identify failed loading of files.

John

sebastian wrote:
 Thanks Nathan and Dave,

 The leading slash was just a typo in my email, but the code doesn't 
 start with a leading slash, so that can't be the problem.

 It's on an intranet, so an internal website that people like me, who 
 are external, can't see or access [and they won't grant me access 
 either]. We can't just tell them sorry because they are some huge 
 multinational company, and we are a small local agency...

 They sent me the path names of where they put the file, and where it 
 is being loaded from, so I tried hardcoding the exact path into my AS 
 file for the XML file, but it still wont load it.

 I know that if I make them test my HTML file that I used, which sits 
 in the same folder as the resources, it works for them JUST FINE...

 So it is when they try and load it from a different directory on the 
 same server that it doesn't.

 Something like:

 http://theirsite.com/flash

 Is being read from:

 http://theirsite.com/someotherplace/somesubfolder

 Is there something else I need to set, it loads the SWF from:


 http://theirsite.com/flash

 just fine, but it won't load the XML from:


 http://theirsite.com/flash/xml/data.xml

 Any other ideas?

 Thanks!

 Seb.

 Nathan Mynarcik wrote:
 Is it published on the web? Or is the intranet on a shared drive on 
 an internal network? If it is the ladder, your path has to be longer 
 than it would be for a webserver.
 Best bet would be to trace your butt off until you find the exact 
 string you need for the path. Go back and forth about 20 to 30 times 
 with them on file versions until they get fed up. Having you do it 
 without being able to test is like having you code blindfolded with 
 yours hands tied.

 --Original Message--
 From: sebastian
 Sender: flashcoders-boun...@chattyfig.figleaf.com
 To: Flash Coders List
 ReplyTo: Flash Coders List
 Subject: [Flashcoders] problem with paths
 Sent: Jan 22, 2010 2:16 PM

 Hello flash coders,

 Simple question I believe, but I'm having problems with a delivery of 
 a flash file.

 My flash file loads an external XML and then from the external XML it 
 loads images, videos text etc.

 It works fine locally and on our test server, however at the client's 
 server, which is on an intranet so I can't test or see what they see, 
 it doesn't load the XML...

 I tried hard coding the paths that they tell me the XML resides in, 
 and they promise me that they have kept the file structure intact, 
 and they have also informed me that there is no cross domain going 
 on... meaning that the flash is being loaded from the same domain 
 where the data is being kept.

 My question is: how could this not be working? My only guess is that 
 the file is being embeded in an HTML file that is NOT in the path of 
 where the files are being kept, but then my hardcoded full-paths 
 should (?) have resolved this...?

 Am I right that I can replace: the load /xml/data.xml with 
 http://domainname.com/flash/xml/data.xml; and then load the SWF from 
 a directory like: http://domainname.com/somsubdirectory/index.html; 
 and get it all to load correctly?

 Thanks for any insight or thoughts you can offer!

 Best,

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


 Nathan Mynarcik
 Interactive Web Developer
 nat...@mynarcik.com
 254.749.2525
 www.mynarcik.com

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

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




___
Flashcoders mailing list

RE: [Flashcoders] problem with paths

2010-01-23 Thread Nathan Mynarcik
Found it:
(In Safari)Right click on page-inspect element-resources-enable resources

-Original Message-
From: Nathan Mynarcik [mailto:nat...@mynarcik.com] 
Sent: Saturday, January 23, 2010 10:37 AM
To: 'Flash Coders List'
Subject: RE: [Flashcoders] problem with paths

You could download Fiddler2 and see where it is trying to locate the file as
well.  I think Safari has something like this built in.  Forgot how to show
that in Safari tho...

http://www.fiddler2.com/fiddler2/


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of John
McCormack
Sent: Saturday, January 23, 2010 4:45 AM
To: Flash Coders List
Subject: Re: [Flashcoders] problem with paths

If I understand this correctly:

html is in directory1
SWF in directory2/flash
SWF is trying to load the XML from directory2/flash/xml/

A SWF knows the directory it was loaded from and so can find the xml 
directory. For example I use this...

var temp:String;

temp=this.loaderInfo.url;// Use the SWF path as 
a source
temp=temp.replace(.swf,scores.txt); // for the scores text file

Also, you could email back to yourself the directories that you find.

If they were prepared to run it, they could help by running Charles' web 
proxy from www.xk72.com/charles
That would help them identify failed loading of files.

John

sebastian wrote:
 Thanks Nathan and Dave,

 The leading slash was just a typo in my email, but the code doesn't 
 start with a leading slash, so that can't be the problem.

 It's on an intranet, so an internal website that people like me, who 
 are external, can't see or access [and they won't grant me access 
 either]. We can't just tell them sorry because they are some huge 
 multinational company, and we are a small local agency...

 They sent me the path names of where they put the file, and where it 
 is being loaded from, so I tried hardcoding the exact path into my AS 
 file for the XML file, but it still wont load it.

 I know that if I make them test my HTML file that I used, which sits 
 in the same folder as the resources, it works for them JUST FINE...

 So it is when they try and load it from a different directory on the 
 same server that it doesn't.

 Something like:

 http://theirsite.com/flash

 Is being read from:

 http://theirsite.com/someotherplace/somesubfolder

 Is there something else I need to set, it loads the SWF from:


 http://theirsite.com/flash

 just fine, but it won't load the XML from:


 http://theirsite.com/flash/xml/data.xml

 Any other ideas?

 Thanks!

 Seb.

 Nathan Mynarcik wrote:
 Is it published on the web? Or is the intranet on a shared drive on 
 an internal network? If it is the ladder, your path has to be longer 
 than it would be for a webserver.
 Best bet would be to trace your butt off until you find the exact 
 string you need for the path. Go back and forth about 20 to 30 times 
 with them on file versions until they get fed up. Having you do it 
 without being able to test is like having you code blindfolded with 
 yours hands tied.

 --Original Message--
 From: sebastian
 Sender: flashcoders-boun...@chattyfig.figleaf.com
 To: Flash Coders List
 ReplyTo: Flash Coders List
 Subject: [Flashcoders] problem with paths
 Sent: Jan 22, 2010 2:16 PM

 Hello flash coders,

 Simple question I believe, but I'm having problems with a delivery of 
 a flash file.

 My flash file loads an external XML and then from the external XML it 
 loads images, videos text etc.

 It works fine locally and on our test server, however at the client's 
 server, which is on an intranet so I can't test or see what they see, 
 it doesn't load the XML...

 I tried hard coding the paths that they tell me the XML resides in, 
 and they promise me that they have kept the file structure intact, 
 and they have also informed me that there is no cross domain going 
 on... meaning that the flash is being loaded from the same domain 
 where the data is being kept.

 My question is: how could this not be working? My only guess is that 
 the file is being embeded in an HTML file that is NOT in the path of 
 where the files are being kept, but then my hardcoded full-paths 
 should (?) have resolved this...?

 Am I right that I can replace: the load /xml/data.xml with 
 http://domainname.com/flash/xml/data.xml; and then load the SWF from 
 a directory like: http://domainname.com/somsubdirectory/index.html; 
 and get it all to load correctly?

 Thanks for any insight or thoughts you can offer!

 Best,

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


 Nathan Mynarcik
 Interactive Web Developer
 nat...@mynarcik.com
 254.749.2525
 www.mynarcik.com

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

[Flashcoders] problem with paths

2010-01-22 Thread sebastian

Hello flash coders,

Simple question I believe, but I'm having problems with a delivery of a 
flash file.


My flash file loads an external XML and then from the external XML it 
loads images, videos text etc.


It works fine locally and on our test server, however at the client's 
server, which is on an intranet so I can't test or see what they see, it 
doesn't load the XML...


I tried hard coding the paths that they tell me the XML resides in, and 
they promise me that they have kept the file structure intact, and they 
have also informed me that there is no cross domain going on... meaning 
that the flash is being loaded from the same domain where the data is 
being kept.


My question is: how could this not be working? My only guess is that the 
file is being embeded in an HTML file that is NOT in the path of where 
the files are being kept, but then my hardcoded full-paths should (?) 
have resolved this...?


Am I right that I can replace: the load /xml/data.xml with 
http://domainname.com/flash/xml/data.xml; and then load the SWF from a 
directory like: http://domainname.com/somsubdirectory/index.html; and 
get it all to load correctly?


Thanks for any insight or thoughts you can offer!

Best,

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


Re: [Flashcoders] problem with paths

2010-01-22 Thread Dave Watts
 Am I right that I can replace: the load /xml/data.xml with
 http://domainname.com/flash/xml/data.xml; and then load the SWF from a
 directory like: http://domainname.com/somsubdirectory/index.html; and get
 it all to load correctly?

Paths that begin with a slash, such as /xml/data.xml, tell the client
(Flash, in this case) to start from the web root and work down - in
this case, that would be http://domainname.com/xml/data/xml. If you
want to get the data from /flash/xml/data.xml, you need to use that
path, or use a fully-qualified URL.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] problem with paths

2010-01-22 Thread Nathan Mynarcik
Is it published on the web? Or is the intranet on a shared drive on an internal 
network? If it is the ladder, your path has to be longer than it would be for a 
webserver. 

Best bet would be to trace your butt off until you find the exact string you 
need for the path. Go back and forth about 20 to 30 times with them on file 
versions until they get fed up. Having you do it without being able to test is 
like having you code blindfolded with yours hands tied. 


--Original Message--
From: sebastian
Sender: flashcoders-boun...@chattyfig.figleaf.com
To: Flash Coders List
ReplyTo: Flash Coders List
Subject: [Flashcoders] problem with paths
Sent: Jan 22, 2010 2:16 PM

Hello flash coders,

Simple question I believe, but I'm having problems with a delivery of a 
flash file.

My flash file loads an external XML and then from the external XML it 
loads images, videos text etc.

It works fine locally and on our test server, however at the client's 
server, which is on an intranet so I can't test or see what they see, it 
doesn't load the XML...

I tried hard coding the paths that they tell me the XML resides in, and 
they promise me that they have kept the file structure intact, and they 
have also informed me that there is no cross domain going on... meaning 
that the flash is being loaded from the same domain where the data is 
being kept.

My question is: how could this not be working? My only guess is that the 
file is being embeded in an HTML file that is NOT in the path of where 
the files are being kept, but then my hardcoded full-paths should (?) 
have resolved this...?

Am I right that I can replace: the load /xml/data.xml with 
http://domainname.com/flash/xml/data.xml; and then load the SWF from a 
directory like: http://domainname.com/somsubdirectory/index.html; and 
get it all to load correctly?

Thanks for any insight or thoughts you can offer!

Best,

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


Nathan Mynarcik
Interactive Web Developer
nat...@mynarcik.com
254.749.2525
www.mynarcik.com

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


Re: [Flashcoders] problem with paths

2010-01-22 Thread sebastian

Thanks Nathan and Dave,

The leading slash was just a typo in my email, but the code doesn't 
start with a leading slash, so that can't be the problem.


It's on an intranet, so an internal website that people like me, who are 
external, can't see or access [and they won't grant me access either]. 
We can't just tell them sorry because they are some huge multinational 
company, and we are a small local agency...


They sent me the path names of where they put the file, and where it is 
being loaded from, so I tried hardcoding the exact path into my AS file 
for the XML file, but it still wont load it.


I know that if I make them test my HTML file that I used, which sits in 
the same folder as the resources, it works for them JUST FINE...


So it is when they try and load it from a different directory on the 
same server that it doesn't.


Something like:

http://theirsite.com/flash

Is being read from:

http://theirsite.com/someotherplace/somesubfolder

Is there something else I need to set, it loads the SWF from:


http://theirsite.com/flash

just fine, but it won't load the XML from:


http://theirsite.com/flash/xml/data.xml

Any other ideas?

Thanks!

Seb.

Nathan Mynarcik wrote:
Is it published on the web? Or is the intranet on a shared drive on an internal network? If it is the ladder, your path has to be longer than it would be for a webserver. 

Best bet would be to trace your butt off until you find the exact string you need for the path. Go back and forth about 20 to 30 times with them on file versions until they get fed up. Having you do it without being able to test is like having you code blindfolded with yours hands tied. 



--Original Message--
From: sebastian
Sender: flashcoders-boun...@chattyfig.figleaf.com
To: Flash Coders List
ReplyTo: Flash Coders List
Subject: [Flashcoders] problem with paths
Sent: Jan 22, 2010 2:16 PM

Hello flash coders,

Simple question I believe, but I'm having problems with a delivery of a 
flash file.


My flash file loads an external XML and then from the external XML it 
loads images, videos text etc.


It works fine locally and on our test server, however at the client's 
server, which is on an intranet so I can't test or see what they see, it 
doesn't load the XML...


I tried hard coding the paths that they tell me the XML resides in, and 
they promise me that they have kept the file structure intact, and they 
have also informed me that there is no cross domain going on... meaning 
that the flash is being loaded from the same domain where the data is 
being kept.


My question is: how could this not be working? My only guess is that the 
file is being embeded in an HTML file that is NOT in the path of where 
the files are being kept, but then my hardcoded full-paths should (?) 
have resolved this...?


Am I right that I can replace: the load /xml/data.xml with 
http://domainname.com/flash/xml/data.xml; and then load the SWF from a 
directory like: http://domainname.com/somsubdirectory/index.html; and 
get it all to load correctly?


Thanks for any insight or thoughts you can offer!

Best,

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


Nathan Mynarcik
Interactive Web Developer
nat...@mynarcik.com
254.749.2525
www.mynarcik.com

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


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


RE: [Flashcoders] problem with paths

2010-01-22 Thread Merrill, Jason
Well, if the HTML that embeds the .swf when they load it in their site
is in a different location than the .swf, and that's not how you did it
when you programmed it,  then you'll definitely have path issues.  The
path to the XML and other media assets is relative to the HTML that
embeds the .swf, not where the .swf actually is.  You would have to
republish with the paths changed relative to where their HTML file is
when they post your site, or tell them to set up the site like you did
when you built it (say the HTML and the .swf in the same folder)


Jason Merrill 

 Bank of  America  Global Learning 
Learning  Performance Soluions

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(note: these are for Bank of America employees only)





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of
sebastian
Sent: Friday, January 22, 2010 4:18 PM
To: Flash Coders List
Subject: Re: [Flashcoders] problem with paths

Thanks Nathan and Dave,

The leading slash was just a typo in my email, but the code doesn't 
start with a leading slash, so that can't be the problem.

It's on an intranet, so an internal website that people like me, who are

external, can't see or access [and they won't grant me access either]. 
We can't just tell them sorry because they are some huge multinational

company, and we are a small local agency...

They sent me the path names of where they put the file, and where it is 
being loaded from, so I tried hardcoding the exact path into my AS file 
for the XML file, but it still wont load it.

I know that if I make them test my HTML file that I used, which sits in 
the same folder as the resources, it works for them JUST FINE...

So it is when they try and load it from a different directory on the 
same server that it doesn't.

Something like:

http://theirsite.com/flash

Is being read from:

http://theirsite.com/someotherplace/somesubfolder

Is there something else I need to set, it loads the SWF from:


http://theirsite.com/flash

just fine, but it won't load the XML from:


http://theirsite.com/flash/xml/data.xml

Any other ideas?

Thanks!

Seb.

Nathan Mynarcik wrote:
 Is it published on the web? Or is the intranet on a shared drive on an
internal network? If it is the ladder, your path has to be longer than
it would be for a webserver. 
 
 Best bet would be to trace your butt off until you find the exact
string you need for the path. Go back and forth about 20 to 30 times
with them on file versions until they get fed up. Having you do it
without being able to test is like having you code blindfolded with
yours hands tied. 
 
 
 --Original Message--
 From: sebastian
 Sender: flashcoders-boun...@chattyfig.figleaf.com
 To: Flash Coders List
 ReplyTo: Flash Coders List
 Subject: [Flashcoders] problem with paths
 Sent: Jan 22, 2010 2:16 PM
 
 Hello flash coders,
 
 Simple question I believe, but I'm having problems with a delivery of
a 
 flash file.
 
 My flash file loads an external XML and then from the external XML it 
 loads images, videos text etc.
 
 It works fine locally and on our test server, however at the client's 
 server, which is on an intranet so I can't test or see what they see,
it 
 doesn't load the XML...
 
 I tried hard coding the paths that they tell me the XML resides in,
and 
 they promise me that they have kept the file structure intact, and
they 
 have also informed me that there is no cross domain going on...
meaning 
 that the flash is being loaded from the same domain where the data is 
 being kept.
 
 My question is: how could this not be working? My only guess is that
the 
 file is being embeded in an HTML file that is NOT in the path of where

 the files are being kept, but then my hardcoded full-paths should (?) 
 have resolved this...?
 
 Am I right that I can replace: the load /xml/data.xml with 
 http://domainname.com/flash/xml/data.xml; and then load the SWF from
a 
 directory like: http://domainname.com/somsubdirectory/index.html; and

 get it all to load correctly?
 
 Thanks for any insight or thoughts you can offer!
 
 Best,
 
 Seb.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
 Nathan Mynarcik
 Interactive Web Developer
 nat...@mynarcik.com
 254.749.2525
 www.mynarcik.com
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] problem with paths

2010-01-22 Thread Dave Watts
 The leading slash was just a typo in my email, but the code doesn't start
 with a leading slash, so that can't be the problem.

Well, in that case, it's doing something completely different. It's
expecting to find the XML file in a subdirectory within the directory
containing the current page URL.

 It's on an intranet, so an internal website that people like me, who are
 external, can't see or access [and they won't grant me access either]. We
 can't just tell them sorry because they are some huge multinational
 company, and we are a small local agency...

 They sent me the path names of where they put the file, and where it is
 being loaded from, so I tried hardcoding the exact path into my AS file for
 the XML file, but it still wont load it.

 I know that if I make them test my HTML file that I used, which sits in the
 same folder as the resources, it works for them JUST FINE...

 So it is when they try and load it from a different directory on the same
 server that it doesn't.

 Something like:

 http://theirsite.com/flash

 Is being read from:

 http://theirsite.com/someotherplace/somesubfolder

 Is there something else I need to set, it loads the SWF from:

 http://theirsite.com/flash

 just fine, but it won't load the XML from:


 http://theirsite.com/flash/xml/data.xml

 Any other ideas?

I would recommend that you rewrite your Flash app so that you can
specify a fully-qualified URL as an argument in flashvars, then have
them specify the fully-qualified URL to the XML file.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] problem with paths

2010-01-22 Thread Nathan Mynarcik
Yeah I bet you are right. For testing purposes what if they put the flash and 
xml files in the same folder as the html page and change your links accordingly?

It also depends on if they are using regular html or building the intranet on 
struts or php. Then you could have files scattered all over coming together to 
create the webpage. 

I understand them not wanting you to have access. But I wouldn't want a guy to 
come build cabinets for my kitchen without letting him in the house to measure. 

Good luck mayne!

Nathan Mynarcik
Interactive Web Developer
nat...@mynarcik.com
254.749.2525
www.mynarcik.com

-Original Message-
From: sebastian infora...@gmail.com
Date: Fri, 22 Jan 2010 13:18:08 
To: Flash Coders Listflashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] problem with paths

Thanks Nathan and Dave,

The leading slash was just a typo in my email, but the code doesn't 
start with a leading slash, so that can't be the problem.

It's on an intranet, so an internal website that people like me, who are 
external, can't see or access [and they won't grant me access either]. 
We can't just tell them sorry because they are some huge multinational 
company, and we are a small local agency...

They sent me the path names of where they put the file, and where it is 
being loaded from, so I tried hardcoding the exact path into my AS file 
for the XML file, but it still wont load it.

I know that if I make them test my HTML file that I used, which sits in 
the same folder as the resources, it works for them JUST FINE...

So it is when they try and load it from a different directory on the 
same server that it doesn't.

Something like:

http://theirsite.com/flash

Is being read from:

http://theirsite.com/someotherplace/somesubfolder

Is there something else I need to set, it loads the SWF from:


http://theirsite.com/flash

just fine, but it won't load the XML from:


http://theirsite.com/flash/xml/data.xml

Any other ideas?

Thanks!

Seb.

Nathan Mynarcik wrote:
 Is it published on the web? Or is the intranet on a shared drive on an 
 internal network? If it is the ladder, your path has to be longer than it 
 would be for a webserver. 
 
 Best bet would be to trace your butt off until you find the exact string you 
 need for the path. Go back and forth about 20 to 30 times with them on file 
 versions until they get fed up. Having you do it without being able to test 
 is like having you code blindfolded with yours hands tied. 
 
 
 --Original Message--
 From: sebastian
 Sender: flashcoders-boun...@chattyfig.figleaf.com
 To: Flash Coders List
 ReplyTo: Flash Coders List
 Subject: [Flashcoders] problem with paths
 Sent: Jan 22, 2010 2:16 PM
 
 Hello flash coders,
 
 Simple question I believe, but I'm having problems with a delivery of a 
 flash file.
 
 My flash file loads an external XML and then from the external XML it 
 loads images, videos text etc.
 
 It works fine locally and on our test server, however at the client's 
 server, which is on an intranet so I can't test or see what they see, it 
 doesn't load the XML...
 
 I tried hard coding the paths that they tell me the XML resides in, and 
 they promise me that they have kept the file structure intact, and they 
 have also informed me that there is no cross domain going on... meaning 
 that the flash is being loaded from the same domain where the data is 
 being kept.
 
 My question is: how could this not be working? My only guess is that the 
 file is being embeded in an HTML file that is NOT in the path of where 
 the files are being kept, but then my hardcoded full-paths should (?) 
 have resolved this...?
 
 Am I right that I can replace: the load /xml/data.xml with 
 http://domainname.com/flash/xml/data.xml; and then load the SWF from a 
 directory like: http://domainname.com/somsubdirectory/index.html; and 
 get it all to load correctly?
 
 Thanks for any insight or thoughts you can offer!
 
 Best,
 
 Seb.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
 Nathan Mynarcik
 Interactive Web Developer
 nat...@mynarcik.com
 254.749.2525
 www.mynarcik.com
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


Re: [Flashcoders] problem with paths

2010-01-22 Thread Nathan Mynarcik
I would recommend that you rewrite your Flash app so that you can
specify a fully-qualified URL as an argument in flashvars, then have
them specify the fully-qualified URL to the XML file.

Now that is a really good idea...


--Original Message--
From: Dave Watts
Sender: flashcoders-boun...@chattyfig.figleaf.com
To: Flash Coders List
ReplyTo: Flash Coders List
Subject: Re: [Flashcoders] problem with paths
Sent: Jan 22, 2010 3:27 PM

 The leading slash was just a typo in my email, but the code doesn't start
 with a leading slash, so that can't be the problem.

Well, in that case, it's doing something completely different. It's
expecting to find the XML file in a subdirectory within the directory
containing the current page URL.

 It's on an intranet, so an internal website that people like me, who are
 external, can't see or access [and they won't grant me access either]. We
 can't just tell them sorry because they are some huge multinational
 company, and we are a small local agency...

 They sent me the path names of where they put the file, and where it is
 being loaded from, so I tried hardcoding the exact path into my AS file for
 the XML file, but it still wont load it.

 I know that if I make them test my HTML file that I used, which sits in the
 same folder as the resources, it works for them JUST FINE...

 So it is when they try and load it from a different directory on the same
 server that it doesn't.

 Something like:

 http://theirsite.com/flash

 Is being read from:

 http://theirsite.com/someotherplace/somesubfolder

 Is there something else I need to set, it loads the SWF from:

 http://theirsite.com/flash

 just fine, but it won't load the XML from:


 http://theirsite.com/flash/xml/data.xml

 Any other ideas?

I would recommend that you rewrite your Flash app so that you can
specify a fully-qualified URL as an argument in flashvars, then have
them specify the fully-qualified URL to the XML file.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Nathan Mynarcik
Interactive Web Developer
nat...@mynarcik.com
254.749.2525
www.mynarcik.com

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


Re: [Flashcoders] problem with paths

2010-01-22 Thread sebastian

Hi again, and thank you everyone.

And yes, they are using PHP to drive content all together, and since it 
is an intranet blog... who knows where all the assets are being placed...


Curious about this solution below, when you say specify a fully 
qualified url in the flash vars do you mean that the URL should specify 
the CURRENT FULL URL* of the page loaded?


Which I would in-turn use as the prefix for all my assets that are being 
loaded?


This is my assumption, but just want to make sure I get it right before 
I go down this path which I can't test as I develop...


Thanks!

Sebastian.
*ex: http://blabla.com/foldername/subfolder/actual_file.php

p.s. As for the carpenter analogy... I know, we keep asking them for 
access... I think if I can't solve it today, they may permit me to come 
to their office and login from there to access the files [but they wont 
give me remote xs... pfff]


Nathan Mynarcik wrote:

I would recommend that you rewrite your Flash app so that you can
specify a fully-qualified URL as an argument in flashvars, then have
them specify the fully-qualified URL to the XML file.

Now that is a really good idea...


--Original Message--
From: Dave Watts
Sender: flashcoders-boun...@chattyfig.figleaf.com
To: Flash Coders List
ReplyTo: Flash Coders List
Subject: Re: [Flashcoders] problem with paths
Sent: Jan 22, 2010 3:27 PM


The leading slash was just a typo in my email, but the code doesn't start
with a leading slash, so that can't be the problem.


Well, in that case, it's doing something completely different. It's
expecting to find the XML file in a subdirectory within the directory
containing the current page URL.


It's on an intranet, so an internal website that people like me, who are
external, can't see or access [and they won't grant me access either]. We
can't just tell them sorry because they are some huge multinational
company, and we are a small local agency...

They sent me the path names of where they put the file, and where it is
being loaded from, so I tried hardcoding the exact path into my AS file for
the XML file, but it still wont load it.

I know that if I make them test my HTML file that I used, which sits in the
same folder as the resources, it works for them JUST FINE...

So it is when they try and load it from a different directory on the same
server that it doesn't.

Something like:

http://theirsite.com/flash

Is being read from:

http://theirsite.com/someotherplace/somesubfolder

Is there something else I need to set, it loads the SWF from:

http://theirsite.com/flash

just fine, but it won't load the XML from:


http://theirsite.com/flash/xml/data.xml

Any other ideas?


I would recommend that you rewrite your Flash app so that you can
specify a fully-qualified URL as an argument in flashvars, then have
them specify the fully-qualified URL to the XML file.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Nathan Mynarcik
Interactive Web Developer
nat...@mynarcik.com
254.749.2525
www.mynarcik.com

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


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


RE: [Flashcoders] problem with paths

2010-01-22 Thread Merrill, Jason
 and since it is an intranet blog... who knows where all the assets
are being placed...

Huh.  Well please take no offense when I say this, but your problem is
not with code, but with the people and processes running your intranet.
I would circle back with them before trying any fancy code solutions to
this here.  Logic dictates that you need to know where on that intranet,
your HTML file ends up, where your .swf ends up, and where the media
files ends up.  If you don't know the answer to all three of those, then
we really can't help you here. 


Jason Merrill 

Bank of  America  Global Learning 
Learning  Performance Soluions

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(note: these are for Bank of America employees only)


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


Re: [Flashcoders] problem with paths

2010-01-22 Thread Dave Watts
 Curious about this solution below, when you say specify a fully qualified
 url in the flash vars do you mean that the URL should specify the CURRENT
 FULL URL* of the page loaded?

I was suggesting that you specify the fully-qualified URL for the XML
file. I just worked through a similar issue, where the Flash file was
looking for an XML file in a specific location, and it was a big pain.

 Which I would in-turn use as the prefix for all my assets that are being
 loaded?

Right. Assuming there's just the one XML file, you could just have the
path include the file. Otherwise, you could have a flashvar containing
a URL to which you append specific file names as needed.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Problem with poping up a window

2010-01-07 Thread Lehr, Ross (N-SGIS)
I'm working with flash 8 and AS2.  I'm loading text from a XML file

If I load a href=javascript:openPop('pop.html');open pop/a in a textbox I 
can access a JavaScript function called openPop() in the HTML code of the 
page that loads the. Swf

If I load the same code in a TextArea component, the a href no longer calls 
the javascript in the .html page.

Anyone know why?  I cannot find an explanation anywhere.  Let me know if you 
need more details.

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


[Flashcoders] Problem with trackEvents in Flash

2009-12-28 Thread John R. Sweeney Jr
Howdy all,

Hope everyone had a great holiday.

My client wanted me to incorporate Google Analytics - Event tracking. Based
on what they supplied me and what I've read on GA, I've incorporated these
calls through out my program:
---
GetURL(javascript:pageTracker._trackEvent('Videos', 'Play', 'Gone With the
Wind'););
---


Then in my index.html I used the GA supplied code (below is the generic
equivalent):
---
script type=text/javascript
var gaJsHost = ((https: == document.location.protocol) ? https://ssl.; :
http://www.;);
document.write(unescape(%3Cscript src=' + gaJsHost +
google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E));
/script
script type=text/javascript
try{
var pageTracker = _gat._getTracker(UA-xx-x);
pageTracker._trackPageview();
} catch(err) {}/script
---

I'm not getting the events recorded at GA. I've read that an alternative is
to change (in the html) pageTracker._trackPageview(); to
pageTracker._trackEvent();, but still no luck.

Does anyone have any experience with this and can make a suggestion. I know
that the calls inside the Flash app are all working (I've tested with a
visible text field on the app to verify content), so I'm assuming the
problem is in the html/javascript sniptet call to GA, but I'm not sure.

Any help would be greatly appreciated.


Thanks in advance,
John




John R. Sweeney Jr.
Interactive Multimedia Developer


OnDemand Interactive Inc
945 Washington Blvd.
Hoffman Estates, IL 60169
Office/Fax: 847.310.5959
Cellular: 847.651.4469
www.ondemandinteractive.com


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


Re: [Flashcoders] Problem with trackEvents in Flash

2009-12-28 Thread Glen Pike

Hi,

 I had some problems with this, particularly with Internet Explorer - 
here is my code that worked, although someone complained about errors in 
IE7 or 8 about _gat being undefined - I guess you can hide these with a 
try / catch block, but then it would be nice to know how to fix because 
people still insist on using IE...:


JavaScript

script type=text/javascript
   // ![CDATA[
   var gaJsHost = ((https: == document.location.protocol) ? 
https://ssl.; : http://www.;);
   document.write(unescape(%3Cscript src=' + gaJsHost + 
google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E));

   // ]]
   /script
   script type=text/javascript
   // ![CDATA[
   var pageTracker = _gat._getTracker(UA-###);
   pageTracker._initData();
   pageTracker._trackPageview();
  
   function trackTesting(page) {

   pageTracker._trackPageview(page);
   }
   // ]]
   /script


ActionScript

   var page:String = evt.type.substr(5);
   sendToURL(new URLRequest(javascript:trackTesting('+page+');));
   trace(eventHandler for type  + evt.type +  from  + evt.target);

John R. Sweeney Jr wrote:

Howdy all,

Hope everyone had a great holiday.

My client wanted me to incorporate Google Analytics - Event tracking. Based
on what they supplied me and what I've read on GA, I've incorporated these
calls through out my program:
---
GetURL(javascript:pageTracker._trackEvent('Videos', 'Play', 'Gone With the
Wind'););
---


Then in my index.html I used the GA supplied code (below is the generic
equivalent):
---
script type=text/javascript
var gaJsHost = ((https: == document.location.protocol) ? https://ssl.; :
http://www.;);
document.write(unescape(%3Cscript src=' + gaJsHost +
google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E));
/script
script type=text/javascript
try{
var pageTracker = _gat._getTracker(UA-xx-x);
pageTracker._trackPageview();
} catch(err) {}/script
---

I'm not getting the events recorded at GA. I've read that an alternative is
to change (in the html) pageTracker._trackPageview(); to
pageTracker._trackEvent();, but still no luck.

Does anyone have any experience with this and can make a suggestion. I know
that the calls inside the Flash app are all working (I've tested with a
visible text field on the app to verify content), so I'm assuming the
problem is in the html/javascript sniptet call to GA, but I'm not sure.

Any help would be greatly appreciated.


Thanks in advance,
John




John R. Sweeney Jr.
Interactive Multimedia Developer


OnDemand Interactive Inc
945 Washington Blvd.
Hoffman Estates, IL 60169
Office/Fax: 847.310.5959
Cellular: 847.651.4469
www.ondemandinteractive.com


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

  


--

Glen Pike
01326 218440
www.glenpike.co.uk http://www.glenpike.co.uk

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


Re: [Flashcoders] Problem with trackEvents in Flash

2009-12-28 Thread John R. Sweeney Jr
I'll try a variant of this (this is written in AS2), but the first problem I
had was the catch that wrapped the pageView. On the PC side, it would change
the html page (which held my app) to a blank page with the word TRUE and the
URL was my trackEvent string.

That is what started me on this quest.

Maybe someone else had this too.


Thanks for the suggestion,
John


on 12/28/09 10:08 AM, Glen Pike at postmas...@glenpike.co.uk wrote:

 Hi,
 
   I had some problems with this, particularly with Internet Explorer -
 here is my code that worked, although someone complained about errors in
 IE7 or 8 about _gat being undefined - I guess you can hide these with a
 try / catch block, but then it would be nice to know how to fix because
 people still insist on using IE...:


John R. Sweeney Jr.
Interactive Multimedia Developer


OnDemand Interactive Inc
945 Washington Blvd.
Hoffman Estates, IL 60169
Office/Fax: 847.310.5959
Cellular: 847.651.4469
www.ondemandinteractive.com


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


Re: [Flashcoders] Problem with trackEvents in Flash

2009-12-28 Thread Karl DeSaulniers
Cool. Just checking. Since you had everything else URL encoded, I  
thought it might be getting cut off because of that space. Not  
completeing the full string.

GL

Karl

Sent from losPhone

On Dec 28, 2009, at 3:59 PM, John R. Sweeney Jr jr.swee...@comcast.net 
 wrote:


Thanks, but I just copied this snipet from the web. My code had the  
registry

number and domain, so I just used this example from GA.

Thanks anyway,
John



on 12/28/09 3:23 PM, Karl DeSaulniers at k...@designdrumm.com wrote:



I am not sure if this is the issue, but did you mean to not URL  
encode

the space in this line? %3Cscript src=



John R. Sweeney Jr.
Interactive Multimedia Developer


OnDemand Interactive Inc
945 Washington Blvd.
Hoffman Estates, IL 60169
Office/Fax: 847.310.5959
Cellular: 847.651.4469
www.ondemandinteractive.com


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

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


Re: [Flashcoders] Problem with trackEvents in Flash

2009-12-28 Thread Andrei Thomaz
don't forget to check this:
http://code.google.com/p/gaforflash/

[]'s
andrei
http://code.google.com/p/gaforflash/

On Mon, Dec 28, 2009 at 8:13 PM, Karl DeSaulniers k...@designdrumm.comwrote:

 Cool. Just checking. Since you had everything else URL encoded, I thought
 it might be getting cut off because of that space. Not completeing the full
 string.
 GL

 Karl

 Sent from losPhone


 On Dec 28, 2009, at 3:59 PM, John R. Sweeney Jr jr.swee...@comcast.net
 wrote:

  Thanks, but I just copied this snipet from the web. My code had the
 registry
 number and domain, so I just used this example from GA.

 Thanks anyway,
 John



 on 12/28/09 3:23 PM, Karl DeSaulniers at k...@designdrumm.com wrote:


  I am not sure if this is the issue, but did you mean to not URL encode
 the space in this line? %3Cscript src=



 John R. Sweeney Jr.
 Interactive Multimedia Developer


 OnDemand Interactive Inc
 945 Washington Blvd.
 Hoffman Estates, IL 60169
 Office/Fax: 847.310.5959
 Cellular: 847.651.4469
 www.ondemandinteractive.com


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

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

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


Re: [Flashcoders] Problem with First Flash Movie

2009-11-17 Thread beno -
On Mon, Nov 16, 2009 at 5:00 PM, Barry Hannah ba...@shift.co.nz wrote:

 OK, I'm lost.


Me too :)


 You need a function mcHatAndFace so you can call an asset from the
 library?

 Does
 var myHatAndFaceInstance:mcHatAndFace = new mcHatAndFace();

 not work?


I exported mcHatAndFace from the library to the first frame of Main.as Below
is the latest incarnation of the code. Here's the error it threw:
Type was not found or was not a compile-time constant: mcHatAndFace

package
{
  import flash.display.MovieClip;
  import com.greensock.*;
  import com.greensock.plugins.*;
  import com.greensock.easing.*;
  public class Main extends MovieClip
{
public function Main():void
  {
  var mcHatAndFaceInstance:mcHatAndFace = new mcHatAndFace();
  TweenPlugin.activate([AutoAlphaPlugin]);
  var mcHatAndFace = new MovieClip();
  this.addChild(mcHatAndFace);
  mcHatAndFace.x = 100;
  mcHatAndFace.y = 100;
  mcHatAndFace.alpha = 0;
  TweenLite.to(mcHatAndFace, 1, {autoAlpha:1}); // 2nd param in seconds;
3rd in % alpha
  var main:Main = new Main();
  addChild(main);
  main.mcHatAndFace();
}
  }
}

Please advise.


 I suspect classes and subclasses might be beyond your level of ability
 right now, may I respectfully suggest you learn a bit more about why and
 how you use classes before dropping yourself in it?


Sounds good to me :)


 In the meantime keep firing questions about how to do specific things
 (as above) - the answers for those smaller questions might be more
 digestible.


Well, now that's the point! I kinda thought the whole concept of multiple
classes was overkill.
beno
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Problem with First Flash Movie

2009-11-17 Thread Cedric Muller

Hi,

Could you try the following ? (you were doing addChild on  
'mcHatAndFace' class, but I know you want the instance to be added to  
the display list, not its class)


Main.as:

package
{
  import flash.display.MovieClip;
  import com.greensock.*;
  import com.greensock.plugins.*;
  import com.greensock.easing.*;
  public class Main extends MovieClip
{
public function Main():void
  {
  trace(Main class is initialized);
}

   public function init():void
  {
trace(Main.init is being called... let's see what happens now...);
  var mcHatAndFaceInstance:mcHatAndFace = new mcHatAndFace();
  TweenPlugin.activate([AutoAlphaPlugin]);
  addChild(mcHatAndFaceInstance);
  mcHatAndFaceInstance.x = 100;
  mcHatAndFaceInstance.y = 100;
  mcHatAndFaceInstance.alpha = 0;
  TweenLite.to(mcHatAndFaceInstance, 1, {autoAlpha:1});
}
  }
}

now, somewhere in your FLA (where you have the mcHatAndFace symbol),  
just for testing purposes:


1) remove all the code (document class, or timeline code)
2) add the following on frame 1

var main:Main = new Main();
addChild(main);
main.init();

hth,
Cedric



package
{
  import flash.display.MovieClip;
  import com.greensock.*;
  import com.greensock.plugins.*;
  import com.greensock.easing.*;
  public class Main extends MovieClip
{
public function Main():void
  {
  var mcHatAndFaceInstance:mcHatAndFace = new mcHatAndFace();
  TweenPlugin.activate([AutoAlphaPlugin]);
  var mcHatAndFace = new MovieClip();
  this.addChild(mcHatAndFace);
  mcHatAndFace.x = 100;
  mcHatAndFace.y = 100;
  mcHatAndFace.alpha = 0;
  TweenLite.to(mcHatAndFace, 1, {autoAlpha:1}); // 2nd param in  
seconds;

3rd in % alpha
  var main:Main = new Main();
  addChild(main);
  main.mcHatAndFace();
}
  }
}


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


Re: [Flashcoders] Problem with First Flash Movie

2009-11-17 Thread John McCormack

Beno,

It's difficult knowing exactly what you have done. I don't know any AS2, 
just AS3. To help sort out the scenario let's say:


You have a program called program.fla
You have clicked the stage and in 'properties' you have named the class 
as Main - without the as.

So the code that drives the swf is in a file called Main.as
The class Main must extend MovieClip.

That code in Main.as wants to use an asset called HatAndFace from 
program.fla's library.

All files are in the same directory.

If Main.as is going to use HatAndFace from the library then just write
var public myClip:HatAndFace = new HatAndFace;
or
var myClip:HatAndFace = new HatAndFace;

Use the first if it's in the class but not in a function, and the second 
if it's in a function.


I assume that mcHatAndFace is in your library, so perhaps your error was 
in writing:

var mcHatAndFace = new MovieClip;

For AS3 there are two errors here.
1. You don't want any old MovieClip, you want a HatAndFace MovieClip.
2. After the ':' you have to specify what 'type' of thing your instance 
name 'mcHatAndFace' applies to, like this...


var mcHatAndFace:MovieClip = new MovieClip;
Or, to fix both errors:
var mcHatAndFace:HatAndFace = new HatAndFace;

Notice that I have not written HatAndFace();
That's because I have not provided the HatAndFace() constructor method.

For a libary item, Flash will create a constructor that no one will ever 
see, just to get it going.


Now if you wanted tp place an HatAndFace instance at say x=100, y=200 
with a constructor call like 'new HatAndFace(100,200);' you can't.


To do that, you would write your own class in HatAndFace.as with a 
constructor HatAndFace(xx:int,yy:int) {...} that takes your required x,y.

This one will accept an xx,yy position which you can use to set x,y.
The library asset would name this class HatAndFace as the constructor 
for the exported code to be found in HatAndFace.as


If main.as is going to find the HatAndFace class in the HatAndFace.as 
file, then you have to import it.


Avoid a function built inside a function.

We never stop struggling.
You are not alone.

John


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


Re: [Flashcoders] Problem with First Flash Movie

2009-11-17 Thread beno -
On Tue, Nov 17, 2009 at 5:14 AM, Cedric Muller flashco...@benga.li wrote:

 Hi,

 Could you try the following ? (you were doing addChild on 'mcHatAndFace'
 class, but I know you want the instance to be added to the display list, not
 its class)

 Main.as:

 This is what came back from the code, etc. you sent me:


Main class is initialized
Error: Error #2136: The SWF file file contains invalid data at
Main/frame1()

When I took out the initialization code from the first frame, it stated that
the Main class had been initialized; however, the tweened alpha of
mcHatAndFace didn't appear, as the second trace never showed up.
Please advise,
beno
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Problem with First Flash Movie

2009-11-17 Thread Henrik Andersson

beno - wrote:

Error: Error #2136: The SWF filefile  contains invalid data at
Main/frame1()



The flash player does not like you creating a new instance of a class 
that is the document class for a swf.

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


Re: [Flashcoders] Problem with First Flash Movie

2009-11-17 Thread beno -
On Tue, Nov 17, 2009 at 6:21 AM, Henrik Andersson he...@henke37.cjb.netwrote:

 beno - wrote:

 Error: Error #2136: The SWF filefile  contains invalid data at
 Main/frame1()


 The flash player does not like you creating a new instance of a class that
 is the document class for a swf.


How is public function:init():void; creating a new instance of a class
that is the document class for a swf? Is init() defined as such a class?

Here is the revised code:

package
{
 import flash.display.MovieClip;
 import com.greensock.*;
 import com.greensock.plugins.*;
 import com.greensock.easing.*;
 public class Main extends MovieClip
   {
   public function Main():void
 {
 trace(Main class is initialized);
   }
  public function init():void
 {
   trace(Main.init is being called... let's see what happens now...);
 var mcHatAndFaceInstance:mcHatAndFace = new mcHatAndFace();
 TweenPlugin.activate([AutoAlphaPlugin]);
 addChild(mcHatAndFaceInstance);
 mcHatAndFaceInstance.x = 100;
 mcHatAndFaceInstance.y = 100;
 mcHatAndFaceInstance.alpha = 0;
 TweenLite.to(mcHatAndFaceInstance, 1, {autoAlpha:1});
   }
 }
}
Here is the old code:

package
{
  import flash.display.MovieClip;
  import com.greensock.*;
  import com.greensock.plugins.*;
  import com.greensock.easing.*;
  public class Main extends MovieClip
{
public function Main():void
  {
  var mcHatAndFaceInstance:mcHatAndFace = new mcHatAndFace();
  TweenPlugin.activate([AutoAlphaPlugin]);
  var mcHatAndFace = new MovieClip();
  this.addChild(mcHatAndFace);
  mcHatAndFace.x = 100;
  mcHatAndFace.y = 100;
  mcHatAndFace.alpha = 0;
  TweenLite.to(mcHatAndFace, 1, {autoAlpha:1}); // 2nd param in seconds;
3rd in % alpha
  var main:Main = new Main();
  addChild(main);
  main.mcHatAndFace();
}
  }
}

Please advise.
beno


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

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


Re: [Flashcoders] Problem with First Flash Movie

2009-11-17 Thread Cedric Muller

1) Just open your FLA in Flash IDE
2) In the PUBLISH panel, you have a textfield input named Class: 
 --- this is the document class, just leave it blank

3) retest with the revised code

hth,
Cedric

On Tue, Nov 17, 2009 at 6:21 AM, Henrik Andersson  
he...@henke37.cjb.netwrote:



beno - wrote:


Error: Error #2136: The SWF filefile  contains invalid data at
Main/frame1()


The flash player does not like you creating a new instance of a  
class that

is the document class for a swf.



How is public function:init():void; creating a new instance of a  
class
that is the document class for a swf? Is init() defined as such a  
class?


Here is the revised code:

package
{
 import flash.display.MovieClip;
 import com.greensock.*;
 import com.greensock.plugins.*;
 import com.greensock.easing.*;
 public class Main extends MovieClip
   {
   public function Main():void
 {
 trace(Main class is initialized);
   }
  public function init():void
 {
   trace(Main.init is being called... let's see what happens  
now...);

 var mcHatAndFaceInstance:mcHatAndFace = new mcHatAndFace();
 TweenPlugin.activate([AutoAlphaPlugin]);
 addChild(mcHatAndFaceInstance);
 mcHatAndFaceInstance.x = 100;
 mcHatAndFaceInstance.y = 100;
 mcHatAndFaceInstance.alpha = 0;
 TweenLite.to(mcHatAndFaceInstance, 1, {autoAlpha:1});
   }
 }
}
Here is the old code:

package
{
  import flash.display.MovieClip;
  import com.greensock.*;
  import com.greensock.plugins.*;
  import com.greensock.easing.*;
  public class Main extends MovieClip
{
public function Main():void
  {
  var mcHatAndFaceInstance:mcHatAndFace = new mcHatAndFace();
  TweenPlugin.activate([AutoAlphaPlugin]);
  var mcHatAndFace = new MovieClip();
  this.addChild(mcHatAndFace);
  mcHatAndFace.x = 100;
  mcHatAndFace.y = 100;
  mcHatAndFace.alpha = 0;
  TweenLite.to(mcHatAndFace, 1, {autoAlpha:1}); // 2nd param in  
seconds;

3rd in % alpha
  var main:Main = new Main();
  addChild(main);
  main.mcHatAndFace();
}
  }
}

Please advise.
beno



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


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


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


Re: [Flashcoders] Problem with First Flash Movie

2009-11-17 Thread beno -
On Tue, Nov 17, 2009 at 8:36 AM, Cedric Muller flashco...@benga.li wrote:

 1) Just open your FLA in Flash IDE
 2) In the PUBLISH panel, you have a textfield input named Class: ---
 this is the document class, just leave it blank
 3) retest with the revised code


YAHOO


 hth,


Ya, mon! Thanks!
beno
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Problem with First Flash Movie

2009-11-17 Thread Cedric Muller

:)
Now, the best is to try out different ways to launch your application  
and truely understand the differences between Classes, methods,  
properties, symbols, etc ... :)
Moreover, now that you've got your Main class working, please read  
Adobe tutorials and senocular's excellent information, you will grab  
a lot from there.


http://www.senocular.com/flash/tutorials/as3withflashcs3/

hth,
Cedric

On Tue, Nov 17, 2009 at 8:36 AM, Cedric Muller  
flashco...@benga.li wrote:



1) Just open your FLA in Flash IDE
2) In the PUBLISH panel, you have a textfield input named  
Class: ---

this is the document class, just leave it blank
3) retest with the revised code



YAHOO



hth,



Ya, mon! Thanks!
beno


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


Re: [Flashcoders] Problem with First Flash Movie

2009-11-17 Thread beno -
On Tue, Nov 17, 2009 at 10:49 AM, Cedric Muller flashco...@benga.li wrote:

 :)
 Now, the best is to try out different ways to launch your application and
 truely understand the differences between Classes, methods, properties,
 symbols, etc ... :)


I've put up a new post (Baby Step #2). Already run into a new problem :)


 Moreover, now that you've got your Main class working, please read Adobe
 tutorials and senocular's excellent information, you will grab a lot from
 there.

 http://www.senocular.com/flash/tutorials/as3withflashcs3/


I read the whole thing yesterday :) Still confused. Will consult it and the
flashandmath stuff I pulled down before consulting this list as I wait for
your replies.
TIA,
beno
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Problem with First Flash Movie

2009-11-17 Thread John McCormack

Well done Cedric!

beno,
Later on, have a look at:
Using the Document Class
on:
http://www.gotoandlearn.com/

John


Cedric Muller wrote:

:)
Now, the best is to try out different ways to launch your application 
and truely understand the differences between Classes, methods, 
properties, symbols, etc ... :)
Moreover, now that you've got your Main class working, please read 
Adobe tutorials and senocular's excellent information, you will grab a 
lot from there.


http://www.senocular.com/flash/tutorials/as3withflashcs3/

hth,
Cedric

On Tue, Nov 17, 2009 at 8:36 AM, Cedric Muller flashco...@benga.li 
wrote:



1) Just open your FLA in Flash IDE
2) In the PUBLISH panel, you have a textfield input named Class:
 ---

this is the document class, just leave it blank
3) retest with the revised code



YAHOO



hth,



Ya, mon! Thanks!
beno


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





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


Re: [Flashcoders] Problem with First Flash Movie

2009-11-16 Thread beno -
Regarding the matter of offense, don't worry about it. Yes, some posters do
tend to push the envelope and rely on the experts of the list more than
they should. Perhaps we're all guilty of that to an extent when we get
started. Yes, it brings the natural reaction to be abrupt, because it's the
student's job to do his utmost and not to tax the experts. It's an
unavoidable tension. All sides must be diligent in being respectful, the one
to the other.

Although I've programmed for years, I've never worked with classes :-) I
googled subclass actionscript 3 and figured out the main line of
extends, but that's about as far as I got. I know I'm close but I still
don't get it. Here's what I've got so far. But why am I subclassing Main?
All Main is doing in the below is linking the *.fla to the *.as Other than
that, it's worthless. And of course, Flash complains about having two
classes. Please help me understand and/or point me to some resources on this
particular subject.

package
{
  import flash.display.MovieClip;
  import com.greensock.*;
  import com.greensock.plugins.*;
  import com.greensock.easing.*;
  public class Main extends MovieClip
{
  public function Main():void
  {
}
  }
  class mcHatAndFace extends Main
{
  TweenPlugin.activate([AutoAlphaPlugin]);
  var mcHatAndFace = new MovieClip();
  this.addChild(mcHatAndFace);
  mcHatAndFace.x = 100;
  mcHatAndFace.y = 100;
  mcHatAndFace.alpha = 0;
  TweenLite.to(mcHatAndFace, 1, {autoAlpha:1}); // 2nd param in seconds;
3rd in % alpha
  }
}

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


Re: [Flashcoders] Problem with First Flash Movie

2009-11-16 Thread Cedric Muller

Hi Beno,

I think you are close ... but far :S, but close :)

public class Main extends MovieClip  --- this is your class declaration

public function Main ():void --- this is your class's constructor  
(first thing being called when you do a 'var main:Main = new Main()'


class mcHatAndFace -- this is not a class, it is just a method of  
your Main's class, hence you should write it:


public function mcHatAndFace ():void {
// your code goes here...
}

and then you can call this method by simply:

var main:Main = new Main();
addChild(main);		-- you have to add it to the scene since it is an  
extended MovieClip

main.mcHatAndFace();


Here is a very nice tutorial on getting started with AS3.
http://www.senocular.com/flash/tutorials/as3withflashcs3/

All in all (and more), http://www.senocular.com/ is a top quality  
site when it comes to understanding ActionScript and Flash Player.



Hth,
Cedric


package
{
  import flash.display.MovieClip;
  import com.greensock.*;
  import com.greensock.plugins.*;
  import com.greensock.easing.*;
  public class Main extends MovieClip
{
  public function Main():void
  {
}
  }
  class mcHatAndFace extends Main
{
  TweenPlugin.activate([AutoAlphaPlugin]);
  var mcHatAndFace = new MovieClip();
  this.addChild(mcHatAndFace);
  mcHatAndFace.x = 100;
  mcHatAndFace.y = 100;
  mcHatAndFace.alpha = 0;
  TweenLite.to(mcHatAndFace, 1, {autoAlpha:1}); // 2nd param in  
seconds;

3rd in % alpha
  }
}


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


  1   2   3   4   5   >