RE: [Flashcoders] Advice on creating dynamic crossword cluesth resize function

2009-05-21 Thread Paul Steven
Thanks Kevin

Would a scrollpane work if I have custom graphics for the scroll buttons.
This is for young kids so the scroll buttons are non standard big
illustrator arrow buttons. I don't want to have OS style scroll bar or
scroll arrows.

Paul

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin Bath
Sent: 20 May 2009 22:32
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Paul - why don't you use a scrollpane, add all the clues as separate mc's
into this component. That way you can target them separately to change the
text colour if you click on a square. You could space the clue mc's by using
the textheight property of the textfield within the clue mc.

If you toggle the text size - you'll just have to iterate through all the
clips in the scrollpane and re-space them out.

You'll have to display both across and down clues if you click on certain
squares. 

There may be better ways though!

rgds - Kevin.



-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Steven
Sent: 20 May 2009 19:45
To: 'Flash Coders List'
Subject: [Flashcoders] Advice on creating dynamic crossword cluesth resize
function

I am creating a crossword where the words and clues are read in from an xml
file. I need to be able to display the clues in a small area hence these
will need to scroll. I also need to highlight a particular clue if the word
on the crossword is clicked. Problem is that some clues will be on more than
one line so I am not sure how best to approach this and would appreciate
some advice. Also I need to include a function to toggle the text between
small and large. Btw I am programming this in Flash 8 with AS2.

My alternative solutions are as follows:

1.Attach a separate movie clip for each clue - not sure how I would position
these vertically and the effect of toggling the text size
2.Put all the clues in one dynamic text field  - not sure how I would select
a particular clue. With this solution would I be best to use a mask and
therefore have all the clues effectively displayed in the dynamic text field
at once.

Any advice on how best to deal with this would be really appreciated. 

Thanks

Paul





___
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] Flash qwerks??

2009-05-21 Thread Karl DeSaulniers

I don't know if its just me but has anyone ever run into a problem
where your FLA that uses classes (that worked perfectly before) don't  
load when you publish
and when you remove some erroneous files that are in the same dir. as  
the FLA,
say move them into another folder away from the FLA, the classes work  
again?


Is there some kind of cap on how many files or MBs that can be in the  
same dir. as a FLA that uses classes?
or is it some kind of script timeout that causes it not to load  
because there are so many files in the same dir.

that it has trouble loading? :-/

This may be one for the Adobe team?
Best,


Karl DeSaulniers
Design Drumm
http://designdrumm.com

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


RE: [Flashcoders] Advice on creating dynamic crossword cluesth resize function

2009-05-21 Thread Paul Steven
Thanks Kerry

Yes I do have the Advanced Lingo for Games book that has a crossword
puzzle example which has proven very helpful for the main engine behind the
crossword. I also have ActionScript 3.0 Game Programming University but
that only has a word search.

My main problem is being able to highlight individual clues and ensure they
are visible within the scrollable area. I need to be able to put a highlight
over the entire clue (which can be one or more lines long). If I put all the
clues in one text field, the scrolling works fine - I am just not sure how
to determine how high the highlight should be - especially as this will
change if the text size is toggled. If someone clicks on a word on the
crossword, if the corresponding clue is not currently visible (due to the
need to scroll to get to it) I need to adjust the scroll to ensure this clue
is visible and then also highlight the clue. So I effectively need to know
what the scroll position is to display each clue and also how to determine
the top and bottom of this clue. The highlight will extend the entire width
of the clue text field so there is no need to work out widths.

Any suggestions most welcome.

Thanks

Paul





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
Thompson
Sent: 20 May 2009 20:11
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Paul Steven wrote:

 I am creating a crossword where the words and clues are read in from an
xml
 file. I need to be able to display the clues in a small area hence these
 will need to scroll. I also need to highlight a particular clue if the
word
 on the crossword is clicked. Problem is that some clues will be on more
than
 one line so I am not sure how best to approach this and would appreciate
 some advice. Also I need to include a function to toggle the text between
 small and large. Btw I am programming this in Flash 8 with AS2.snip
 Any advice on how best to deal with this would be really appreciated.

Gary Rosenzweig has a really good book, Macromedia Flash MX ActionScript
for Fun and Games. I'm pretty sure it has the source for a crossword game
in it, and it's AS2. It's pretty cheap--around a dollar on Amazon. He also
has an updated book with AS3 code, ActionScript 3.0 Game Programming
University.

I haven't used this book, but I did use a similar book he had for Director,
and I adapted his crossword code for the now defunct Learning Network. It's
pretty good code, and easy to adapt. My version might even still be up on
Family Education Network (www.fen.com). I haven't checked, but they
inherited everything from Learning Network.

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] Parsing HTML tags within flash from an XHTML file?

2009-05-21 Thread Glen Pike

Hi,

  This article written by Steven looks just like what you are looking 
for...


  http://www.stevensacks.net/2008/07/02/parsing-xhtml-with-e4x-in-as3/
  
   To keep your formatting, you can use css - the TextField in Flash 
supports a subset of css that allows you to apply bold, colours and link 
formatting...


   Not sure if you are searching for EX4 or E4X!

   HTH

   Glen

Jonathan Wing wrote:

Hi,

I'm new to this group, so forgive me if I'm going about asking this the
wrong way. Is there a practical way to search old questions?

 


Anyway, I'm using the Gaia Framework and I'm trying to parse basic tags
such as h1 and a in flash via an XHTML file. Steven over at the Gaia
forum suggests I make use of EX4, but I've spent two days searching
google and reading up on it and I'm honestly confused where to start.

 


To show you what I mean, view the source on this page Steven created:
http://stevensacks.net/clients/hello/press.html#/agency/press 

 


Note how those columns are set using HTML tags, and pulled into flash
from that XHTML file. How do I maintain the formatting such as bold and
also the links, just the way he has done (strictly in terms of
functionality)? Thank you!

 


Thanks,

Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726) 
email: jw...@cramcrew.com mailto:jw...@cramcrew.com 
www.cramcrew.com http://www.cramcrew.com/ 



One Student At A Time

 





The information transmitted is intended only for the person or entity to which 
it is addressed and may contain proprietary, business-confidential and/or 
privileged material. If you are not the intended recipient of this message you 
are hereby notified that any use, review, retransmission, dissemination, 
distribution, reproduction or any action taken in reliance upon this message is 
prohibited. If you received this in error, please contact the sender and delete 
the material from any computer. Any views expressed in this message are those 
of the individual sender and may not necessarily reflect the views of the 
company.


___
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] Flash qwerks??

2009-05-21 Thread Glen Pike
I think there is a size limit for individual class files, but not sure 
what...


Karl DeSaulniers wrote:

I don't know if its just me but has anyone ever run into a problem
where your FLA that uses classes (that worked perfectly before) don't 
load when you publish
and when you remove some erroneous files that are in the same dir. as 
the FLA,
say move them into another folder away from the FLA, the classes work 
again?


Is there some kind of cap on how many files or MBs that can be in the 
same dir. as a FLA that uses classes?
or is it some kind of script timeout that causes it not to load 
because there are so many files in the same dir.

that it has trouble loading? :-/

This may be one for the Adobe team?
Best,


Karl DeSaulniers
Design Drumm
http://designdrumm.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] Operator Help!!

2009-05-21 Thread Paul Steven
Your code works fine for me this end.

Paul

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl
DeSaulniers
Sent: 21 May 2009 06:15
To: Flash Coders List
Subject: [Flashcoders] Operator Help!!

EEEk.. anyone!!!

What am I doing wrong?? This is AS2.

var sunrise:Array = new Array(6, 7, 8, 9, 10, 11, 12,  
13, 14, 15, 16, 17);
var sunset:Array = new Array(18, 19, 20, 21, 22, 23, 0,  
1, 2, 3, 4, 5);

var time:Date = new Date();
var hour:Number = time.getHours();
var hours:String = hour.toString();
var snRSE:String = sunrise[hours];
var snSET:String = sunset[hours];

this.onEnterFrame = function() {
if (hours == snRSE) {
BKGND.BKGND_Grad._alpha -= BKGND.BKGND_Grad._alpha +
8.333;
} else if (hours == snSET) {
BKGND.BKGND_Grad._alpha += BKGND.BKGND_Grad._alpha +
8.333;
}
};

I feel this is probably so easy, but it is eluding me for some reason.
flash says for this line:

if (hours == snRSE) {

  - operator = must be followed by an Operand ???


Karl DeSaulniers
Design Drumm
http://designdrumm.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] Operator Help!!

2009-05-21 Thread Glen Pike
The code does not show any errors, but you are trying to index an array 
of strings using a string - the indexes of the arrays sunrise and sunset 
will still be numbers so sunrise[hours] and sunset[hours] may not work 
if hours is a string...


I did this with a sunrise and sunset number before:

var sunrise:Number = 6;
var sunset:Number = 20;
var hour:Number = new Date().getHours();
if(sunrise = hour  sunset  hour) {
   //do sunrise stuff
} else {
   do sunset stuff...
}

Paul Steven wrote:

Your code works fine for me this end.

Paul

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl
DeSaulniers
Sent: 21 May 2009 06:15
To: Flash Coders List
Subject: [Flashcoders] Operator Help!!

EEEk.. anyone!!!

What am I doing wrong?? This is AS2.

var sunrise:Array = new Array(6, 7, 8, 9, 10, 11, 12,  
13, 14, 15, 16, 17);
var sunset:Array = new Array(18, 19, 20, 21, 22, 23, 0,  
1, 2, 3, 4, 5);


var time:Date = new Date();
var hour:Number = time.getHours();
var hours:String = hour.toString();
var snRSE:String = sunrise[hours];
var snSET:String = sunset[hours];

this.onEnterFrame = function() {
if (hours == snRSE) {
BKGND.BKGND_Grad._alpha -= BKGND.BKGND_Grad._alpha +
8.333;
} else if (hours == snSET) {
BKGND.BKGND_Grad._alpha += BKGND.BKGND_Grad._alpha +
8.333;
}
};

I feel this is probably so easy, but it is eluding me for some reason.
flash says for this line:

if (hours == snRSE) {

  - operator = must be followed by an Operand ???


Karl DeSaulniers
Design Drumm
http://designdrumm.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] Operator Help!!

2009-05-21 Thread Karl DeSaulniers

Really!?
Hmm thats weird. I wonder why its throwing an error on my end.
I take it you pub with AS2? or did you pub with AS3 as the script lang?

Karl


On May 21, 2009, at 4:26 AM, Paul Steven wrote:


Your code works fine for me this end.

Paul

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl
DeSaulniers
Sent: 21 May 2009 06:15
To: Flash Coders List
Subject: [Flashcoders] Operator Help!!

EEEk.. anyone!!!

What am I doing wrong?? This is AS2.

var sunrise:Array = new Array(6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17);
var sunset:Array = new Array(18, 19, 20, 21, 22, 23, 0,
1, 2, 3, 4, 5);

var time:Date = new Date();
var hour:Number = time.getHours();
var hours:String = hour.toString();
var snRSE:String = sunrise[hours];
var snSET:String = sunset[hours];

this.onEnterFrame = function() {
if (hours == snRSE) {
BKGND.BKGND_Grad._alpha -= BKGND.BKGND_Grad._alpha +
8.333;
} else if (hours == snSET) {
BKGND.BKGND_Grad._alpha += BKGND.BKGND_Grad._alpha +
8.333;
}
};

I feel this is probably so easy, but it is eluding me for some reason.
flash says for this line:

if (hours == snRSE) {

  - operator = must be followed by an Operand ???


Karl DeSaulniers
Design Drumm
http://designdrumm.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


Karl DeSaulniers
Design Drumm
http://designdrumm.com

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


Re: [Flashcoders] Operator Help!!

2009-05-21 Thread Glen Pike

Hi,

   I pasted into a Flash file (AS2) and checked the syntax - did not 
publish as I don't have the MovieClips, etc..  


   Glen

Karl DeSaulniers wrote:

Really!?
Hmm thats weird. I wonder why its throwing an error on my end.
I take it you pub with AS2? or did you pub with AS3 as the script lang?

Karl


On May 21, 2009, at 4:26 AM, Paul Steven wrote:


Your code works fine for me this end.

Paul

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl
DeSaulniers
Sent: 21 May 2009 06:15
To: Flash Coders List
Subject: [Flashcoders] Operator Help!!

EEEk.. anyone!!!

What am I doing wrong?? This is AS2.

var sunrise:Array = new Array(6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17);
var sunset:Array = new Array(18, 19, 20, 21, 22, 23, 0,
1, 2, 3, 4, 5);

var time:Date = new Date();
var hour:Number = time.getHours();
var hours:String = hour.toString();
var snRSE:String = sunrise[hours];
var snSET:String = sunset[hours];

this.onEnterFrame = function() {
 if (hours == snRSE) {
BKGND.BKGND_Grad._alpha -= BKGND.BKGND_Grad._alpha +
8.333;
 } else if (hours == snSET) {
BKGND.BKGND_Grad._alpha += BKGND.BKGND_Grad._alpha +
8.333;
}
};

I feel this is probably so easy, but it is eluding me for some reason.
flash says for this line:

if (hours == snRSE) {

  - operator = must be followed by an Operand ???


Karl DeSaulniers
Design Drumm
http://designdrumm.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


Karl DeSaulniers
Design Drumm
http://designdrumm.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] Advice on creating dynamic crossword cluesth resize function

2009-05-21 Thread Kevin Bath
Paul - I've knocked up a quick example of moving a masked movieclip which
contains textfields populated by xml data. It should work with any length
clue and demonstrates how to get a list of clues/textfields to autoscroll to
a position - and resizes the highlight to match height of clue textfield.
Just click on the numbers to get it to move.

It's not pretty and the code is a bit rough (and in AS2) - but it
demonstrates the principle. You may be well ahead of this by now - but I
fancied a fiddle!

You can grab it here. www.flowdigital.co.uk/download/crosswordclues.zip


Kev.


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Steven
Sent: 21 May 2009 08:44
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Thanks Kerry

Yes I do have the Advanced Lingo for Games book that has a crossword
puzzle example which has proven very helpful for the main engine behind the
crossword. I also have ActionScript 3.0 Game Programming University but
that only has a word search.

My main problem is being able to highlight individual clues and ensure they
are visible within the scrollable area. I need to be able to put a highlight
over the entire clue (which can be one or more lines long). If I put all the
clues in one text field, the scrolling works fine - I am just not sure how
to determine how high the highlight should be - especially as this will
change if the text size is toggled. If someone clicks on a word on the
crossword, if the corresponding clue is not currently visible (due to the
need to scroll to get to it) I need to adjust the scroll to ensure this clue
is visible and then also highlight the clue. So I effectively need to know
what the scroll position is to display each clue and also how to determine
the top and bottom of this clue. The highlight will extend the entire width
of the clue text field so there is no need to work out widths.

Any suggestions most welcome.

Thanks

Paul





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
Thompson
Sent: 20 May 2009 20:11
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Paul Steven wrote:

 I am creating a crossword where the words and clues are read in from an
xml
 file. I need to be able to display the clues in a small area hence these
 will need to scroll. I also need to highlight a particular clue if the
word
 on the crossword is clicked. Problem is that some clues will be on more
than
 one line so I am not sure how best to approach this and would appreciate
 some advice. Also I need to include a function to toggle the text between
 small and large. Btw I am programming this in Flash 8 with AS2.snip
 Any advice on how best to deal with this would be really appreciated.

Gary Rosenzweig has a really good book, Macromedia Flash MX ActionScript
for Fun and Games. I'm pretty sure it has the source for a crossword game
in it, and it's AS2. It's pretty cheap--around a dollar on Amazon. He also
has an updated book with AS3 code, ActionScript 3.0 Game Programming
University.

I haven't used this book, but I did use a similar book he had for Director,
and I adapted his crossword code for the now defunct Learning Network. It's
pretty good code, and easy to adapt. My version might even still be up on
Family Education Network (www.fen.com). I haven't checked, but they
inherited everything from Learning Network.

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


Re: [Flashcoders] Advice on creating dynamic crossword cluesth resize function

2009-05-21 Thread allandt bik-elliott (thefieldcomic.com)
You could try something like
http://www.tutorialized.com/view/tutorial/Search-and-Replace-String-1.0/2913to
add html tags to the text string

if it was in as3, you could probably do this much better with regular
expressions

a

On Thu, May 21, 2009 at 11:32 AM, Kevin Bath ke...@flowdigital.co.ukwrote:

 Paul - I've knocked up a quick example of moving a masked movieclip which
 contains textfields populated by xml data. It should work with any length
 clue and demonstrates how to get a list of clues/textfields to autoscroll
 to
 a position - and resizes the highlight to match height of clue textfield.
 Just click on the numbers to get it to move.

 It's not pretty and the code is a bit rough (and in AS2) - but it
 demonstrates the principle. You may be well ahead of this by now - but I
 fancied a fiddle!

 You can grab it here. www.flowdigital.co.uk/download/crosswordclues.zip


 Kev.


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul
 Steven
 Sent: 21 May 2009 08:44
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Thanks Kerry

 Yes I do have the Advanced Lingo for Games book that has a crossword
 puzzle example which has proven very helpful for the main engine behind the
 crossword. I also have ActionScript 3.0 Game Programming University but
 that only has a word search.

 My main problem is being able to highlight individual clues and ensure they
 are visible within the scrollable area. I need to be able to put a
 highlight
 over the entire clue (which can be one or more lines long). If I put all
 the
 clues in one text field, the scrolling works fine - I am just not sure how
 to determine how high the highlight should be - especially as this will
 change if the text size is toggled. If someone clicks on a word on the
 crossword, if the corresponding clue is not currently visible (due to the
 need to scroll to get to it) I need to adjust the scroll to ensure this
 clue
 is visible and then also highlight the clue. So I effectively need to know
 what the scroll position is to display each clue and also how to determine
 the top and bottom of this clue. The highlight will extend the entire width
 of the clue text field so there is no need to work out widths.

 Any suggestions most welcome.

 Thanks

 Paul





 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
 Thompson
 Sent: 20 May 2009 20:11
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Paul Steven wrote:

  I am creating a crossword where the words and clues are read in from an
 xml
  file. I need to be able to display the clues in a small area hence these
  will need to scroll. I also need to highlight a particular clue if the
 word
  on the crossword is clicked. Problem is that some clues will be on more
 than
  one line so I am not sure how best to approach this and would appreciate
  some advice. Also I need to include a function to toggle the text between
  small and large. Btw I am programming this in Flash 8 with AS2.snip
  Any advice on how best to deal with this would be really appreciated.

 Gary Rosenzweig has a really good book, Macromedia Flash MX ActionScript
 for Fun and Games. I'm pretty sure it has the source for a crossword game
 in it, and it's AS2. It's pretty cheap--around a dollar on Amazon. He also
 has an updated book with AS3 code, ActionScript 3.0 Game Programming
 University.

 I haven't used this book, but I did use a similar book he had for Director,
 and I adapted his crossword code for the now defunct Learning Network. It's
 pretty good code, and easy to adapt. My version might even still be up on
 Family Education Network (www.fen.com). I haven't checked, but they
 inherited everything from Learning Network.

 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 mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Advice on creating dynamic crossword cluesth resize function

2009-05-21 Thread Paul Steven
Hey thanks a million Kev! I will have a look at this now. I really
appreciate your time knocking up this file.

Cheers

Paul

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin Bath
Sent: 21 May 2009 11:33
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Paul - I've knocked up a quick example of moving a masked movieclip which
contains textfields populated by xml data. It should work with any length
clue and demonstrates how to get a list of clues/textfields to autoscroll to
a position - and resizes the highlight to match height of clue textfield.
Just click on the numbers to get it to move.

It's not pretty and the code is a bit rough (and in AS2) - but it
demonstrates the principle. You may be well ahead of this by now - but I
fancied a fiddle!

You can grab it here. www.flowdigital.co.uk/download/crosswordclues.zip


Kev.


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Steven
Sent: 21 May 2009 08:44
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Thanks Kerry

Yes I do have the Advanced Lingo for Games book that has a crossword
puzzle example which has proven very helpful for the main engine behind the
crossword. I also have ActionScript 3.0 Game Programming University but
that only has a word search.

My main problem is being able to highlight individual clues and ensure they
are visible within the scrollable area. I need to be able to put a highlight
over the entire clue (which can be one or more lines long). If I put all the
clues in one text field, the scrolling works fine - I am just not sure how
to determine how high the highlight should be - especially as this will
change if the text size is toggled. If someone clicks on a word on the
crossword, if the corresponding clue is not currently visible (due to the
need to scroll to get to it) I need to adjust the scroll to ensure this clue
is visible and then also highlight the clue. So I effectively need to know
what the scroll position is to display each clue and also how to determine
the top and bottom of this clue. The highlight will extend the entire width
of the clue text field so there is no need to work out widths.

Any suggestions most welcome.

Thanks

Paul





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
Thompson
Sent: 20 May 2009 20:11
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Paul Steven wrote:

 I am creating a crossword where the words and clues are read in from an
xml
 file. I need to be able to display the clues in a small area hence these
 will need to scroll. I also need to highlight a particular clue if the
word
 on the crossword is clicked. Problem is that some clues will be on more
than
 one line so I am not sure how best to approach this and would appreciate
 some advice. Also I need to include a function to toggle the text between
 small and large. Btw I am programming this in Flash 8 with AS2.snip
 Any advice on how best to deal with this would be really appreciated.

Gary Rosenzweig has a really good book, Macromedia Flash MX ActionScript
for Fun and Games. I'm pretty sure it has the source for a crossword game
in it, and it's AS2. It's pretty cheap--around a dollar on Amazon. He also
has an updated book with AS3 code, ActionScript 3.0 Game Programming
University.

I haven't used this book, but I did use a similar book he had for Director,
and I adapted his crossword code for the now defunct Learning Network. It's
pretty good code, and easy to adapt. My version might even still be up on
Family Education Network (www.fen.com). I haven't checked, but they
inherited everything from Learning Network.

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 mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Advice on creating dynamic crossword cluesth resize function

2009-05-21 Thread Paul Steven
There are no fonts mentioned in the code. And no fonts appear in font
mapping. I have even tried adding

txtClue.font = Times New Roman;

But the text just doesn't seem to want to display:(

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen Pike
Sent: 21 May 2009 12:38
To: Flash Coders List
Subject: Re: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

You are probly missing a font...

Paul Steven wrote:
 Kev, when I publish this for Flash Player 8 or 9 the text does not appear.
 It is definitely there as the highlights are the correct position and
size.
 Any idea why the text is not actually visible?

 Also out of curiousity what is the XMP metadata?

 Thanks

 Paul

 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin Bath
 Sent: 21 May 2009 11:33
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Paul - I've knocked up a quick example of moving a masked movieclip which
 contains textfields populated by xml data. It should work with any length
 clue and demonstrates how to get a list of clues/textfields to autoscroll
to
 a position - and resizes the highlight to match height of clue textfield.
 Just click on the numbers to get it to move.

 It's not pretty and the code is a bit rough (and in AS2) - but it
 demonstrates the principle. You may be well ahead of this by now - but I
 fancied a fiddle!

 You can grab it here. www.flowdigital.co.uk/download/crosswordclues.zip


 Kev.


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul
Steven
 Sent: 21 May 2009 08:44
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Thanks Kerry

 Yes I do have the Advanced Lingo for Games book that has a crossword
 puzzle example which has proven very helpful for the main engine behind
the
 crossword. I also have ActionScript 3.0 Game Programming University but
 that only has a word search.

 My main problem is being able to highlight individual clues and ensure
they
 are visible within the scrollable area. I need to be able to put a
highlight
 over the entire clue (which can be one or more lines long). If I put all
the
 clues in one text field, the scrolling works fine - I am just not sure how
 to determine how high the highlight should be - especially as this will
 change if the text size is toggled. If someone clicks on a word on the
 crossword, if the corresponding clue is not currently visible (due to the
 need to scroll to get to it) I need to adjust the scroll to ensure this
clue
 is visible and then also highlight the clue. So I effectively need to know
 what the scroll position is to display each clue and also how to determine
 the top and bottom of this clue. The highlight will extend the entire
width
 of the clue text field so there is no need to work out widths.

 Any suggestions most welcome.

 Thanks

 Paul





 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
 Thompson
 Sent: 20 May 2009 20:11
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Paul Steven wrote:

   
 I am creating a crossword where the words and clues are read in from an
 
 xml
   
 file. I need to be able to display the clues in a small area hence these
 will need to scroll. I also need to highlight a particular clue if the
 
 word
   
 on the crossword is clicked. Problem is that some clues will be on more
 
 than
   
 one line so I am not sure how best to approach this and would appreciate
 some advice. Also I need to include a function to toggle the text between
 small and large. Btw I am programming this in Flash 8 with AS2.snip
 Any advice on how best to deal with this would be really appreciated.
 

 Gary Rosenzweig has a really good book, Macromedia Flash MX ActionScript
 for Fun and Games. I'm pretty sure it has the source for a crossword game
 in it, and it's AS2. It's pretty cheap--around a dollar on Amazon. He also
 has an updated book with AS3 code, ActionScript 3.0 Game Programming
 University.

 I haven't used this book, but I did use a similar book he had for
Director,
 and I adapted his crossword code for the now defunct Learning Network.
It's
 pretty good code, and easy to adapt. My version might even still be up on
 Family Education Network (www.fen.com). I haven't checked, but they
 inherited everything from Learning Network.

 Cordially,

 Kerry Thompson

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 

Re: [Flashcoders] Advice on creating dynamic crossword cluesth resize function

2009-05-21 Thread Glen Pike

You are probly missing a font...

Paul Steven wrote:

Kev, when I publish this for Flash Player 8 or 9 the text does not appear.
It is definitely there as the highlights are the correct position and size.
Any idea why the text is not actually visible?

Also out of curiousity what is the XMP metadata?

Thanks

Paul

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin Bath
Sent: 21 May 2009 11:33
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Paul - I've knocked up a quick example of moving a masked movieclip which
contains textfields populated by xml data. It should work with any length
clue and demonstrates how to get a list of clues/textfields to autoscroll to
a position - and resizes the highlight to match height of clue textfield.
Just click on the numbers to get it to move.

It's not pretty and the code is a bit rough (and in AS2) - but it
demonstrates the principle. You may be well ahead of this by now - but I
fancied a fiddle!

You can grab it here. www.flowdigital.co.uk/download/crosswordclues.zip


Kev.


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Steven
Sent: 21 May 2009 08:44
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Thanks Kerry

Yes I do have the Advanced Lingo for Games book that has a crossword
puzzle example which has proven very helpful for the main engine behind the
crossword. I also have ActionScript 3.0 Game Programming University but
that only has a word search.

My main problem is being able to highlight individual clues and ensure they
are visible within the scrollable area. I need to be able to put a highlight
over the entire clue (which can be one or more lines long). If I put all the
clues in one text field, the scrolling works fine - I am just not sure how
to determine how high the highlight should be - especially as this will
change if the text size is toggled. If someone clicks on a word on the
crossword, if the corresponding clue is not currently visible (due to the
need to scroll to get to it) I need to adjust the scroll to ensure this clue
is visible and then also highlight the clue. So I effectively need to know
what the scroll position is to display each clue and also how to determine
the top and bottom of this clue. The highlight will extend the entire width
of the clue text field so there is no need to work out widths.

Any suggestions most welcome.

Thanks

Paul





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
Thompson
Sent: 20 May 2009 20:11
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Paul Steven wrote:

  

I am creating a crossword where the words and clues are read in from an


xml
  

file. I need to be able to display the clues in a small area hence these
will need to scroll. I also need to highlight a particular clue if the


word
  

on the crossword is clicked. Problem is that some clues will be on more


than
  

one line so I am not sure how best to approach this and would appreciate
some advice. Also I need to include a function to toggle the text between
small and large. Btw I am programming this in Flash 8 with AS2.snip
Any advice on how best to deal with this would be really appreciated.



Gary Rosenzweig has a really good book, Macromedia Flash MX ActionScript
for Fun and Games. I'm pretty sure it has the source for a crossword game
in it, and it's AS2. It's pretty cheap--around a dollar on Amazon. He also
has an updated book with AS3 code, ActionScript 3.0 Game Programming
University.

I haven't used this book, but I did use a similar book he had for Director,
and I adapted his crossword code for the now defunct Learning Network. It's
pretty good code, and easy to adapt. My version might even still be up on
Family Education Network (www.fen.com). I haven't checked, but they
inherited everything from Learning Network.

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 mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


  



RE: [Flashcoders] Advice on creating dynamic crossword cluesth resize function

2009-05-21 Thread Paul Steven
Kev, when I publish this for Flash Player 8 or 9 the text does not appear.
It is definitely there as the highlights are the correct position and size.
Any idea why the text is not actually visible?

Also out of curiousity what is the XMP metadata?

Thanks

Paul

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin Bath
Sent: 21 May 2009 11:33
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Paul - I've knocked up a quick example of moving a masked movieclip which
contains textfields populated by xml data. It should work with any length
clue and demonstrates how to get a list of clues/textfields to autoscroll to
a position - and resizes the highlight to match height of clue textfield.
Just click on the numbers to get it to move.

It's not pretty and the code is a bit rough (and in AS2) - but it
demonstrates the principle. You may be well ahead of this by now - but I
fancied a fiddle!

You can grab it here. www.flowdigital.co.uk/download/crosswordclues.zip


Kev.


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Steven
Sent: 21 May 2009 08:44
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Thanks Kerry

Yes I do have the Advanced Lingo for Games book that has a crossword
puzzle example which has proven very helpful for the main engine behind the
crossword. I also have ActionScript 3.0 Game Programming University but
that only has a word search.

My main problem is being able to highlight individual clues and ensure they
are visible within the scrollable area. I need to be able to put a highlight
over the entire clue (which can be one or more lines long). If I put all the
clues in one text field, the scrolling works fine - I am just not sure how
to determine how high the highlight should be - especially as this will
change if the text size is toggled. If someone clicks on a word on the
crossword, if the corresponding clue is not currently visible (due to the
need to scroll to get to it) I need to adjust the scroll to ensure this clue
is visible and then also highlight the clue. So I effectively need to know
what the scroll position is to display each clue and also how to determine
the top and bottom of this clue. The highlight will extend the entire width
of the clue text field so there is no need to work out widths.

Any suggestions most welcome.

Thanks

Paul





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
Thompson
Sent: 20 May 2009 20:11
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Paul Steven wrote:

 I am creating a crossword where the words and clues are read in from an
xml
 file. I need to be able to display the clues in a small area hence these
 will need to scroll. I also need to highlight a particular clue if the
word
 on the crossword is clicked. Problem is that some clues will be on more
than
 one line so I am not sure how best to approach this and would appreciate
 some advice. Also I need to include a function to toggle the text between
 small and large. Btw I am programming this in Flash 8 with AS2.snip
 Any advice on how best to deal with this would be really appreciated.

Gary Rosenzweig has a really good book, Macromedia Flash MX ActionScript
for Fun and Games. I'm pretty sure it has the source for a crossword game
in it, and it's AS2. It's pretty cheap--around a dollar on Amazon. He also
has an updated book with AS3 code, ActionScript 3.0 Game Programming
University.

I haven't used this book, but I did use a similar book he had for Director,
and I adapted his crossword code for the now defunct Learning Network. It's
pretty good code, and easy to adapt. My version might even still be up on
Family Education Network (www.fen.com). I haven't checked, but they
inherited everything from Learning Network.

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 mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Advice on creating dynamic crossword cluesth resize function

2009-05-21 Thread Glen Pike
I am guessing you might want to publish for older players to see it 
working - can't open the file as I only have CS3 here, sorry.


Try chucking a text field with the Times font embedded off the stage 
somewhere - not sure if that helps, but it might...


XMP metadata is Adobe's proprietry XML structure for adding info to 
files - I guess this helps exchanging data between Adobe products...


http://en.wikipedia.org/wiki/Extensible_Metadata_Platform

HTH

Glen


Paul Steven wrote:

There are no fonts mentioned in the code. And no fonts appear in font
mapping. I have even tried adding

txtClue.font = Times New Roman;

But the text just doesn't seem to want to display:(

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen Pike
Sent: 21 May 2009 12:38
To: Flash Coders List
Subject: Re: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

You are probly missing a font...

Paul Steven wrote:
  

Kev, when I publish this for Flash Player 8 or 9 the text does not appear.
It is definitely there as the highlights are the correct position and


size.
  

Any idea why the text is not actually visible?

Also out of curiousity what is the XMP metadata?

Thanks

Paul

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin Bath
Sent: 21 May 2009 11:33
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Paul - I've knocked up a quick example of moving a masked movieclip which
contains textfields populated by xml data. It should work with any length
clue and demonstrates how to get a list of clues/textfields to autoscroll


to
  

a position - and resizes the highlight to match height of clue textfield.
Just click on the numbers to get it to move.

It's not pretty and the code is a bit rough (and in AS2) - but it
demonstrates the principle. You may be well ahead of this by now - but I
fancied a fiddle!

You can grab it here. www.flowdigital.co.uk/download/crosswordclues.zip


Kev.


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul


Steven
  

Sent: 21 May 2009 08:44
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Thanks Kerry

Yes I do have the Advanced Lingo for Games book that has a crossword
puzzle example which has proven very helpful for the main engine behind


the
  

crossword. I also have ActionScript 3.0 Game Programming University but
that only has a word search.

My main problem is being able to highlight individual clues and ensure


they
  

are visible within the scrollable area. I need to be able to put a


highlight
  

over the entire clue (which can be one or more lines long). If I put all


the
  

clues in one text field, the scrolling works fine - I am just not sure how
to determine how high the highlight should be - especially as this will
change if the text size is toggled. If someone clicks on a word on the
crossword, if the corresponding clue is not currently visible (due to the
need to scroll to get to it) I need to adjust the scroll to ensure this


clue
  

is visible and then also highlight the clue. So I effectively need to know
what the scroll position is to display each clue and also how to determine
the top and bottom of this clue. The highlight will extend the entire


width
  

of the clue text field so there is no need to work out widths.

Any suggestions most welcome.

Thanks

Paul





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
Thompson
Sent: 20 May 2009 20:11
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Paul Steven wrote:

  


I am creating a crossword where the words and clues are read in from an

  

xml
  


file. I need to be able to display the clues in a small area hence these
will need to scroll. I also need to highlight a particular clue if the

  

word
  


on the crossword is clicked. Problem is that some clues will be on more

  

than
  


one line so I am not sure how best to approach this and would appreciate
some advice. Also I need to include a function to toggle the text between
small and large. Btw I am programming this in Flash 8 with AS2.snip
Any advice on how best to deal with this would be really appreciated.

  

Gary Rosenzweig has a really good book, Macromedia Flash MX ActionScript
for Fun and Games. I'm pretty sure it has the source for a crossword game
in it, and it's AS2. It's pretty cheap--around a dollar on Amazon. He also
has an updated book with AS3 code, ActionScript 3.0 Game 

RE: [Flashcoders] Advice on creating dynamic crossword cluesth resize function

2009-05-21 Thread Kevin Bath
Hmm...

See what you mean. FP 10 - font is visible - FP 9, 8 - not showing. Strange.

Pretty sure it is an embedded font issue as Glen says - as when mask is
removed font shows.

Will have a play...

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen Pike
Sent: 21 May 2009 12:38
To: Flash Coders List
Subject: Re: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

You are probly missing a font...

Paul Steven wrote:
 Kev, when I publish this for Flash Player 8 or 9 the text does not appear.
 It is definitely there as the highlights are the correct position and
size.
 Any idea why the text is not actually visible?

 Also out of curiousity what is the XMP metadata?

 Thanks

 Paul

 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin Bath
 Sent: 21 May 2009 11:33
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Paul - I've knocked up a quick example of moving a masked movieclip which
 contains textfields populated by xml data. It should work with any length
 clue and demonstrates how to get a list of clues/textfields to autoscroll
to
 a position - and resizes the highlight to match height of clue textfield.
 Just click on the numbers to get it to move.

 It's not pretty and the code is a bit rough (and in AS2) - but it
 demonstrates the principle. You may be well ahead of this by now - but I
 fancied a fiddle!

 You can grab it here. www.flowdigital.co.uk/download/crosswordclues.zip


 Kev.


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul
Steven
 Sent: 21 May 2009 08:44
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Thanks Kerry

 Yes I do have the Advanced Lingo for Games book that has a crossword
 puzzle example which has proven very helpful for the main engine behind
the
 crossword. I also have ActionScript 3.0 Game Programming University but
 that only has a word search.

 My main problem is being able to highlight individual clues and ensure
they
 are visible within the scrollable area. I need to be able to put a
highlight
 over the entire clue (which can be one or more lines long). If I put all
the
 clues in one text field, the scrolling works fine - I am just not sure how
 to determine how high the highlight should be - especially as this will
 change if the text size is toggled. If someone clicks on a word on the
 crossword, if the corresponding clue is not currently visible (due to the
 need to scroll to get to it) I need to adjust the scroll to ensure this
clue
 is visible and then also highlight the clue. So I effectively need to know
 what the scroll position is to display each clue and also how to determine
 the top and bottom of this clue. The highlight will extend the entire
width
 of the clue text field so there is no need to work out widths.

 Any suggestions most welcome.

 Thanks

 Paul





 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
 Thompson
 Sent: 20 May 2009 20:11
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Paul Steven wrote:

   
 I am creating a crossword where the words and clues are read in from an
 
 xml
   
 file. I need to be able to display the clues in a small area hence these
 will need to scroll. I also need to highlight a particular clue if the
 
 word
   
 on the crossword is clicked. Problem is that some clues will be on more
 
 than
   
 one line so I am not sure how best to approach this and would appreciate
 some advice. Also I need to include a function to toggle the text between
 small and large. Btw I am programming this in Flash 8 with AS2.snip
 Any advice on how best to deal with this would be really appreciated.
 

 Gary Rosenzweig has a really good book, Macromedia Flash MX ActionScript
 for Fun and Games. I'm pretty sure it has the source for a crossword game
 in it, and it's AS2. It's pretty cheap--around a dollar on Amazon. He also
 has an updated book with AS3 code, ActionScript 3.0 Game Programming
 University.

 I haven't used this book, but I did use a similar book he had for
Director,
 and I adapted his crossword code for the now defunct Learning Network.
It's
 pretty good code, and easy to adapt. My version might even still be up on
 Family Education Network (www.fen.com). I haven't checked, but they
 inherited everything from Learning Network.

 Cordially,

 Kerry Thompson

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 

RE: [Flashcoders] Advice on creating dynamic crossword cluesth resize function

2009-05-21 Thread Kevin Bath
Yay! Will work with FP9 and 8 if you add...

txtClue.embedFonts = true;

(doh - sorry)

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Steven
Sent: 21 May 2009 12:41
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

There are no fonts mentioned in the code. And no fonts appear in font
mapping. I have even tried adding

txtClue.font = Times New Roman;

But the text just doesn't seem to want to display:(

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen Pike
Sent: 21 May 2009 12:38
To: Flash Coders List
Subject: Re: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

You are probly missing a font...

Paul Steven wrote:
 Kev, when I publish this for Flash Player 8 or 9 the text does not appear.
 It is definitely there as the highlights are the correct position and
size.
 Any idea why the text is not actually visible?

 Also out of curiousity what is the XMP metadata?

 Thanks

 Paul

 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin Bath
 Sent: 21 May 2009 11:33
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Paul - I've knocked up a quick example of moving a masked movieclip which
 contains textfields populated by xml data. It should work with any length
 clue and demonstrates how to get a list of clues/textfields to autoscroll
to
 a position - and resizes the highlight to match height of clue textfield.
 Just click on the numbers to get it to move.

 It's not pretty and the code is a bit rough (and in AS2) - but it
 demonstrates the principle. You may be well ahead of this by now - but I
 fancied a fiddle!

 You can grab it here. www.flowdigital.co.uk/download/crosswordclues.zip


 Kev.


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul
Steven
 Sent: 21 May 2009 08:44
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Thanks Kerry

 Yes I do have the Advanced Lingo for Games book that has a crossword
 puzzle example which has proven very helpful for the main engine behind
the
 crossword. I also have ActionScript 3.0 Game Programming University but
 that only has a word search.

 My main problem is being able to highlight individual clues and ensure
they
 are visible within the scrollable area. I need to be able to put a
highlight
 over the entire clue (which can be one or more lines long). If I put all
the
 clues in one text field, the scrolling works fine - I am just not sure how
 to determine how high the highlight should be - especially as this will
 change if the text size is toggled. If someone clicks on a word on the
 crossword, if the corresponding clue is not currently visible (due to the
 need to scroll to get to it) I need to adjust the scroll to ensure this
clue
 is visible and then also highlight the clue. So I effectively need to know
 what the scroll position is to display each clue and also how to determine
 the top and bottom of this clue. The highlight will extend the entire
width
 of the clue text field so there is no need to work out widths.

 Any suggestions most welcome.

 Thanks

 Paul





 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
 Thompson
 Sent: 20 May 2009 20:11
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Paul Steven wrote:

   
 I am creating a crossword where the words and clues are read in from an
 
 xml
   
 file. I need to be able to display the clues in a small area hence these
 will need to scroll. I also need to highlight a particular clue if the
 
 word
   
 on the crossword is clicked. Problem is that some clues will be on more
 
 than
   
 one line so I am not sure how best to approach this and would appreciate
 some advice. Also I need to include a function to toggle the text between
 small and large. Btw I am programming this in Flash 8 with AS2.snip
 Any advice on how best to deal with this would be really appreciated.
 

 Gary Rosenzweig has a really good book, Macromedia Flash MX ActionScript
 for Fun and Games. I'm pretty sure it has the source for a crossword game
 in it, and it's AS2. It's pretty cheap--around a dollar on Amazon. He also
 has an updated book with AS3 code, ActionScript 3.0 Game Programming
 University.

 I haven't used this book, but I did use a similar book he had for
Director,
 and I adapted his crossword code for the now defunct Learning Network.
It's
 

RE: [Flashcoders] Advice on creating dynamic crossword cluesth resize function

2009-05-21 Thread Paul Steven
Bah - added the txtClue.embedFonts = true; but still no text. Is there a
particular font I need to have? I can't see any reference to any particular
font

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin Bath
Sent: 21 May 2009 13:50
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Yay! Will work with FP9 and 8 if you add...

txtClue.embedFonts = true;

(doh - sorry)

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Steven
Sent: 21 May 2009 12:41
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

There are no fonts mentioned in the code. And no fonts appear in font
mapping. I have even tried adding

txtClue.font = Times New Roman;

But the text just doesn't seem to want to display:(

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen Pike
Sent: 21 May 2009 12:38
To: Flash Coders List
Subject: Re: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

You are probly missing a font...

Paul Steven wrote:
 Kev, when I publish this for Flash Player 8 or 9 the text does not appear.
 It is definitely there as the highlights are the correct position and
size.
 Any idea why the text is not actually visible?

 Also out of curiousity what is the XMP metadata?

 Thanks

 Paul

 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin Bath
 Sent: 21 May 2009 11:33
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Paul - I've knocked up a quick example of moving a masked movieclip which
 contains textfields populated by xml data. It should work with any length
 clue and demonstrates how to get a list of clues/textfields to autoscroll
to
 a position - and resizes the highlight to match height of clue textfield.
 Just click on the numbers to get it to move.

 It's not pretty and the code is a bit rough (and in AS2) - but it
 demonstrates the principle. You may be well ahead of this by now - but I
 fancied a fiddle!

 You can grab it here. www.flowdigital.co.uk/download/crosswordclues.zip


 Kev.


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul
Steven
 Sent: 21 May 2009 08:44
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Thanks Kerry

 Yes I do have the Advanced Lingo for Games book that has a crossword
 puzzle example which has proven very helpful for the main engine behind
the
 crossword. I also have ActionScript 3.0 Game Programming University but
 that only has a word search.

 My main problem is being able to highlight individual clues and ensure
they
 are visible within the scrollable area. I need to be able to put a
highlight
 over the entire clue (which can be one or more lines long). If I put all
the
 clues in one text field, the scrolling works fine - I am just not sure how
 to determine how high the highlight should be - especially as this will
 change if the text size is toggled. If someone clicks on a word on the
 crossword, if the corresponding clue is not currently visible (due to the
 need to scroll to get to it) I need to adjust the scroll to ensure this
clue
 is visible and then also highlight the clue. So I effectively need to know
 what the scroll position is to display each clue and also how to determine
 the top and bottom of this clue. The highlight will extend the entire
width
 of the clue text field so there is no need to work out widths.

 Any suggestions most welcome.

 Thanks

 Paul





 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
 Thompson
 Sent: 20 May 2009 20:11
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Paul Steven wrote:

   
 I am creating a crossword where the words and clues are read in from an
 
 xml
   
 file. I need to be able to display the clues in a small area hence these
 will need to scroll. I also need to highlight a particular clue if the
 
 word
   
 on the crossword is clicked. Problem is that some clues will be on more
 
 than
   
 one line so I am not sure how best to approach this and would appreciate
 some advice. Also I need to include a function to toggle the text between
 small and large. Btw I am programming this in Flash 8 with AS2.snip
 Any advice on how best to deal with this would be really appreciated.
 

 Gary Rosenzweig has a 

RE: [Flashcoders] Advice on creating dynamic crossword cluesth resize function

2009-05-21 Thread Paul Steven
Hey no apologies requires - I think a big thank you is more appropriate!

Cheers - this is a really nice implementation!



-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin Bath
Sent: 21 May 2009 13:50
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Yay! Will work with FP9 and 8 if you add...

txtClue.embedFonts = true;

(doh - sorry)

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Steven
Sent: 21 May 2009 12:41
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

There are no fonts mentioned in the code. And no fonts appear in font
mapping. I have even tried adding

txtClue.font = Times New Roman;

But the text just doesn't seem to want to display:(

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen Pike
Sent: 21 May 2009 12:38
To: Flash Coders List
Subject: Re: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

You are probly missing a font...

Paul Steven wrote:
 Kev, when I publish this for Flash Player 8 or 9 the text does not appear.
 It is definitely there as the highlights are the correct position and
size.
 Any idea why the text is not actually visible?

 Also out of curiousity what is the XMP metadata?

 Thanks

 Paul

 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin Bath
 Sent: 21 May 2009 11:33
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Paul - I've knocked up a quick example of moving a masked movieclip which
 contains textfields populated by xml data. It should work with any length
 clue and demonstrates how to get a list of clues/textfields to autoscroll
to
 a position - and resizes the highlight to match height of clue textfield.
 Just click on the numbers to get it to move.

 It's not pretty and the code is a bit rough (and in AS2) - but it
 demonstrates the principle. You may be well ahead of this by now - but I
 fancied a fiddle!

 You can grab it here. www.flowdigital.co.uk/download/crosswordclues.zip


 Kev.


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul
Steven
 Sent: 21 May 2009 08:44
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Thanks Kerry

 Yes I do have the Advanced Lingo for Games book that has a crossword
 puzzle example which has proven very helpful for the main engine behind
the
 crossword. I also have ActionScript 3.0 Game Programming University but
 that only has a word search.

 My main problem is being able to highlight individual clues and ensure
they
 are visible within the scrollable area. I need to be able to put a
highlight
 over the entire clue (which can be one or more lines long). If I put all
the
 clues in one text field, the scrolling works fine - I am just not sure how
 to determine how high the highlight should be - especially as this will
 change if the text size is toggled. If someone clicks on a word on the
 crossword, if the corresponding clue is not currently visible (due to the
 need to scroll to get to it) I need to adjust the scroll to ensure this
clue
 is visible and then also highlight the clue. So I effectively need to know
 what the scroll position is to display each clue and also how to determine
 the top and bottom of this clue. The highlight will extend the entire
width
 of the clue text field so there is no need to work out widths.

 Any suggestions most welcome.

 Thanks

 Paul





 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
 Thompson
 Sent: 20 May 2009 20:11
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Paul Steven wrote:

   
 I am creating a crossword where the words and clues are read in from an
 
 xml
   
 file. I need to be able to display the clues in a small area hence these
 will need to scroll. I also need to highlight a particular clue if the
 
 word
   
 on the crossword is clicked. Problem is that some clues will be on more
 
 than
   
 one line so I am not sure how best to approach this and would appreciate
 some advice. Also I need to include a function to toggle the text between
 small and large. Btw I am programming this in Flash 8 with AS2.snip
 Any advice on how best to deal with this would be really appreciated.
 

 Gary Rosenzweig has a really good book, Macromedia 

[Flashcoders] XML Sorting Question

2009-05-21 Thread Dominic Tancredi

Hey All!

I have a weird xml sorting question. I'm retrieving a folder hierarchy  
and displaying it in flex using a tree (yes yes, flex, but it's an  
actionscript question). However, I'm requested to make the results  
alphabetical. So that's either XSL server-side, or sort the results in  
actionscript.


I was able to put together actionscript to sort the top level of XML  
(by creating objects in an array, sorting the array by the attribute,  
then creating a new xml based on the array), but figuring out the  
recursion to sort each of its children is... driving me nuts. Do any  
of you have advice on sorting hierarchical xml data?


XML is like this:

node label=RootDir
node label=firstdir/node
node label=seconddir/node
node label=thirddir
node label=subdir1
node label=subdir2
node label=subdir3
/node
/node

I can show my sortXML code if you have any q's.

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


[Flashcoders] FLV Playback Component

2009-05-21 Thread Boerner, Brian J


I'm having difficulty adding timecode functionality to a playback
component in as3. I have customized the skin and added large play button
as requested but timecode requirement is giving me a major headache. Can
I do it from progressively downloaded FLV?

Is there anyone out there that can point me in the right direction so I
can solve?

thanks





Brian B'
Web Designer

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


RE: [Flashcoders] Parsing HTML tags within flash from an XHTML file?

2009-05-21 Thread Jonathan Wing
Well, I have actually searched over and over and I have read and re-read
Steven's article as well, but I can't seem to get it just right. I think
the problem is, Steven's article is written to an audience of more
experienced AS coders (at least it seems so), and I'm pretty new to AS,
so I don't get the context. The article does not state exactly *where*
to put such code in my files, just that I need to do it. So I took some
guesses and tried multiple ways, yet still to no avail. Yet I didn't
want to bother him, as I've already asked him so many noob questions!

Mostly what I'm concerned about are parsing the h1 and a tags. Do
you have any suggestions as to how and where I can implement Steven's
points in his article?

Thanks,
Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726) 
email: jw...@cramcrew.com
www.cramcrew.com

One Student At A Time

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen
Pike
Sent: Thursday, May 21, 2009 3:21 AM
To: Flash Coders List
Subject: Re: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

Hi,

   This article written by Steven looks just like what you are looking 
for...
 
   http://www.stevensacks.net/2008/07/02/parsing-xhtml-with-e4x-in-as3/
   
To keep your formatting, you can use css - the TextField in Flash 
supports a subset of css that allows you to apply bold, colours and link

formatting...

Not sure if you are searching for EX4 or E4X!

HTH

Glen

Jonathan Wing wrote:
 Hi,

 I'm new to this group, so forgive me if I'm going about asking this
the
 wrong way. Is there a practical way to search old questions?

  

 Anyway, I'm using the Gaia Framework and I'm trying to parse basic
tags
 such as h1 and a in flash via an XHTML file. Steven over at the
Gaia
 forum suggests I make use of EX4, but I've spent two days searching
 google and reading up on it and I'm honestly confused where to start.

  

 To show you what I mean, view the source on this page Steven created:
 http://stevensacks.net/clients/hello/press.html#/agency/press 

  

 Note how those columns are set using HTML tags, and pulled into flash
 from that XHTML file. How do I maintain the formatting such as bold
and
 also the links, just the way he has done (strictly in terms of
 functionality)? Thank you!

  

 Thanks,

 Jonathan Wing
 Graphic Designer
 Cram Crew, Inc.
 mobile: (713) 298-2738
 office: (713) 464-CRAM (2726) 
 email: jw...@cramcrew.com mailto:jw...@cramcrew.com 
 www.cramcrew.com http://www.cramcrew.com/ 


 One Student At A Time

  



 
 The information transmitted is intended only for the person or entity
to which it is addressed and may contain proprietary,
business-confidential and/or privileged material. If you are not the
intended recipient of this message you are hereby notified that any use,
review, retransmission, dissemination, distribution, reproduction or any
action taken in reliance upon this message is prohibited. If you
received this in error, please contact the sender and delete the
material from any computer. Any views expressed in this message are
those of the individual sender and may not necessarily reflect the views
of the company.
 

 ___
 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



The information transmitted is intended only for the person or entity to which 
it is addressed and may contain proprietary, business-confidential and/or 
privileged material. If you are not the intended recipient of this message you 
are hereby notified that any use, review, retransmission, dissemination, 
distribution, reproduction or any action taken in reliance upon this message is 
prohibited. If you received this in error, please contact the sender and delete 
the material from any computer. Any views expressed in this message are those 
of the individual sender and may not necessarily reflect the views of the 
company.




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


RE: [Flashcoders] Advice on creating dynamic crossword cluesth resize function

2009-05-21 Thread Kevin Bath
Now Glen's suggestion will work - just stick a dynamic textfield offscreen,
set font to Times New Roman, and embed fonts in that. That seems to make the
font available to FP8  9.



-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Steven
Sent: 21 May 2009 14:32
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Bah - added the txtClue.embedFonts = true; but still no text. Is there a
particular font I need to have? I can't see any reference to any particular
font

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin Bath
Sent: 21 May 2009 13:50
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Yay! Will work with FP9 and 8 if you add...

txtClue.embedFonts = true;

(doh - sorry)

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Steven
Sent: 21 May 2009 12:41
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

There are no fonts mentioned in the code. And no fonts appear in font
mapping. I have even tried adding

txtClue.font = Times New Roman;

But the text just doesn't seem to want to display:(

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen Pike
Sent: 21 May 2009 12:38
To: Flash Coders List
Subject: Re: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

You are probly missing a font...

Paul Steven wrote:
 Kev, when I publish this for Flash Player 8 or 9 the text does not appear.
 It is definitely there as the highlights are the correct position and
size.
 Any idea why the text is not actually visible?

 Also out of curiousity what is the XMP metadata?

 Thanks

 Paul

 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin Bath
 Sent: 21 May 2009 11:33
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Paul - I've knocked up a quick example of moving a masked movieclip which
 contains textfields populated by xml data. It should work with any length
 clue and demonstrates how to get a list of clues/textfields to autoscroll
to
 a position - and resizes the highlight to match height of clue textfield.
 Just click on the numbers to get it to move.

 It's not pretty and the code is a bit rough (and in AS2) - but it
 demonstrates the principle. You may be well ahead of this by now - but I
 fancied a fiddle!

 You can grab it here. www.flowdigital.co.uk/download/crosswordclues.zip


 Kev.


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul
Steven
 Sent: 21 May 2009 08:44
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Thanks Kerry

 Yes I do have the Advanced Lingo for Games book that has a crossword
 puzzle example which has proven very helpful for the main engine behind
the
 crossword. I also have ActionScript 3.0 Game Programming University but
 that only has a word search.

 My main problem is being able to highlight individual clues and ensure
they
 are visible within the scrollable area. I need to be able to put a
highlight
 over the entire clue (which can be one or more lines long). If I put all
the
 clues in one text field, the scrolling works fine - I am just not sure how
 to determine how high the highlight should be - especially as this will
 change if the text size is toggled. If someone clicks on a word on the
 crossword, if the corresponding clue is not currently visible (due to the
 need to scroll to get to it) I need to adjust the scroll to ensure this
clue
 is visible and then also highlight the clue. So I effectively need to know
 what the scroll position is to display each clue and also how to determine
 the top and bottom of this clue. The highlight will extend the entire
width
 of the clue text field so there is no need to work out widths.

 Any suggestions most welcome.

 Thanks

 Paul





 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
 Thompson
 Sent: 20 May 2009 20:11
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Paul Steven wrote:

   
 I am creating a crossword where the words and clues are read in from an
 
 xml
   
 file. I need to be able to display the clues in a small area hence these
 will need to scroll. I 

RE: [Flashcoders] Parsing HTML tags within flash from an XHTML file?

2009-05-21 Thread Merrill, Jason
If it's truly XHTML, you can in theory parse it as XML - but if it's
not, meaning they mixed case and didn't close tags, then you're out of
luck.

First things first, do you know how to load in XML?


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Jonathan
Wing
Sent: Thursday, May 21, 2009 11:08 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

Well, I have actually searched over and over and I have read and re-read
Steven's article as well, but I can't seem to get it just right. I think
the problem is, Steven's article is written to an audience of more
experienced AS coders (at least it seems so), and I'm pretty new to AS,
so I don't get the context. The article does not state exactly *where*
to put such code in my files, just that I need to do it. So I took some
guesses and tried multiple ways, yet still to no avail. Yet I didn't
want to bother him, as I've already asked him so many noob questions!

Mostly what I'm concerned about are parsing the h1 and a tags. Do
you have any suggestions as to how and where I can implement Steven's
points in his article?

Thanks,
Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726) 
email: jw...@cramcrew.com
www.cramcrew.com

One Student At A Time

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen
Pike
Sent: Thursday, May 21, 2009 3:21 AM
To: Flash Coders List
Subject: Re: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

Hi,

   This article written by Steven looks just like what you are looking 
for...
 
   http://www.stevensacks.net/2008/07/02/parsing-xhtml-with-e4x-in-as3/
   
To keep your formatting, you can use css - the TextField in Flash 
supports a subset of css that allows you to apply bold, colours and link

formatting...

Not sure if you are searching for EX4 or E4X!

HTH

Glen

Jonathan Wing wrote:
 Hi,

 I'm new to this group, so forgive me if I'm going about asking this
the
 wrong way. Is there a practical way to search old questions?

  

 Anyway, I'm using the Gaia Framework and I'm trying to parse basic
tags
 such as h1 and a in flash via an XHTML file. Steven over at the
Gaia
 forum suggests I make use of EX4, but I've spent two days searching
 google and reading up on it and I'm honestly confused where to start.

  

 To show you what I mean, view the source on this page Steven created:
 http://stevensacks.net/clients/hello/press.html#/agency/press 

  

 Note how those columns are set using HTML tags, and pulled into flash
 from that XHTML file. How do I maintain the formatting such as bold
and
 also the links, just the way he has done (strictly in terms of
 functionality)? Thank you!

  

 Thanks,

 Jonathan Wing
 Graphic Designer
 Cram Crew, Inc.
 mobile: (713) 298-2738
 office: (713) 464-CRAM (2726) 
 email: jw...@cramcrew.com mailto:jw...@cramcrew.com 
 www.cramcrew.com http://www.cramcrew.com/ 


 One Student At A Time

  



 
 The information transmitted is intended only for the person or entity
to which it is addressed and may contain proprietary,
business-confidential and/or privileged material. If you are not the
intended recipient of this message you are hereby notified that any use,
review, retransmission, dissemination, distribution, reproduction or any
action taken in reliance upon this message is prohibited. If you
received this in error, please contact the sender and delete the
material from any computer. Any views expressed in this message are
those of the individual sender and may not necessarily reflect the views
of the company.
 

 ___
 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



The information transmitted is intended only for the person or entity to
which it is addressed and may contain proprietary, business-confidential
and/or privileged material. If you are not the intended recipient of
this message you are hereby notified that any use, review,
retransmission, dissemination, distribution, reproduction or any action
taken in reliance upon this message is prohibited. If you received this
in error, please contact the sender and 

Re: [Flashcoders] XML Sorting Question

2009-05-21 Thread Steven Sacks
My advice is to use the wonderful encyclopedia available to you called  
The Internet.


I went to Google and typed in:  sort xml AS3

The first 4 results have the exact code you need to do this.

The Internet: Helping people find answers, one search at a time.



On May 21, 2009, at 7:25 AM, Dominic Tancredi wrote:


Hey All!

I have a weird xml sorting question. I'm retrieving a folder  
hierarchy and displaying it in flex using a tree (yes yes, flex, but  
it's an actionscript question). However, I'm requested to make the  
results alphabetical. So that's either XSL server-side, or sort the  
results in actionscript.


I was able to put together actionscript to sort the top level of XML  
(by creating objects in an array, sorting the array by the  
attribute, then creating a new xml based on the array), but figuring  
out the recursion to sort each of its children is... driving me  
nuts. Do any of you have advice on sorting hierarchical xml data?


XML is like this:

node label=RootDir
node label=firstdir/node
node label=seconddir/node
node label=thirddir
node label=subdir1
node label=subdir2
node label=subdir3
/node
/node

I can show my sortXML code if you have any q's.

Dom
___
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] Advice on creating dynamic crossword cluesth resize function

2009-05-21 Thread Paul Steven
Thanks Glen

Unfortunately that didn't work. Perhaps my PC is just playing up?! 

Cheers

Paul

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen Pike
Sent: 21 May 2009 12:55
To: Flash Coders List
Subject: Re: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

I am guessing you might want to publish for older players to see it 
working - can't open the file as I only have CS3 here, sorry.

Try chucking a text field with the Times font embedded off the stage 
somewhere - not sure if that helps, but it might...

XMP metadata is Adobe's proprietry XML structure for adding info to 
files - I guess this helps exchanging data between Adobe products...

http://en.wikipedia.org/wiki/Extensible_Metadata_Platform

HTH

Glen


Paul Steven wrote:
 There are no fonts mentioned in the code. And no fonts appear in font
 mapping. I have even tried adding

 txtClue.font = Times New Roman;

 But the text just doesn't seem to want to display:(

 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen Pike
 Sent: 21 May 2009 12:38
 To: Flash Coders List
 Subject: Re: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 You are probly missing a font...

 Paul Steven wrote:
   
 Kev, when I publish this for Flash Player 8 or 9 the text does not
appear.
 It is definitely there as the highlights are the correct position and
 
 size.
   
 Any idea why the text is not actually visible?

 Also out of curiousity what is the XMP metadata?

 Thanks

 Paul

 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin
Bath
 Sent: 21 May 2009 11:33
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Paul - I've knocked up a quick example of moving a masked movieclip which
 contains textfields populated by xml data. It should work with any length
 clue and demonstrates how to get a list of clues/textfields to autoscroll
 
 to
   
 a position - and resizes the highlight to match height of clue textfield.
 Just click on the numbers to get it to move.

 It's not pretty and the code is a bit rough (and in AS2) - but it
 demonstrates the principle. You may be well ahead of this by now - but I
 fancied a fiddle!

 You can grab it here. www.flowdigital.co.uk/download/crosswordclues.zip


 Kev.


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul
 
 Steven
   
 Sent: 21 May 2009 08:44
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Thanks Kerry

 Yes I do have the Advanced Lingo for Games book that has a crossword
 puzzle example which has proven very helpful for the main engine behind
 
 the
   
 crossword. I also have ActionScript 3.0 Game Programming University but
 that only has a word search.

 My main problem is being able to highlight individual clues and ensure
 
 they
   
 are visible within the scrollable area. I need to be able to put a
 
 highlight
   
 over the entire clue (which can be one or more lines long). If I put all
 
 the
   
 clues in one text field, the scrolling works fine - I am just not sure
how
 to determine how high the highlight should be - especially as this will
 change if the text size is toggled. If someone clicks on a word on the
 crossword, if the corresponding clue is not currently visible (due to the
 need to scroll to get to it) I need to adjust the scroll to ensure this
 
 clue
   
 is visible and then also highlight the clue. So I effectively need to
know
 what the scroll position is to display each clue and also how to
determine
 the top and bottom of this clue. The highlight will extend the entire
 
 width
   
 of the clue text field so there is no need to work out widths.

 Any suggestions most welcome.

 Thanks

 Paul





 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
 Thompson
 Sent: 20 May 2009 20:11
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
 resize function

 Paul Steven wrote:

   
 
 I am creating a crossword where the words and clues are read in from an
 
   
 xml
   
 
 file. I need to be able to display the clues in a small area hence these
 will need to scroll. I also need to highlight a particular clue if the
 
   
 word
   
 
 on the crossword is clicked. Problem is that some clues will be on more
 
   
 than
   
 
 one line so I am not sure how best to approach this and would appreciate
 some advice. Also I need to 

RE: [Flashcoders] Parsing HTML tags within flash from an XHTML file?

2009-05-21 Thread Jonathan Wing
Well, I think I know how to import XML.

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, getXML);
loader.load(new URLRequest(http://xmlfeedURL;));

function getXML(event:Event):void {
var xmlData:XML = new XML(event.target.data);
trace(xmlData);
}

At least, that is the code I picked up while doing research, though I'm
not entirely sure how to use any of that to apply to what I'm doing in
the Gaia Framework. This is what I have now, minus the irrelevant code:

package pages
{
import flash.xml.*;
import flash.text.TextField;

XML.ignoreWhitespace = false;
XML.prettyPrinting = false;

public class HomePage extends AbstractPage
{   
public var dynamic_text:TextField;  

override public function transitionIn():void 
{
super.transitionIn();
TweenLite.to(this, 0.3, {alpha:1,
onComplete:transitionInComplete});
 
dynamic_text.text = this.copy.intro;
}

[there's a lot more code, but I'm only focusing on the relevant
parts from the XHTML page]

}
}

So what it does is pull info from this content in my XHTML page:

div id=copy
p id=introLorem ipsum/p
/div

And places that Lorem ipsum in my corresponding MC with an instance
name of dynamic_text. But then, if I want to do something like:

div id=copy
p id=introh1Lorem ipsum/h1
a href=page.swfClick here/a to learn more.
/p/div

It will not parse the HTML tags; it will treat them like a regular
string of text, even though my text box has render text as HTML
selected.

Now, Steven's suggestions in his article seem helpful, but since I am
pretty new to this sort of code, I am still unsure as to where things
should go, and how to make it work for h1 and a tags. I'm not
planning to use many other tags, as I am trying to keep things simple.

Thanks,
Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726) 
email: jw...@cramcrew.com
www.cramcrew.com

One Student At A Time


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill,
Jason
Sent: Thursday, May 21, 2009 10:13 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

If it's truly XHTML, you can in theory parse it as XML - but if it's
not, meaning they mixed case and didn't close tags, then you're out of
luck.

First things first, do you know how to load in XML?


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Jonathan
Wing
Sent: Thursday, May 21, 2009 11:08 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

Well, I have actually searched over and over and I have read and re-read
Steven's article as well, but I can't seem to get it just right. I think
the problem is, Steven's article is written to an audience of more
experienced AS coders (at least it seems so), and I'm pretty new to AS,
so I don't get the context. The article does not state exactly *where*
to put such code in my files, just that I need to do it. So I took some
guesses and tried multiple ways, yet still to no avail. Yet I didn't
want to bother him, as I've already asked him so many noob questions!

Mostly what I'm concerned about are parsing the h1 and a tags. Do
you have any suggestions as to how and where I can implement Steven's
points in his article?

Thanks,
Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726) 
email: jw...@cramcrew.com
www.cramcrew.com

One Student At A Time

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen
Pike
Sent: Thursday, May 21, 2009 3:21 AM
To: Flash Coders List
Subject: Re: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

Hi,

   This article written by Steven looks just like what you are looking 
for...
 
   http://www.stevensacks.net/2008/07/02/parsing-xhtml-with-e4x-in-as3/
   
To keep your formatting, you can use css - the TextField in Flash 
supports a subset of css that allows you to apply bold, colours and link

formatting...

Not sure if you are searching for EX4 or E4X!

HTH

Glen

Jonathan Wing wrote:
 Hi,

 I'm new to this group, so forgive me if I'm going about asking this
the
 wrong way. Is there a practical way to search old questions?

  

 Anyway, I'm using the Gaia 

RE: [Flashcoders] Parsing HTML tags within flash from an XHTML file?

2009-05-21 Thread Merrill, Jason
Well, part of your question is a Gaia framework question which is
off-topic for this forum.  I don't know much about that framework other
than it's purpose and creator.  

As for your question about the tags parsing:

 It will not parse the HTML tags; it will treat them like a regular
string of text, even though my text box has render text as HTML
selected.

Two issues:  1) Flash only has a limited set of tags it supports in HTML
for text.  Tags like div and h1 I don't believe are one of them.
You could read the XHTML in as a string (not XML right away) and use a
Regular Expression to remove those tags from the text and insert
something else if you like, however: 2) The entire  XHTML should be
treated as XML, so that means tags like p will be treated as an XML
node, not a new HTML text paragraph.  So you may have to use some
Regular Expressions to at least add a ![CDATA[ before and ]] to wrap
around the text you want to read in the HTML so it escapes the
characters.  THEN convert the string to XML once it's clean.

In short, what you're asking to do is pretty challenging.  Flash isn't
really set up to read and render HTML pages.  It's mean to take the
place of them. :) 


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 




-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Jonathan
Wing
Sent: Thursday, May 21, 2009 1:14 PM
To: Flash Coders List
Subject: RE: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

Well, I think I know how to import XML.

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, getXML);
loader.load(new URLRequest(http://xmlfeedURL;));

function getXML(event:Event):void {
var xmlData:XML = new XML(event.target.data);
trace(xmlData);
}

At least, that is the code I picked up while doing research, though I'm
not entirely sure how to use any of that to apply to what I'm doing in
the Gaia Framework. This is what I have now, minus the irrelevant code:

package pages
{
import flash.xml.*;
import flash.text.TextField;

XML.ignoreWhitespace = false;
XML.prettyPrinting = false;

public class HomePage extends AbstractPage
{   
public var dynamic_text:TextField;  

override public function transitionIn():void 
{
super.transitionIn();
TweenLite.to(this, 0.3, {alpha:1,
onComplete:transitionInComplete});
 
dynamic_text.text = this.copy.intro;
}

[there's a lot more code, but I'm only focusing on the relevant
parts from the XHTML page]

}
}

So what it does is pull info from this content in my XHTML page:

div id=copy
p id=introLorem ipsum/p
/div

And places that Lorem ipsum in my corresponding MC with an instance
name of dynamic_text. But then, if I want to do something like:

div id=copy
p id=introh1Lorem ipsum/h1
a href=page.swfClick here/a to learn more.
/p/div

It will not parse the HTML tags; it will treat them like a regular
string of text, even though my text box has render text as HTML
selected.

Now, Steven's suggestions in his article seem helpful, but since I am
pretty new to this sort of code, I am still unsure as to where things
should go, and how to make it work for h1 and a tags. I'm not
planning to use many other tags, as I am trying to keep things simple.

Thanks,
Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726) 
email: jw...@cramcrew.com
www.cramcrew.com

One Student At A Time


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill,
Jason
Sent: Thursday, May 21, 2009 10:13 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

If it's truly XHTML, you can in theory parse it as XML - but if it's
not, meaning they mixed case and didn't close tags, then you're out of
luck.

First things first, do you know how to load in XML?


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Jonathan
Wing
Sent: Thursday, May 21, 2009 11:08 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

Well, I have actually searched over and over and I have read and re-read
Steven's 

Re: [Flashcoders] Parsing HTML tags within flash from an XHTML file?

2009-05-21 Thread Glen Pike

Hi,

   Once you have loaded your XML and put it into your dynamic text 
field, you can set the styleSheet property to that of a loaded a valid 
css file...


   http://snipplr.com/view/4452/as3-load-external-txt-and-css/

   Load your style sheet first, then apply it to your text field after 
you set the content with your XML...


   Hope this helps a bit.

   Glen

  


Jonathan Wing wrote:

Well, I think I know how to import XML.

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, getXML);
loader.load(new URLRequest(http://xmlfeedURL;));

function getXML(event:Event):void {
var xmlData:XML = new XML(event.target.data);
trace(xmlData);
}

At least, that is the code I picked up while doing research, though I'm
not entirely sure how to use any of that to apply to what I'm doing in
the Gaia Framework. This is what I have now, minus the irrelevant code:

package pages
{
import flash.xml.*;
import flash.text.TextField;

XML.ignoreWhitespace = false;
XML.prettyPrinting = false;

public class HomePage extends AbstractPage
{   
public var dynamic_text:TextField;  

		override public function transitionIn():void 
		{

super.transitionIn();
TweenLite.to(this, 0.3, {alpha:1,
onComplete:transitionInComplete});
			 
			dynamic_text.text = this.copy.intro;

}

[there's a lot more code, but I'm only focusing on the relevant
parts from the XHTML page]

}
}

So what it does is pull info from this content in my XHTML page:

div id=copy
p id=introLorem ipsum/p
/div

And places that Lorem ipsum in my corresponding MC with an instance
name of dynamic_text. But then, if I want to do something like:

div id=copy
p id=introh1Lorem ipsum/h1
a href=page.swfClick here/a to learn more.
/p/div

It will not parse the HTML tags; it will treat them like a regular
string of text, even though my text box has render text as HTML
selected.

Now, Steven's suggestions in his article seem helpful, but since I am
pretty new to this sort of code, I am still unsure as to where things
should go, and how to make it work for h1 and a tags. I'm not
planning to use many other tags, as I am trying to keep things simple.

Thanks,
Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726) 
email: jw...@cramcrew.com

www.cramcrew.com

One Student At A Time


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill,
Jason
Sent: Thursday, May 21, 2009 10:13 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

If it's truly XHTML, you can in theory parse it as XML - but if it's
not, meaning they mixed case and didn't close tags, then you're out of
luck.

First things first, do you know how to load in XML?


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 


Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 






-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Jonathan
Wing
Sent: Thursday, May 21, 2009 11:08 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

Well, I have actually searched over and over and I have read and re-read
Steven's article as well, but I can't seem to get it just right. I think
the problem is, Steven's article is written to an audience of more
experienced AS coders (at least it seems so), and I'm pretty new to AS,
so I don't get the context. The article does not state exactly *where*
to put such code in my files, just that I need to do it. So I took some
guesses and tried multiple ways, yet still to no avail. Yet I didn't
want to bother him, as I've already asked him so many noob questions!

Mostly what I'm concerned about are parsing the h1 and a tags. Do
you have any suggestions as to how and where I can implement Steven's
points in his article?

Thanks,
Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726) 
email: jw...@cramcrew.com

www.cramcrew.com

One Student At A Time

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen
Pike
Sent: Thursday, May 21, 2009 3:21 AM
To: Flash Coders List
Subject: Re: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

Hi,

   This article written by Steven looks just like what you are looking 
for...
 
   http://www.stevensacks.net/2008/07/02/parsing-xhtml-with-e4x-in-as3/
   
To keep your formatting, you can use css - the TextField in Flash 
supports a subset of css 

RE: [Flashcoders] Parsing HTML tags within flash from an XHTML file?

2009-05-21 Thread Jonathan Wing
Jason,
The funny thing is, Steven said that my question was a bit off-topic for
the Gaia forum, and recommended I try this place. ;)

I know it's possible as I've seen it done, for example, on Steven's page
here:

http://stevensacks.net/clients/hello/press.html#/agency/press (if you
look at the code, it's pretty straightforward HTML tags, without CDATA
around them)

And also:
http://flashden.net/item/elite-html-content-page-with-scroller/full_scre
en_preview/27908 (but that is using AS2, and I'm coding the site in
AS3).

If I may explain, basically all I'm trying to do is create SEO-friendly
XHTML pages on which the written content for each page is stored and
that is where I will pull the content from. On occasion, I will need to
provide links to other pages. If anyone knows of a better way of doing
this, I'm all ears!

Thanks,
Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726) 
email: jw...@cramcrew.com
www.cramcrew.com

One Student At A Time


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill,
Jason
Sent: Thursday, May 21, 2009 12:29 PM
To: Flash Coders List
Subject: RE: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

Well, part of your question is a Gaia framework question which is
off-topic for this forum.  I don't know much about that framework other
than it's purpose and creator.  

As for your question about the tags parsing:

 It will not parse the HTML tags; it will treat them like a regular
string of text, even though my text box has render text as HTML
selected.

Two issues:  1) Flash only has a limited set of tags it supports in HTML
for text.  Tags like div and h1 I don't believe are one of them.
You could read the XHTML in as a string (not XML right away) and use a
Regular Expression to remove those tags from the text and insert
something else if you like, however: 2) The entire  XHTML should be
treated as XML, so that means tags like p will be treated as an XML
node, not a new HTML text paragraph.  So you may have to use some
Regular Expressions to at least add a ![CDATA[ before and ]] to wrap
around the text you want to read in the HTML so it escapes the
characters.  THEN convert the string to XML once it's clean.

In short, what you're asking to do is pretty challenging.  Flash isn't
really set up to read and render HTML pages.  It's mean to take the
place of them. :) 


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 




-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Jonathan
Wing
Sent: Thursday, May 21, 2009 1:14 PM
To: Flash Coders List
Subject: RE: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

Well, I think I know how to import XML.

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, getXML);
loader.load(new URLRequest(http://xmlfeedURL;));

function getXML(event:Event):void {
var xmlData:XML = new XML(event.target.data);
trace(xmlData);
}

At least, that is the code I picked up while doing research, though I'm
not entirely sure how to use any of that to apply to what I'm doing in
the Gaia Framework. This is what I have now, minus the irrelevant code:

package pages
{
import flash.xml.*;
import flash.text.TextField;

XML.ignoreWhitespace = false;
XML.prettyPrinting = false;

public class HomePage extends AbstractPage
{   
public var dynamic_text:TextField;  

override public function transitionIn():void 
{
super.transitionIn();
TweenLite.to(this, 0.3, {alpha:1,
onComplete:transitionInComplete});
 
dynamic_text.text = this.copy.intro;
}

[there's a lot more code, but I'm only focusing on the relevant
parts from the XHTML page]

}
}

So what it does is pull info from this content in my XHTML page:

div id=copy
p id=introLorem ipsum/p
/div

And places that Lorem ipsum in my corresponding MC with an instance
name of dynamic_text. But then, if I want to do something like:

div id=copy
p id=introh1Lorem ipsum/h1
a href=page.swfClick here/a to learn more.
/p/div

It will not parse the HTML tags; it will treat them like a regular
string of text, even though my text box has render text as HTML
selected.

Now, Steven's suggestions in his article seem helpful, but since I am
pretty new to this sort of code, I am still unsure as to where things
should go, and how to make it work for h1 and a tags. I'm not
planning to use many other tags, as 

Re: [Flashcoders] Advice on creating dynamic crossword cluesth resize function

2009-05-21 Thread Charles Parcell
But will Kevin make an honest file? :) Couldn't resist.

Charles P.


On Thu, May 21, 2009 at 7:19 AM, Paul Steven paul_ste...@btinternet.comwrote:

 snip I really appreciate your time knocking up this file.

 Cheers

 Paul

 -Original Message-

 I've knocked up a quick example of moving a masked movieclip which
 contains textfields populated by xml data.snip

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


RE: [Flashcoders] Parsing HTML tags within flash from an XHTML file?

2009-05-21 Thread Merrill, Jason
 The funny thing is, Steven said that my question was a bit off-topic
for
the Gaia forum, and recommended I try this place. ;)

I was talking about your doing this in Gaia part and I'm sure Steven
was talking about the parsing XHTML part.  This is what promoted me:

I'm not entirely sure how to use any of that to apply to what I'm
doing in the Gaia Framework. This is what I have now

For that, the Gaia forum is more approprite. You're talking about two
problems - 1) How to load and parse XHTML amd 2) how to use that data,
once loaded as XML, into Gaia.  

#1 is for here.  #2 is for the Gaia forum.

Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Jonathan
Wing
Sent: Thursday, May 21, 2009 1:49 PM
To: Flash Coders List
Subject: RE: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

Jason,
The funny thing is, Steven said that my question was a bit off-topic for
the Gaia forum, and recommended I try this place. ;)

I know it's possible as I've seen it done, for example, on Steven's page
here:

http://stevensacks.net/clients/hello/press.html#/agency/press (if you
look at the code, it's pretty straightforward HTML tags, without CDATA
around them)

And also:
http://flashden.net/item/elite-html-content-page-with-scroller/full_scre
en_preview/27908 (but that is using AS2, and I'm coding the site in
AS3).

If I may explain, basically all I'm trying to do is create SEO-friendly
XHTML pages on which the written content for each page is stored and
that is where I will pull the content from. On occasion, I will need to
provide links to other pages. If anyone knows of a better way of doing
this, I'm all ears!

Thanks,
Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726) 
email: jw...@cramcrew.com
www.cramcrew.com

One Student At A Time


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill,
Jason
Sent: Thursday, May 21, 2009 12:29 PM
To: Flash Coders List
Subject: RE: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

Well, part of your question is a Gaia framework question which is
off-topic for this forum.  I don't know much about that framework other
than it's purpose and creator.  

As for your question about the tags parsing:

 It will not parse the HTML tags; it will treat them like a regular
string of text, even though my text box has render text as HTML
selected.

Two issues:  1) Flash only has a limited set of tags it supports in HTML
for text.  Tags like div and h1 I don't believe are one of them.
You could read the XHTML in as a string (not XML right away) and use a
Regular Expression to remove those tags from the text and insert
something else if you like, however: 2) The entire  XHTML should be
treated as XML, so that means tags like p will be treated as an XML
node, not a new HTML text paragraph.  So you may have to use some
Regular Expressions to at least add a ![CDATA[ before and ]] to wrap
around the text you want to read in the HTML so it escapes the
characters.  THEN convert the string to XML once it's clean.

In short, what you're asking to do is pretty challenging.  Flash isn't
really set up to read and render HTML pages.  It's mean to take the
place of them. :) 


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 




-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Jonathan
Wing
Sent: Thursday, May 21, 2009 1:14 PM
To: Flash Coders List
Subject: RE: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

Well, I think I know how to import XML.

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, getXML);
loader.load(new URLRequest(http://xmlfeedURL;));

function getXML(event:Event):void {
var xmlData:XML = new XML(event.target.data);
trace(xmlData);
}

At least, that is the code I picked up while doing research, though I'm
not entirely sure how to use any of that to apply to what I'm doing in
the Gaia Framework. This is what I have now, minus the irrelevant code:

package pages
{
import flash.xml.*;
import flash.text.TextField;

XML.ignoreWhitespace = false;
XML.prettyPrinting = false;

public class HomePage extends AbstractPage
{   
public var dynamic_text:TextField;  

override 

Re: [Flashcoders] Parsing HTML tags within flash from an XHTML file?

2009-05-21 Thread Steven Sacks

http://www.gaiaflashframework.com/index.php/topic,1847.msg7817.html#msg7817

Just so everyone is familiar with the context here, the above is the  
thread on the forum about this.


The question is about how to use E4X to parse XHTML.  I provide a code  
example of how easy it is to do this, but Jonathan's question is more  
of a general one about how to use E4X to parse nodes.


Flash doesn't support div in its htmlText, so that's why you use E4X  
to grab the node content like


var value:XML = XMLList(copy.innerHTML)[0];
var body:XML = value.div.(@id == body)[0];

I believe the challenge for Jonathan is what the above lines of code  
mean and how they work.


value is the XHTML.

value.div returns an XMLList of all div nodes on the first level  
within the XHTML.


value.div.(@id == body) means give me an XMLList of the div nodes  
that have an attribute id=body.


valid.div.(@id == body)[0] means give me the first XML node in that  
XMLList.


This is how E4X works.  A lesson on E4X is out of scope of my forum.   
However, there are lots of resources out there for E4X in AS3.  I  
highly recommend Colin Moock's Essential Actionscript 3.0 book, which  
is how I learned it.  That and the internet.


And Jason, you do not need to complicate things with RegEx.  E4X does  
enough.  XHTML is technically XML and can be parsed the same using E4X.


Also, while Flash doesn't SEEM to support newer HTML tags like  
strong and em for b and i, it actually DOES if you write css  
to do it.


strong {
font-family: FFScala-Bold;
display: inline;
}
em {
font-family: FFScala-Italic;
display: inline;
}

In this case, I am using a bold and italic font to show them, and by  
defining the node types in css (and setting them to display: inline),  
it works like a champ!


Here's a detailed code sample:
http://www.gaiaflashframework.com/wiki/index.php?title=Runtime_Font_Loading#StyleSheet_Example

Now, I can keep my valid XHTML and use it directly in Flash.  It's  
really straightforward.  The challenge is learning how to parse the  
nodes using E4X, which, once you get your head around it (and it took  
me a lot of experimenting to learn how awesome and powerful E4X is and  
how to leverage it), you can do stuff like this easily.

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


RE: [Flashcoders] Parsing HTML tags within flash from an XHTML file?

2009-05-21 Thread Jonathan Wing
Thanks Steven! That clears a few things up, and like you suggest, I will
experiment with it until I get it just right. The only reason I've been
so anxious is that I'm working on a deadline; so, for the time being,
may I simply ask you this? What is the best (and most SEO-friendly) way
of presenting links within the copy content? Should I be doing this
within the XHTML using a tags to other swf files, or is there a better
method? I guess that is the only thing I'm getting hung up on, as my
pages will occasionally have links within the body paragraphs.

Okay, so I figured out one thing that helps, which is to set my text
fields to htmlText (it was only text before). That helps a lot, and
it appears that the links are showing up and they function--sorta. They
actually want to open a new page, even if a swf, and even if the target
is set to _self.

Really, all I want to do (on my deadline) is have links from one swf to
another in the website, but have it all be SEO-friendly. Should be
pretty simple, right? I bet I'm making it more complicated for myself
than it probably needs to be. ;)

My I present my own guess, and you could tell me if I'm wrong? I'm
guessing it has something to do with the following, which I found in the
Gaia demo site (I'm pasting only what I assume is the relevant code):

public var textContent:TextField;

var myStyleSheet = new StyleSheet as StyleSheet;
var myURL:String;
var mySection:XMLList;

myURL = Gaia.api.getCurrentBranch();
myStyleSheet =
IStyleSheet(Gaia.api.getPage(index).assets.xmlCss).style;
textContent.styleSheet = myStyleSheet

for each ( var u:XML in mySection) {
if (myURL == u...@url) {
textContent.htmlText = u.copy;
}

Could I use this in tandem with my Gaia-produced XHTML pages? I do not
see where the actual copy node is included in the instance from the
demo site's XML, but only the url part. How is the rest of the text
being included?

Sorry to be impatient! I just did not expect this specific aspect of
development to feel like starting from scratch!


Thanks,
Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726) 
email: jw...@cramcrew.com
www.cramcrew.com

One Student At A Time


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Steven
Sacks
Sent: Thursday, May 21, 2009 1:43 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

http://www.gaiaflashframework.com/index.php/topic,1847.msg7817.html#msg7
817

Just so everyone is familiar with the context here, the above is the  
thread on the forum about this.

The question is about how to use E4X to parse XHTML.  I provide a code  
example of how easy it is to do this, but Jonathan's question is more  
of a general one about how to use E4X to parse nodes.

Flash doesn't support div in its htmlText, so that's why you use E4X  
to grab the node content like

var value:XML = XMLList(copy.innerHTML)[0];
var body:XML = value.div.(@id == body)[0];

I believe the challenge for Jonathan is what the above lines of code  
mean and how they work.

value is the XHTML.

value.div returns an XMLList of all div nodes on the first level  
within the XHTML.

value.div.(@id == body) means give me an XMLList of the div nodes  
that have an attribute id=body.

valid.div.(@id == body)[0] means give me the first XML node in that  
XMLList.

This is how E4X works.  A lesson on E4X is out of scope of my forum.   
However, there are lots of resources out there for E4X in AS3.  I  
highly recommend Colin Moock's Essential Actionscript 3.0 book, which  
is how I learned it.  That and the internet.

And Jason, you do not need to complicate things with RegEx.  E4X does  
enough.  XHTML is technically XML and can be parsed the same using E4X.

Also, while Flash doesn't SEEM to support newer HTML tags like  
strong and em for b and i, it actually DOES if you write css  
to do it.

strong {
font-family: FFScala-Bold;
display: inline;
}
em {
font-family: FFScala-Italic;
display: inline;
}

In this case, I am using a bold and italic font to show them, and by  
defining the node types in css (and setting them to display: inline),  
it works like a champ!

Here's a detailed code sample:
http://www.gaiaflashframework.com/wiki/index.php?title=Runtime_Font_Load
ing#StyleSheet_Example

Now, I can keep my valid XHTML and use it directly in Flash.  It's  
really straightforward.  The challenge is learning how to parse the  
nodes using E4X, which, once you get your head around it (and it took  
me a lot of experimenting to learn how awesome and powerful E4X is and  
how to leverage it), you can do stuff like this easily.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com

[Flashcoders] Problem with footer fixed to bottom of page

2009-05-21 Thread Jonathan Wing
This is probably a silly question, but I've searched google and can't
seem to find the right answer, which is strange as this is seems to be a
common thing on pages.

 

Basically, I have a footer that is fixed to the bottom of a page and for
the width of a page, so that no matter what size a user sets a window
for, it will always fix to the bottom. This is what I have so far (using
AS3):

 

In my .fla, I have a long gray bar with the instance name footer.

Then, over in my .as file, I have the following:

 

import flash.display.*;

 

footer.y = stage.stageHeight - footer.height;

stage.addEventListener(Event.RESIZE, resizeHandler);

 

public function resizeHandler(e:Event):void {   

footer.y = stage.stageHeight - footer.height;

footer.width = stage.stageWidth;

 }

 

All of this works without a hitch. However, my problem arises when I
want to add text. If I add text in its own mc, then it won't adjust with
the page. If I add text inside the footer mc, it will stretch with the
width of the page when I resize. So then I thought maybe I could make
them two mc's embedded in one main mc, and only define the width for the
bar. That is, something like:

 

footer.y = stage.stageHeight - footer.height;

footer_bar.width = stage.stageWidth;

 

With footer as the main mc, and footer_bar as the long gray bar
embedded inside.

 

However, this results in a mess of errors.

 

Any ideas? This seems so common, I'm surprised I can't find anything via
Google.

 

Thanks,

Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726) 
email: jw...@cramcrew.com mailto:jw...@cramcrew.com 
www.cramcrew.com http://www.cramcrew.com/ 


One Student At A Time

 




The information transmitted is intended only for the person or entity to which 
it is addressed and may contain proprietary, business-confidential and/or 
privileged material. If you are not the intended recipient of this message you 
are hereby notified that any use, review, retransmission, dissemination, 
distribution, reproduction or any action taken in reliance upon this message is 
prohibited. If you received this in error, please contact the sender and delete 
the material from any computer. Any views expressed in this message are those 
of the individual sender and may not necessarily reflect the views of the 
company.


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


Re: [Flashcoders] Parsing HTML tags within flash from an XHTML file?

2009-05-21 Thread Steven Sacks
Do you mean you want to have links in your a tags that call  
Gaia.api.goto()?


You can do that, but obviously, those links wouldn't work in the XHTML.

After thinking about it a bit, I think what might work is this

a href=contact.htmlGo to contact page/a

With that being the link to the SEO XHTML page that is generated for  
that page.


In your parsing code, you would change the href to call an  
actionscript method that would take page.html and convert it to


var href:String = a...@href;
href = href.substr(0, href.length - 4);
var internalTitle:String = href.toUpperCase();
Gaia.api.goto(Pages[internalTitle]);

That is just an example, but basically you're converting  
contact.html to CONTACT and, there should be a public static const  
in Pages called CONTACT which has the branch for that title.


Does this make sense? (this part of the question is definitely  
appropriate for the Gaia forum, too)




On May 21, 2009, at 12:29 PM, Jonathan Wing wrote:

Thanks Steven! That clears a few things up, and like you suggest, I  
will
experiment with it until I get it just right. The only reason I've  
been

so anxious is that I'm working on a deadline; so, for the time being,
may I simply ask you this? What is the best (and most SEO-friendly)  
way

of presenting links within the copy content? Should I be doing this
within the XHTML using a tags to other swf files, or is there a  
better

method? I guess that is the only thing I'm getting hung up on, as my
pages will occasionally have links within the body paragraphs.

Okay, so I figured out one thing that helps, which is to set my text
fields to htmlText (it was only text before). That helps a lot,  
and
it appears that the links are showing up and they function--sorta.  
They
actually want to open a new page, even if a swf, and even if the  
target

is set to _self.

Really, all I want to do (on my deadline) is have links from one swf  
to

another in the website, but have it all be SEO-friendly. Should be
pretty simple, right? I bet I'm making it more complicated for myself
than it probably needs to be. ;)

My I present my own guess, and you could tell me if I'm wrong? I'm
guessing it has something to do with the following, which I found in  
the

Gaia demo site (I'm pasting only what I assume is the relevant code):

public var textContent:TextField;

var myStyleSheet = new StyleSheet as StyleSheet;
var myURL:String;
var mySection:XMLList;

myURL = Gaia.api.getCurrentBranch();
myStyleSheet =
IStyleSheet(Gaia.api.getPage(index).assets.xmlCss).style;
textContent.styleSheet = myStyleSheet

for each ( var u:XML in mySection) {
if (myURL == u...@url) {
textContent.htmlText = u.copy;
}

Could I use this in tandem with my Gaia-produced XHTML pages? I do not
see where the actual copy node is included in the instance from the
demo site's XML, but only the url part. How is the rest of the text
being included?

Sorry to be impatient! I just did not expect this specific aspect of
development to feel like starting from scratch!


Thanks,
Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726)
email: jw...@cramcrew.com
www.cramcrew.com

One Student At A Time


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Steven
Sacks
Sent: Thursday, May 21, 2009 1:43 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Parsing HTML tags within flash from an  
XHTML

file?

http://www.gaiaflashframework.com/index.php/topic,1847.msg7817.html#msg7
817

Just so everyone is familiar with the context here, the above is the
thread on the forum about this.

The question is about how to use E4X to parse XHTML.  I provide a code
example of how easy it is to do this, but Jonathan's question is more
of a general one about how to use E4X to parse nodes.

Flash doesn't support div in its htmlText, so that's why you use E4X
to grab the node content like

var value:XML = XMLList(copy.innerHTML)[0];
var body:XML = value.div.(@id == body)[0];

I believe the challenge for Jonathan is what the above lines of code
mean and how they work.

value is the XHTML.

value.div returns an XMLList of all div nodes on the first level
within the XHTML.

value.div.(@id == body) means give me an XMLList of the div nodes
that have an attribute id=body.

valid.div.(@id == body)[0] means give me the first XML node in that
XMLList.

This is how E4X works.  A lesson on E4X is out of scope of my forum.
However, there are lots of resources out there for E4X in AS3.  I
highly recommend Colin Moock's Essential Actionscript 3.0 book, which
is how I learned it.  That and the internet.

And Jason, you do not need to complicate things with RegEx.  E4X does
enough.  XHTML is technically XML and can be parsed the same using  
E4X.


Also, while Flash doesn't SEEM to support 

Re: [Flashcoders] Problem with footer fixed to bottom of page

2009-05-21 Thread Steven Sacks
Without posting the errors, I can't tell for sure, but it's possible  
you didn't declare


pubilc var footer_bar:MovieClip

at the top of your class?

Or, perhaps it's null?


On May 21, 2009, at 12:41 PM, Jonathan Wing wrote:


This is probably a silly question, but I've searched google and can't
seem to find the right answer, which is strange as this is seems to  
be a

common thing on pages.



Basically, I have a footer that is fixed to the bottom of a page and  
for

the width of a page, so that no matter what size a user sets a window
for, it will always fix to the bottom. This is what I have so far  
(using

AS3):



In my .fla, I have a long gray bar with the instance name footer.

Then, over in my .as file, I have the following:



import flash.display.*;



footer.y = stage.stageHeight - footer.height;

stage.addEventListener(Event.RESIZE, resizeHandler);



public function resizeHandler(e:Event):void {

footer.y = stage.stageHeight - footer.height;

footer.width = stage.stageWidth;

}



All of this works without a hitch. However, my problem arises when I
want to add text. If I add text in its own mc, then it won't adjust  
with

the page. If I add text inside the footer mc, it will stretch with the
width of the page when I resize. So then I thought maybe I could make
them two mc's embedded in one main mc, and only define the width for  
the

bar. That is, something like:



footer.y = stage.stageHeight - footer.height;

footer_bar.width = stage.stageWidth;



With footer as the main mc, and footer_bar as the long gray bar
embedded inside.



However, this results in a mess of errors.



Any ideas? This seems so common, I'm surprised I can't find anything  
via

Google.



Thanks,

Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726)
email: jw...@cramcrew.com mailto:jw...@cramcrew.com
www.cramcrew.com http://www.cramcrew.com/


One Student At A Time






The information transmitted is intended only for the person or  
entity to which it is addressed and may contain proprietary,  
business-confidential and/or privileged material. If you are not the  
intended recipient of this message you are hereby notified that any  
use, review, retransmission, dissemination, distribution,  
reproduction or any action taken in reliance upon this message is  
prohibited. If you received this in error, please contact the sender  
and delete the material from any computer. Any views expressed in  
this message are those of the individual sender and may not  
necessarily reflect the views of the company.



___
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 footer fixed to bottom of page

2009-05-21 Thread Ivan Dembicki
Hello Jonathan,

stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;

-- 
iv
http://www.bezier.ru
http://bezier.googlecode.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Problem with footer fixed to bottom of page

2009-05-21 Thread Fabio Pinatti
I suppose it should be:

footer.y = stage.stageHeight - footer.height;
footer[footer_bar].width = stage.stageWidth;

since footer_bar is nested into footer.

Kind Regards,
Pinatti


On Thu, May 21, 2009 at 4:41 PM, Jonathan Wing jw...@cramcrew.com wrote:

 This is probably a silly question, but I've searched google and can't
 seem to find the right answer, which is strange as this is seems to be a
 common thing on pages.



 Basically, I have a footer that is fixed to the bottom of a page and for
 the width of a page, so that no matter what size a user sets a window
 for, it will always fix to the bottom. This is what I have so far (using
 AS3):



 In my .fla, I have a long gray bar with the instance name footer.

 Then, over in my .as file, I have the following:



 import flash.display.*;



 footer.y = stage.stageHeight - footer.height;

 stage.addEventListener(Event.RESIZE, resizeHandler);



 public function resizeHandler(e:Event):void {

 footer.y = stage.stageHeight - footer.height;

 footer.width = stage.stageWidth;

  }



 All of this works without a hitch. However, my problem arises when I
 want to add text. If I add text in its own mc, then it won't adjust with
 the page. If I add text inside the footer mc, it will stretch with the
 width of the page when I resize. So then I thought maybe I could make
 them two mc's embedded in one main mc, and only define the width for the
 bar. That is, something like:



 footer.y = stage.stageHeight - footer.height;

 footer_bar.width = stage.stageWidth;



 With footer as the main mc, and footer_bar as the long gray bar
 embedded inside.



 However, this results in a mess of errors.



 Any ideas? This seems so common, I'm surprised I can't find anything via
 Google.



 Thanks,

 Jonathan Wing
 Graphic Designer
 Cram Crew, Inc.
 mobile: (713) 298-2738
 office: (713) 464-CRAM (2726)
 email: jw...@cramcrew.com mailto:jw...@cramcrew.com
 www.cramcrew.com http://www.cramcrew.com/


 One Student At A Time





 
 The information transmitted is intended only for the person or entity to
 which it is addressed and may contain proprietary, business-confidential
 and/or privileged material. If you are not the intended recipient of this
 message you are hereby notified that any use, review, retransmission,
 dissemination, distribution, reproduction or any action taken in reliance
 upon this message is prohibited. If you received this in error, please
 contact the sender and delete the material from any computer. Any views
 expressed in this message are those of the individual sender and may not
 necessarily reflect the views of the company.
 

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




-- 
Fabio Pinatti
:: web.developer
 www.pinatti.com.br
:: 19. 9184.3745 / 3342.1130
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Operator Help!!

2009-05-21 Thread Mark Winterhalder
Hi,

I *think* this does what you're trying to do, which would be to fade
the alpha of an image in and out again over 24h. I don't have AS2 so I
can't test, but when you do, you can set minutesPerDay to however long
you may wish to sit there and watch the magic happen. If it happens,
that is, because as I said it's untested.
Please, reconsider putting it into an enterFrame handler. It's really
enough to run it every couple of minutes.

Also, no, unfortunately I have no idea why Flash is acting up for you.
The operator use appears to be correct.


var sunrise : Number = 6; // hour of day when sun begins to rise
var maxAlpha : Number = 100;

var minutesPerDay : Number = 24 * 60;
var time : Date = new Date();
var minuteOfDay : Number = time.getHours() * 60 + time.getMinutes();
var deltaMinutes : Number = (minuteOfDay - sunrise * 60 +
minutesPerDay) % minutesPerDay;
var cycleElapsed : Number = deltaMinutes / minutesPerDay; // [0...1[
var alpha : Number = Math.abs( 0.5 - cycleElapsed ) * 2 * maxAlpha;

BKGND.BKGND_Grad._alpha = alpha;


HTH,
Mark




On Thu, May 21, 2009 at 7:14 AM, Karl DeSaulniers k...@designdrumm.com wrote:
 EEEk.. anyone!!!

 What am I doing wrong?? This is AS2.

 var sunrise:Array = new Array(6, 7, 8, 9, 10, 11, 12, 13,
 14, 15, 16, 17);
 var sunset:Array = new Array(18, 19, 20, 21, 22, 23, 0, 1,
 2, 3, 4, 5);

 var time:Date = new Date();
 var hour:Number = time.getHours();
 var hours:String = hour.toString();
 var snRSE:String = sunrise[hours];
 var snSET:String = sunset[hours];

 this.onEnterFrame = function() {
        if (hours == snRSE) {
                BKGND.BKGND_Grad._alpha -= BKGND.BKGND_Grad._alpha +
 8.333;
        } else if (hours == snSET) {
                BKGND.BKGND_Grad._alpha += BKGND.BKGND_Grad._alpha +
 8.333;
        }
 };

 I feel this is probably so easy, but it is eluding me for some reason.
 flash says for this line:

 if (hours == snRSE) {

  - operator = must be followed by an Operand ???


 Karl DeSaulniers
 Design Drumm
 http://designdrumm.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] Operator Help!!

2009-05-21 Thread Karl DeSaulniers

Thanks Mark.
That is an interesting approach.
Pardon me for asking, but what part in your code initiates the sunset  
part?


Karl

Sent from losPhone

On May 21, 2009, at 3:34 PM, Mark Winterhalder mar...@gmail.com wrote:


Hi,

I *think* this does what you're trying to do, which would be to fade
the alpha of an image in and out again over 24h. I don't have AS2 so I
can't test, but when you do, you can set minutesPerDay to however long
you may wish to sit there and watch the magic happen. If it happens,
that is, because as I said it's untested.
Please, reconsider putting it into an enterFrame handler. It's really
enough to run it every couple of minutes.

Also, no, unfortunately I have no idea why Flash is acting up for you.
The operator use appears to be correct.


var sunrise : Number = 6; // hour of day when sun begins to rise
var maxAlpha : Number = 100;

var minutesPerDay : Number = 24 * 60;
var time : Date = new Date();
var minuteOfDay : Number = time.getHours() * 60 + time.getMinutes();
var deltaMinutes : Number = (minuteOfDay - sunrise * 60 +
minutesPerDay) % minutesPerDay;
var cycleElapsed : Number = deltaMinutes / minutesPerDay; // [0...1[
var alpha : Number = Math.abs( 0.5 - cycleElapsed ) * 2 * maxAlpha;

BKGND.BKGND_Grad._alpha = alpha;


HTH,
Mark




On Thu, May 21, 2009 at 7:14 AM, Karl DeSaulniers k...@designdrumm.com 
 wrote:

EEEk.. anyone!!!

What am I doing wrong?? This is AS2.

var sunrise:Array = new Array(6, 7, 8, 9, 10, 11, 12,  
13,

14, 15, 16, 17);
var sunset:Array = new Array(18, 19, 20, 21, 22, 23,  
0, 1,

2, 3, 4, 5);

var time:Date = new Date();
var hour:Number = time.getHours();
var hours:String = hour.toString();
var snRSE:String = sunrise[hours];
var snSET:String = sunset[hours];

this.onEnterFrame = function() {
   if (hours == snRSE) {
   BKGND.BKGND_Grad._alpha -= BKGND.BKGND_Grad._alpha +
8.333;
   } else if (hours == snSET) {
   BKGND.BKGND_Grad._alpha += BKGND.BKGND_Grad._alpha +
8.333;
   }
};

I feel this is probably so easy, but it is eluding me for some  
reason.

flash says for this line:

if (hours == snRSE) {

 - operator = must be followed by an Operand ???


Karl DeSaulniers
Design Drumm
http://designdrumm.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 footer fixed to bottom of page

2009-05-21 Thread Jonathan Wing
Thanks Pinatti! That was the problem exactly--nesting not properly
defined. Works great now.

Thanks,
Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726) 
email: jw...@cramcrew.com
www.cramcrew.com

One Student At A Time


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Fabio
Pinatti
Sent: Thursday, May 21, 2009 2:53 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Problem with footer fixed to bottom of page

I suppose it should be:

footer.y = stage.stageHeight - footer.height;
footer[footer_bar].width = stage.stageWidth;

since footer_bar is nested into footer.

Kind Regards,
Pinatti


On Thu, May 21, 2009 at 4:41 PM, Jonathan Wing jw...@cramcrew.com
wrote:

 This is probably a silly question, but I've searched google and can't
 seem to find the right answer, which is strange as this is seems to be
a
 common thing on pages.



 Basically, I have a footer that is fixed to the bottom of a page and
for
 the width of a page, so that no matter what size a user sets a window
 for, it will always fix to the bottom. This is what I have so far
(using
 AS3):



 In my .fla, I have a long gray bar with the instance name footer.

 Then, over in my .as file, I have the following:



 import flash.display.*;



 footer.y = stage.stageHeight - footer.height;

 stage.addEventListener(Event.RESIZE, resizeHandler);



 public function resizeHandler(e:Event):void {

 footer.y = stage.stageHeight - footer.height;

 footer.width = stage.stageWidth;

  }



 All of this works without a hitch. However, my problem arises when I
 want to add text. If I add text in its own mc, then it won't adjust
with
 the page. If I add text inside the footer mc, it will stretch with the
 width of the page when I resize. So then I thought maybe I could make
 them two mc's embedded in one main mc, and only define the width for
the
 bar. That is, something like:



 footer.y = stage.stageHeight - footer.height;

 footer_bar.width = stage.stageWidth;



 With footer as the main mc, and footer_bar as the long gray bar
 embedded inside.



 However, this results in a mess of errors.



 Any ideas? This seems so common, I'm surprised I can't find anything
via
 Google.



 Thanks,

 Jonathan Wing
 Graphic Designer
 Cram Crew, Inc.
 mobile: (713) 298-2738
 office: (713) 464-CRAM (2726)
 email: jw...@cramcrew.com mailto:jw...@cramcrew.com
 www.cramcrew.com http://www.cramcrew.com/


 One Student At A Time





 
 The information transmitted is intended only for the person or entity
to
 which it is addressed and may contain proprietary,
business-confidential
 and/or privileged material. If you are not the intended recipient of
this
 message you are hereby notified that any use, review, retransmission,
 dissemination, distribution, reproduction or any action taken in
reliance
 upon this message is prohibited. If you received this in error, please
 contact the sender and delete the material from any computer. Any
views
 expressed in this message are those of the individual sender and may
not
 necessarily reflect the views of the company.
 

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




-- 
Fabio Pinatti
:: web.developer
 www.pinatti.com.br
:: 19. 9184.3745 / 3342.1130
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



The information transmitted is intended only for the person or entity to which 
it is addressed and may contain proprietary, business-confidential and/or 
privileged material. If you are not the intended recipient of this message you 
are hereby notified that any use, review, retransmission, dissemination, 
distribution, reproduction or any action taken in reliance upon this message is 
prohibited. If you received this in error, please contact the sender and delete 
the material from any computer. Any views expressed in this message are those 
of the individual sender and may not necessarily reflect the views of the 
company.




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


Re: [Flashcoders] Operator Help!!

2009-05-21 Thread Mark Winterhalder
On Thu, May 21, 2009 at 10:43 PM, Karl DeSaulniers k...@designdrumm.com wrote:
 Thanks Mark.
 That is an interesting approach.
 Pardon me for asking, but what part in your code initiates the sunset part?

Nothing really, if you mean how the change is triggered. But whenever
the code runs, it will adjust the alpha.
For testing, you can put all of it into an onEnterFrame(), but for
production use you should run it only once when the page loads. If you
really expect visitors to spend hours on your site, then use
setInterval() to update it every couple of minutes.

The general idea of the code is to calculate what fraction of 12h the
current time is away from the begin of sunset, and then adjust the
alpha accordingly. So, sunset here really means that it's the
darkest minute of the day, just when it begins to get brighter.

Mark


 Karl

 Sent from losPhone

 On May 21, 2009, at 3:34 PM, Mark Winterhalder mar...@gmail.com wrote:

 Hi,

 I *think* this does what you're trying to do, which would be to fade
 the alpha of an image in and out again over 24h. I don't have AS2 so I
 can't test, but when you do, you can set minutesPerDay to however long
 you may wish to sit there and watch the magic happen. If it happens,
 that is, because as I said it's untested.
 Please, reconsider putting it into an enterFrame handler. It's really
 enough to run it every couple of minutes.

 Also, no, unfortunately I have no idea why Flash is acting up for you.
 The operator use appears to be correct.


 var sunrise : Number = 6; // hour of day when sun begins to rise
 var maxAlpha : Number = 100;

 var minutesPerDay : Number = 24 * 60;
 var time : Date = new Date();
 var minuteOfDay : Number = time.getHours() * 60 + time.getMinutes();
 var deltaMinutes : Number = (minuteOfDay - sunrise * 60 +
 minutesPerDay) % minutesPerDay;
 var cycleElapsed : Number = deltaMinutes / minutesPerDay; // [0...1[
 var alpha : Number = Math.abs( 0.5 - cycleElapsed ) * 2 * maxAlpha;

 BKGND.BKGND_Grad._alpha = alpha;


 HTH,
 Mark




 On Thu, May 21, 2009 at 7:14 AM, Karl DeSaulniers k...@designdrumm.com
 wrote:

 EEEk.. anyone!!!

 What am I doing wrong?? This is AS2.

 var sunrise:Array = new Array(6, 7, 8, 9, 10, 11, 12, 13,
 14, 15, 16, 17);
 var sunset:Array = new Array(18, 19, 20, 21, 22, 23, 0,
 1,
 2, 3, 4, 5);

 var time:Date = new Date();
 var hour:Number = time.getHours();
 var hours:String = hour.toString();
 var snRSE:String = sunrise[hours];
 var snSET:String = sunset[hours];

 this.onEnterFrame = function() {
       if (hours == snRSE) {
               BKGND.BKGND_Grad._alpha -= BKGND.BKGND_Grad._alpha +
 8.333;
       } else if (hours == snSET) {
               BKGND.BKGND_Grad._alpha += BKGND.BKGND_Grad._alpha +
 8.333;
       }
 };

 I feel this is probably so easy, but it is eluding me for some reason.
 flash says for this line:

 if (hours == snRSE) {

  - operator = must be followed by an Operand ???


 Karl DeSaulniers
 Design Drumm
 http://designdrumm.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/mailman/listinfo/flashcoders


Re: [Flashcoders] Operator Help!!

2009-05-21 Thread Mark Winterhalder
Hmm... maybe I misunderstood what you were trying to do.

Do you want to have a continuous sunrise and -set over 24h, or do you
want to have a sudden sunset or -rise twice a day?

Mark


On Thu, May 21, 2009 at 10:57 PM, Mark Winterhalder mar...@gmail.com wrote:
 On Thu, May 21, 2009 at 10:43 PM, Karl DeSaulniers k...@designdrumm.com 
 wrote:
 Thanks Mark.
 That is an interesting approach.
 Pardon me for asking, but what part in your code initiates the sunset part?

 Nothing really, if you mean how the change is triggered. But whenever
 the code runs, it will adjust the alpha.
 For testing, you can put all of it into an onEnterFrame(), but for
 production use you should run it only once when the page loads. If you
 really expect visitors to spend hours on your site, then use
 setInterval() to update it every couple of minutes.

 The general idea of the code is to calculate what fraction of 12h the
 current time is away from the begin of sunset, and then adjust the
 alpha accordingly. So, sunset here really means that it's the
 darkest minute of the day, just when it begins to get brighter.

 Mark


 Karl

 Sent from losPhone

 On May 21, 2009, at 3:34 PM, Mark Winterhalder mar...@gmail.com wrote:

 Hi,

 I *think* this does what you're trying to do, which would be to fade
 the alpha of an image in and out again over 24h. I don't have AS2 so I
 can't test, but when you do, you can set minutesPerDay to however long
 you may wish to sit there and watch the magic happen. If it happens,
 that is, because as I said it's untested.
 Please, reconsider putting it into an enterFrame handler. It's really
 enough to run it every couple of minutes.

 Also, no, unfortunately I have no idea why Flash is acting up for you.
 The operator use appears to be correct.


 var sunrise : Number = 6; // hour of day when sun begins to rise
 var maxAlpha : Number = 100;

 var minutesPerDay : Number = 24 * 60;
 var time : Date = new Date();
 var minuteOfDay : Number = time.getHours() * 60 + time.getMinutes();
 var deltaMinutes : Number = (minuteOfDay - sunrise * 60 +
 minutesPerDay) % minutesPerDay;
 var cycleElapsed : Number = deltaMinutes / minutesPerDay; // [0...1[
 var alpha : Number = Math.abs( 0.5 - cycleElapsed ) * 2 * maxAlpha;

 BKGND.BKGND_Grad._alpha = alpha;


 HTH,
 Mark




 On Thu, May 21, 2009 at 7:14 AM, Karl DeSaulniers k...@designdrumm.com
 wrote:

 EEEk.. anyone!!!

 What am I doing wrong?? This is AS2.

 var sunrise:Array = new Array(6, 7, 8, 9, 10, 11, 12, 13,
 14, 15, 16, 17);
 var sunset:Array = new Array(18, 19, 20, 21, 22, 23, 0,
 1,
 2, 3, 4, 5);

 var time:Date = new Date();
 var hour:Number = time.getHours();
 var hours:String = hour.toString();
 var snRSE:String = sunrise[hours];
 var snSET:String = sunset[hours];

 this.onEnterFrame = function() {
       if (hours == snRSE) {
               BKGND.BKGND_Grad._alpha -= BKGND.BKGND_Grad._alpha +
 8.333;
       } else if (hours == snSET) {
               BKGND.BKGND_Grad._alpha += BKGND.BKGND_Grad._alpha +
 8.333;
       }
 };

 I feel this is probably so easy, but it is eluding me for some reason.
 flash says for this line:

 if (hours == snRSE) {

  - operator = must be followed by an Operand ???


 Karl DeSaulniers
 Design Drumm
 http://designdrumm.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/mailman/listinfo/flashcoders


Re: [Flashcoders] Operator Help!!

2009-05-21 Thread Karl DeSaulniers
Oh no, I am just wanting to check what time of day it is and have my  
background fade from dark to light accordingly.
The code you supplied, I think will do that, just haven't got off  
work yet to try out. :)
I am more so wanting to know why, if my code is correct, why its  
throwing this operand error.

very mysterious and bugging me to no end :-P

My code checks to see if the hour that is current is in the sunrise  
or sunset array and so for my code,
how would I check to see if theHour is one of the values in either  
array and if its not in one, check the other?

That is basically what I am trying to accomplish I should say.
Thanks for your help..

Best,
Karl


On May 21, 2009, at 4:04 PM, Mark Winterhalder wrote:


Hmm... maybe I misunderstood what you were trying to do.

Do you want to have a continuous sunrise and -set over 24h, or do you
want to have a sudden sunset or -rise twice a day?

Mark


On Thu, May 21, 2009 at 10:57 PM, Mark Winterhalder  
mar...@gmail.com wrote:
On Thu, May 21, 2009 at 10:43 PM, Karl DeSaulniers  
k...@designdrumm.com wrote:

Thanks Mark.
That is an interesting approach.
Pardon me for asking, but what part in your code initiates the  
sunset part?


Nothing really, if you mean how the change is triggered. But whenever
the code runs, it will adjust the alpha.
For testing, you can put all of it into an onEnterFrame(), but for
production use you should run it only once when the page loads. If  
you

really expect visitors to spend hours on your site, then use
setInterval() to update it every couple of minutes.

The general idea of the code is to calculate what fraction of 12h the
current time is away from the begin of sunset, and then adjust the
alpha accordingly. So, sunset here really means that it's the
darkest minute of the day, just when it begins to get brighter.

Mark



Karl

Sent from losPhone

On May 21, 2009, at 3:34 PM, Mark Winterhalder mar...@gmail.com  
wrote:



Hi,

I *think* this does what you're trying to do, which would be to  
fade
the alpha of an image in and out again over 24h. I don't have  
AS2 so I
can't test, but when you do, you can set minutesPerDay to  
however long
you may wish to sit there and watch the magic happen. If it  
happens,

that is, because as I said it's untested.
Please, reconsider putting it into an enterFrame handler. It's  
really

enough to run it every couple of minutes.

Also, no, unfortunately I have no idea why Flash is acting up  
for you.

The operator use appears to be correct.


var sunrise : Number = 6; // hour of day when sun begins to rise
var maxAlpha : Number = 100;

var minutesPerDay : Number = 24 * 60;
var time : Date = new Date();
var minuteOfDay : Number = time.getHours() * 60 + time.getMinutes 
();

var deltaMinutes : Number = (minuteOfDay - sunrise * 60 +
minutesPerDay) % minutesPerDay;
var cycleElapsed : Number = deltaMinutes / minutesPerDay; //  
[0...1[

var alpha : Number = Math.abs( 0.5 - cycleElapsed ) * 2 * maxAlpha;

BKGND.BKGND_Grad._alpha = alpha;


HTH,
Mark




On Thu, May 21, 2009 at 7:14 AM, Karl DeSaulniers  
k...@designdrumm.com

wrote:


EEEk.. anyone!!!

What am I doing wrong?? This is AS2.

var sunrise:Array = new Array(6, 7, 8, 9, 10, 11,  
12, 13,

14, 15, 16, 17);
var sunset:Array = new Array(18, 19, 20, 21, 22,  
23, 0,

1,
2, 3, 4, 5);

var time:Date = new Date();
var hour:Number = time.getHours();
var hours:String = hour.toString();
var snRSE:String = sunrise[hours];
var snSET:String = sunset[hours];

this.onEnterFrame = function() {
  if (hours == snRSE) {
  BKGND.BKGND_Grad._alpha -= BKGND.BKGND_Grad._alpha +
8.333;
  } else if (hours == snSET) {
  BKGND.BKGND_Grad._alpha += BKGND.BKGND_Grad._alpha +
8.333;
  }
};

I feel this is probably so easy, but it is eluding me for some  
reason.

flash says for this line:

if (hours == snRSE) {

 - operator = must be followed by an Operand ???


Karl DeSaulniers
Design Drumm
http://designdrumm.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/mailman/listinfo/flashcoders


Karl DeSaulniers
Design Drumm
http://designdrumm.com

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


RE: [Flashcoders] Parsing HTML tags within flash from an XHTML file?

2009-05-21 Thread Jonathan Wing
Steven,
It does make sense for the most part, except that I'm not sure if I'm
placing it in the right place. I have it in my HomePage.as file (just
using this page as an example, as I assumed that was what you might have
meant when you said parsing code), and I guess I need to define a or
put it in the right place? Because right now, it gives me an error
#1120: Access of undefined property a. This is how I put it in my code
(minus some of the extra stuff):

public class HomePage extends AbstractPage
{   
public var dynamic_text:TextField;

public function HomePage()
{
super();
alpha = 0;
}

override public function transitionIn():void 
{
super.transitionIn();
TweenLite.to(this, 0.3, {alpha:1,
onComplete:transitionInComplete});

var href:String = a...@href;
href = href.substr(0, href.length - 4);
var internalTitle:String = href.toUpperCase();
Gaia.api.goto(Pages[internalTitle]);

dynamic_text.htmlText = this.copy.intro;
}
}

Sorry to paste it directly into my code like that; it's just that I can
only guess where it might go...

Thanks,
Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726) 
email: jw...@cramcrew.com
www.cramcrew.com

One Student At A Time


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Steven
Sacks
Sent: Thursday, May 21, 2009 2:57 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

Do you mean you want to have links in your a tags that call  
Gaia.api.goto()?

You can do that, but obviously, those links wouldn't work in the XHTML.

After thinking about it a bit, I think what might work is this

a href=contact.htmlGo to contact page/a

With that being the link to the SEO XHTML page that is generated for  
that page.

In your parsing code, you would change the href to call an  
actionscript method that would take page.html and convert it to

var href:String = a...@href;
href = href.substr(0, href.length - 4);
var internalTitle:String = href.toUpperCase();
Gaia.api.goto(Pages[internalTitle]);

That is just an example, but basically you're converting  
contact.html to CONTACT and, there should be a public static const  
in Pages called CONTACT which has the branch for that title.

Does this make sense? (this part of the question is definitely  
appropriate for the Gaia forum, too)



On May 21, 2009, at 12:29 PM, Jonathan Wing wrote:

 Thanks Steven! That clears a few things up, and like you suggest, I  
 will
 experiment with it until I get it just right. The only reason I've  
 been
 so anxious is that I'm working on a deadline; so, for the time being,
 may I simply ask you this? What is the best (and most SEO-friendly)  
 way
 of presenting links within the copy content? Should I be doing this
 within the XHTML using a tags to other swf files, or is there a  
 better
 method? I guess that is the only thing I'm getting hung up on, as my
 pages will occasionally have links within the body paragraphs.

 Okay, so I figured out one thing that helps, which is to set my text
 fields to htmlText (it was only text before). That helps a lot,  
 and
 it appears that the links are showing up and they function--sorta.  
 They
 actually want to open a new page, even if a swf, and even if the  
 target
 is set to _self.

 Really, all I want to do (on my deadline) is have links from one swf  
 to
 another in the website, but have it all be SEO-friendly. Should be
 pretty simple, right? I bet I'm making it more complicated for myself
 than it probably needs to be. ;)

 My I present my own guess, and you could tell me if I'm wrong? I'm
 guessing it has something to do with the following, which I found in  
 the
 Gaia demo site (I'm pasting only what I assume is the relevant code):

 public var textContent:TextField;

 var myStyleSheet = new StyleSheet as StyleSheet;
 var myURL:String;
 var mySection:XMLList;

 myURL = Gaia.api.getCurrentBranch();  
 myStyleSheet =
 IStyleSheet(Gaia.api.getPage(index).assets.xmlCss).style;
 textContent.styleSheet = myStyleSheet

 for each ( var u:XML in mySection) {
   if (myURL == u...@url) {
   textContent.htmlText = u.copy;
   }

 Could I use this in tandem with my Gaia-produced XHTML pages? I do not
 see where the actual copy node is included in the instance from the
 demo site's XML, but only the url part. How is the rest of the text
 being included?

 Sorry to be impatient! I just 

Re: [Flashcoders] Operator Help!!

2009-05-21 Thread Mark Winterhalder
On Thu, May 21, 2009 at 11:44 PM, Karl DeSaulniers k...@designdrumm.com wrote:
 Oh no, I am just wanting to check what time of day it is and have my
 background fade from dark to light accordingly.
 The code you supplied, I think will do that, just haven't got off work yet
 to try out. :)

Well, it fades out for 12h, then fades back in for 12h, beginning at
6am each day.

But now I think I really know what you mean. We can recycle most of the lines:

var sunrise : Number = 6; // hour of day when sun begins to rise
var fadeDuration = 100; // as number of frames

var framesElapsed : Number = 0;
var minutesPerDay : Number = 24 * 60;
var time : Date = new Date();
var minuteOfDay : Number = time.getHours() * 60 + time.getMinutes();
var deltaMinutes : Number = (minuteOfDay - sunrise * 60 +
minutesPerDay) % minutesPerDay;
var cycleElapsed : Number = deltaMinutes / minutesPerDay; // [0...1[

BKGND.BKGND_Grad.onEnterFrame = function () {
   var progress : Number = framesElapsed / fadeDuration;

   // here we check if the sun is supposed to set or to rise:
   if( cycleElapsed  .5 ) {
  // the sun is still rising
  this._alpha = (1 - progress) * 100;
   } else {
  // the sun is setting
  this._alpha = progress * 100;
   }
};

 I am more so wanting to know why, if my code is correct, why its throwing
 this operand error.
 very mysterious and bugging me to no end :-P

Yeah, I'd like to know that, too. Possibly, closing and restarting
Flash will fix it? It has its mysterious ways sometimes, at least
that's how it used to be. :/

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


Re: [Flashcoders] Operator Help!!

2009-05-21 Thread Mark Winterhalder
Oh, I forgot to remove the onEnterFrame when it's no longer needed.
Please add this line to the end of the function:

if( progress = 1 ) delete this.onEnterFrame;

Mark


On Fri, May 22, 2009 at 12:18 AM, Mark Winterhalder mar...@gmail.com wrote:
 On Thu, May 21, 2009 at 11:44 PM, Karl DeSaulniers k...@designdrumm.com 
 wrote:
 Oh no, I am just wanting to check what time of day it is and have my
 background fade from dark to light accordingly.
 The code you supplied, I think will do that, just haven't got off work yet
 to try out. :)

 Well, it fades out for 12h, then fades back in for 12h, beginning at
 6am each day.

 But now I think I really know what you mean. We can recycle most of the lines:

 var sunrise : Number = 6; // hour of day when sun begins to rise
 var fadeDuration = 100; // as number of frames

 var framesElapsed : Number = 0;
 var minutesPerDay : Number = 24 * 60;
 var time : Date = new Date();
 var minuteOfDay : Number = time.getHours() * 60 + time.getMinutes();
 var deltaMinutes : Number = (minuteOfDay - sunrise * 60 +
 minutesPerDay) % minutesPerDay;
 var cycleElapsed : Number = deltaMinutes / minutesPerDay; // [0...1[

 BKGND.BKGND_Grad.onEnterFrame = function () {
   var progress : Number = framesElapsed / fadeDuration;

   // here we check if the sun is supposed to set or to rise:
   if( cycleElapsed  .5 ) {
      // the sun is still rising
      this._alpha = (1 - progress) * 100;
   } else {
      // the sun is setting
      this._alpha = progress * 100;
   }
 };

 I am more so wanting to know why, if my code is correct, why its throwing
 this operand error.
 very mysterious and bugging me to no end :-P

 Yeah, I'd like to know that, too. Possibly, closing and restarting
 Flash will fix it? It has its mysterious ways sometimes, at least
 that's how it used to be. :/

 Mark


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


Re: [Flashcoders] Operator Help!!

2009-05-21 Thread Karl DeSaulniers

I will try that and let you know.
One question, sort of off-sub, but in regards to what you just wrote.
When you delete something does this remove it completely?
or would it be available if that frame was played again?

Karl

Thanks for taking the time.. really appreciate it.


On May 21, 2009, at 5:19 PM, Mark Winterhalder wrote:


Oh, I forgot to remove the onEnterFrame when it's no longer needed.
Please add this line to the end of the function:

if( progress = 1 ) delete this.onEnterFrame;

Mark


On Fri, May 22, 2009 at 12:18 AM, Mark Winterhalder  
mar...@gmail.com wrote:
On Thu, May 21, 2009 at 11:44 PM, Karl DeSaulniers  
k...@designdrumm.com wrote:

Oh no, I am just wanting to check what time of day it is and have my
background fade from dark to light accordingly.
The code you supplied, I think will do that, just haven't got off  
work yet

to try out. :)


Well, it fades out for 12h, then fades back in for 12h, beginning at
6am each day.

But now I think I really know what you mean. We can recycle most  
of the lines:


var sunrise : Number = 6; // hour of day when sun begins to rise
var fadeDuration = 100; // as number of frames

var framesElapsed : Number = 0;
var minutesPerDay : Number = 24 * 60;
var time : Date = new Date();
var minuteOfDay : Number = time.getHours() * 60 + time.getMinutes();
var deltaMinutes : Number = (minuteOfDay - sunrise * 60 +
minutesPerDay) % minutesPerDay;
var cycleElapsed : Number = deltaMinutes / minutesPerDay; // [0...1[

BKGND.BKGND_Grad.onEnterFrame = function () {
  var progress : Number = framesElapsed / fadeDuration;

  // here we check if the sun is supposed to set or to rise:
  if( cycleElapsed  .5 ) {
 // the sun is still rising
 this._alpha = (1 - progress) * 100;
  } else {
 // the sun is setting
 this._alpha = progress * 100;
  }
};

I am more so wanting to know why, if my code is correct, why its  
throwing

this operand error.
very mysterious and bugging me to no end :-P


Yeah, I'd like to know that, too. Possibly, closing and restarting
Flash will fix it? It has its mysterious ways sometimes, at least
that's how it used to be. :/

Mark



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


Karl DeSaulniers
Design Drumm
http://designdrumm.com

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


Re: [Flashcoders] Operator Help!!

2009-05-21 Thread Mark Winterhalder
On Fri, May 22, 2009 at 12:28 AM, Karl DeSaulniers k...@designdrumm.com wrote:
 I will try that and let you know.

I just found another bug. :/

This line:

var progress : Number = framesElapsed / fadeDuration;

should really be like this:

var progress : Number = framesElapsed++ / fadeDuration;

otherwise there wouldn't be a fade. Sorry for that.

 One question, sort of off-sub, but in regards to what you just wrote.
 When you delete something does this remove it completely?
 or would it be available if that frame was played again?

If the code on that page would play again, then the onEnterFrame =
... part would get executed again, and the function would get
reassigned to onEnterFrame. It would also reset the framesElapsed
counter, so it wouldn't work if executed each frame.
So, run it only once. If you have to run it more than once, it gets
complicated. Let me know if that's the case.

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


Re: [Flashcoders] Operator Help!!

2009-05-21 Thread Karl DeSaulniers

:)

On May 21, 2009, at 5:38 PM, Mark Winterhalder wrote:

On Fri, May 22, 2009 at 12:28 AM, Karl DeSaulniers  
k...@designdrumm.com wrote:

I will try that and let you know.


I just found another bug. :/

This line:

var progress : Number = framesElapsed / fadeDuration;

should really be like this:

var progress : Number = framesElapsed++ / fadeDuration;

otherwise there wouldn't be a fade. Sorry for that.


One question, sort of off-sub, but in regards to what you just wrote.
When you delete something does this remove it completely?
or would it be available if that frame was played again?


If the code on that page would play again, then the onEnterFrame =
... part would get executed again, and the function would get
reassigned to onEnterFrame. It would also reset the framesElapsed
counter, so it wouldn't work if executed each frame.
So, run it only once. If you have to run it more than once, it gets
complicated. Let me know if that's the case.

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


Karl DeSaulniers
Design Drumm
http://designdrumm.com

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


Re: [Flashcoders] Operator Help!!

2009-05-21 Thread Karl DeSaulniers

Well, I do plan on people spending quite a while on my site, and so,
if someone came around sunset and stayed for say an hour or two, (if  
Im lucky :P)

they would see the change happen?

or am I asking for a bogdown-nightmare-to-happen ?

Karl


On May 21, 2009, at 5:38 PM, Mark Winterhalder wrote:



If the code on that page would play again, then the onEnterFrame =
... part would get executed again, and the function would get
reassigned to onEnterFrame. It would also reset the framesElapsed
counter, so it wouldn't work if executed each frame.
So, run it only once. If you have to run it more than once, it gets
complicated. Let me know if that's the case.


Karl DeSaulniers
Design Drumm
http://designdrumm.com

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


[Flashcoders] Flash program question

2009-05-21 Thread Karl DeSaulniers
Does anyone know of a way to set unique names to MCs and graphics  
that are imported into flash? Say if I create a layout in illustrator  
for example and import this into flash, I want to be able to set  
unique names to my MCs with out having to go MC to MC. Is there an  
auto unique name function in flash at all? I have never really seen  
anything, maybe this should be an added feature. That way you can  
import and not worry about two MCs being named the same and possibly  
write over one say if you happened to copy and paste one to another  
scene or something. Currently it asks you to write over or not, but  
the catch is that no mater what, at least one is getting written over  
even if you say don't write because they have the same name. Weird.


Karl DeSaulniers
Design Drumm
http://designdrumm.com

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