[flexcoders] Programming Challenge - finding nodes in an array with a value near a number

2007-03-19 Thread grae_hall
So I've got a programming challenge.

I've got audio/video streaming in, and I've got an XML document 
converted to an Array (each node is an index of the array), each 
value in the array in the contains a cuepoint in Ms.

What's the most efficient way to find the cuepoints in the array 
which are within range (with a fuzziness of say +/- 50ms) of the 
current position of the playhead on my audio/video?

At the moment I've simply got a for (var i:Number = 0; i  
cuePoints.length; i++) {}

That's not really a robust way to check the array of cuepoints for 
matching values of the current media's playhead position - as the 
more cuepoints in the array, the lower the chance is of finding 
matches accurately.

So to reiterate - say my media's playhead is at a position of 2300Ms.
My swf is 30FPS - and in my onEnterFrame for the mediaplayer in that 
SWF I check to see if there are any cue points (with values of say, 
2250, 2300, 2325) within range of the current playhead position.

I'm hunting for the most efficient way to achieve that.

I've got some ideas - which will work ok - but this has to be a 
common programming challenge - and there has to be a more efficient 
way than a loop through an array reading all cue point values that 
are within range of my current playhead's position.

Have at it - homies.


Grae Hall
Senior Art Director
Singleton Ogilvy Interactive



[flexcoders] using coldfusion to return height and width of flex swf

2006-12-15 Thread grae_hall
I've got a SWFTag coldfusion tag I've made that's a handy shortcut 
for embeding flash 8 or less swfs into a page with syntax that feels 
similar to an an HTML image tag.

Unfortunately, it requires that I know the explicit width and height 
of the swf, and set them as attributes.

SWFTag uses SWFObject at present, and, as such I've had little 
success getting SWFObject to embed a flash 9 flex published swf onto 
the page.

I've low-jacked the generated HTML Template from Flex, and 
incorporated it into my SWFTag, so if it's a flash 9 SWF, it uses the 
a massaged Flex HTML Template - but that still requires that I a) 
tell the custom tag that it's a flash 9 swf, and 2) know the height 
and the width.

Ideally, I'd like to let developers just type the equivolent of 
skin:SWFTag source=/swf/mySWF.swf/ and leverage coldfusion to 
somehow magically read in the version of the SWF, and its 
width/height.

I had a bit of a look into the CFXImage tag - but it doesn't seem to 
support SWFs.

So - anyone got any clues about the potential magic that is Adobe 
owning Flex, Flash and ColdFusion so they'd provide some sort of 
mechanism for me to read in version and dimensions of SWF files on 
the server?

Let me know if I'm reaching - I'm trying to include a buncha Flex 2.0 
optional components into the lastest version of the ColdFusion 
Content Management System FarCry - which is produced at the place I 
work. The easier I could make it for developers/clients to use swfs, 
the better it'll be for the company I work for, and Adobe.

Come on Mike Chambers - etc - you boys have gotta have some tricks up 
your sleeve that I haven't found after hours of googling :D

Reargards,

Grae Hall

Senior Designer
www.daemon.com.au



[flexcoders] Re: ToggleButtonBar: Styling Individual Button

2006-08-29 Thread grae_hall
Hey hey hey,

I had just such a question, so I spent a bit of time looking into how 
to access the child buttons of a button bar, and skin them uniquely, as 
opposed to simply skinning the first - rest - and last.

I figured out how to do it, and ran a cool looking custom skin over the 
top of it, but I don't have the screenshot, or code handy (I'm at work).

I used an extended button bar to display the steps of a wizard process, 
with the current step of the wizard being visually referenced by the 
accompanying step name on the button bar. I had the entire skin 
customised - semi-3d looking square blocks of different colours with 
big numbers on each.

I'll post the code for it tomorrow, as well as a screenshot of it 
working.

It is possible, it's a little tricky as you have to access the the 
child a bit differently to how I expected.

Here's a href=http://grae.halltech.com.au/media/uiruntimeskin.jpg
an earlier example/a I was working on, where I overrode the skins 
of various uicomponents at runtime with programmatically drawn skins.

img src=http://grae.halltech.com.au/media/uiruntimeskin.jpg
/

and, in case the list strips out the html, here's a text link to it.

I'll post a useful, commented, and flexible example for you tomorrow 
night.


Grae Hall

Senior Designer
www.daemon.com.au


--- In flexcoders@yahoogroups.com, lostinrecursion [EMAIL PROTECTED] 
wrote:

 Hi all,
 
 I looked through the docs and did a couple of Googles but couldn't
 find anything on this. Is it possible to style each individual button
 in a ToggleButtonBar?
 
 For example, assigning a different background color to each one?
 
 Thanks
 -Kenny








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] success: flex data services linking to coldfusion - both as instances in jrun

2006-08-26 Thread grae_hall
after a lot of stuffing about today, Patrick and I managed to get FDS 
running as an instance of jrun, configured apache, and got FDS talking 
to coldfusion's event gateway, which did ran logic on the 
consumer/producer messages, and supplied the result.

We couldn't find much in the way of specific documentation about how to 
get that done - but we worked it out.

I'll post some sample code at the end of next week - as the FDS stuff 
for Flex is the backbone of our Australian Flex Derby competition 
entry - which closes in a few days.

But hell yeah, pushing and pulling information between two separate 
people through the browser, while running logic on it through cfc's on 
the cf server.

We might finally be able to present a strong enough case for flex over 
ajax to the company we work for.






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Limiting length of xmllistcollection to display only first 10 in a datagrid.

2006-07-28 Thread grae_hall
I've got a datagrid component which I'm using to display the most 
recent documents from an XML file. It's an XMLListCollection. I think.

I've worked out how to do the sort()/refresh() stuff on it, and 
that's working as expected.

However, there's the potential for there to be in excess of 1000 
documents references in the XML file.

I'd like to limit the xmllistcollection I use for my recent 
documents to a set number - I'm just unsure of the syntax. I tried 
iterating through the XMLListCollection with a for i ++ loop, 
starting 'i' at the number I wanted - and then removedItemsAt(i) - 
but that appears to have affected the other XMLListCollection I use, 
of the same XMLList - to search all of the documents. So instead of 
getting back a lot of results, in my other datagrid component based 
on search, I only get back a maximum of whatever I set 'i' to in the 
for loop on the recent documents.

So - how do I limit my results, and how do I interact with 
XMLListCollections properly so that I don't change the loaded XMLList 
underneath, that's referenced in other XMLListCollections?

Your help in this regard - my fellow flex monkeys, would be greatly 
appreciated.

If I check mail-archive in a month, and see that this, like many 
useful questions posed on this list, received no replies, I'll feel 
quite despondent.

True story.

Grae Hall

Senior Designer
www.daemon.com.au









--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Re: Programmatic skinning example - buttons, buttonbar, panel, etc

2006-05-23 Thread grae_hall



Hey hey,

I've never actually published any of Flex apps to the web before, so 
it's entirely possible I made some sort of retarded mistake.

I've got a lot of embeded SWF files in there - for fonts, and 
graphics, which work for me, but maybe it's because it's using my 
local permissions and not reading it fully independently off the web.

It's in Beta 3.0, so, it uses the Flash 9.0 beta - what problems are 
you coming up with exactly? I'd really like to ensure it actually 
works for everyone, otherwise there wasn't much point working on it 
and publishing it.

Which version of Flash player are you using, and what sort of 
browser? I've only tested it in IE - so I don't know if it loads in 
FireFox etc.

Let me know - it's important to me that it works.

Regards,

Grae

--- In flexcoders@yahoogroups.com, Jignesh Dodiya [EMAIL PROTECTED] 
wrote:

 can't see anything in the given link Grae...
 
 On 5/21/06, Tim Hoff [EMAIL PROTECTED] wrote:
 
  That's what I'm talkng about Grae - exchange. :)
 
 
  -TH
 
 
  --- In flexcoders@yahoogroups.com, grae_hall grae@ wrote:
  
   http://grae.halltech.com.au/xmxSkins/
  
   It's an example with source of how to skin buttons with your own
   styles programmatically - it's a snippet from an RIA I've been
   working on.
  
   It's pretty rough, and I've only got a few months of flex
  experience,
   so there may be all sorts of mistakes and dodgyness in the code,
  but
   it works. I'm a designer, not a programmer, that's my excuse.
  
   Well, aside from a small sizing issue with the mouseover on the
   buttonBar with the icon... but it's late so it can get fixed 
some
   other time.
  
   Once I got the hang of it, it turned out to be way, way, way
  quicker
   and easier than trying to fight with Flex's default components 
and
   stylesheeting - let alone muttering about the discrepencies
  between
   the code Flex Style Explorer generates for you, and how that 
code
   actually looks.
  
   I might update this, I don't know, hopefully it's useful to
  someone
   on the interweb - it's the sort of real example I wish had 
been
   around when I first started a few months ago.
  
 
 
 
 
 
 
  --
  Flexcoders Mailing List
  FAQ: 
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Search Archives: http://www.mail-archive.com/flexcoders%
40yahoogroups.com
 
 
 
  SPONSORED LINKS
  Web site design developmenthttp://groups.yahoo.com/gads?
t=msk=Web+site+design+developmentw1=Web+site+design+developmentw2=C
omputer+software+developmentw3=Software+design+and+developmentw4=Mac
romedia+flexw5=Software+development+best+practicec=5s=166.sig=L-
4QTvxB_quFDtMyhrQaHQ Computer
  software developmenthttp://groups.yahoo.com/gads?
t=msk=Computer+software+developmentw1=Web+site+design+developmentw2
=Computer+software+developmentw3=Software+design+and+developmentw4=M
acromedia+flexw5=Software+development+best+practicec=5s=166.sig=lv
QjSRfQDfWudJSe1lLjHw Software
  design and developmenthttp://groups.yahoo.com/gads?
t=msk=Software+design+and+developmentw1=Web+site+design+development
w2=Computer+software+developmentw3=Software+design+and+developmentw4
=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=
1pMBCdo3DsJbuU9AEmO1oQ Macromedia
  flexhttp://groups.yahoo.com/gads?
t=msk=Macromedia+flexw1=Web+site+design+developmentw2=Computer+soft
ware+developmentw3=Software+design+and+developmentw4=Macromedia+flex
w5=Software+development+best+practicec=5s=166.sig=OO6nPIrz7_EpZI36
cYzBjw Software
  development best practicehttp://groups.yahoo.com/gads?
t=msk=Software+development+best+practicew1=Web+site+design+developme
ntw2=Computer+software+developmentw3=Software+design+and+development
w4=Macromedia+flexw5=Software+development+best+practicec=5s=166.s
ig=f89quyyulIDsnABLD6IXIw
  --
  YAHOO! GROUPS LINKS
 
 
  - Visit your 
group flexcodershttp://groups.yahoo.com/group/flexcoders
  on the web.
 
  - To unsubscribe from this group, send an email to:
  [EMAIL PROTECTED]flexcoders-
[EMAIL PROTECTED]
 
  - Your use of Yahoo! Groups is subject to the Yahoo! Terms of
  Service http://docs.yahoo.com/info/terms/.
 
 
  --
 
 
 
 
 -- 
 Regards,
 
 Jignesh Dodiya












--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this g

[flexcoders] Programmatic skinning example - buttons, buttonbar, panel, etc

2006-05-20 Thread grae_hall



http://grae.halltech.com.au/xmxSkins/

It's an example with source of how to skin buttons with your own 
styles programmatically - it's a snippet from an RIA I've been 
working on.

It's pretty rough, and I've only got a few months of flex experience, 
so there may be all sorts of mistakes and dodgyness in the code, but 
it works. I'm a designer, not a programmer, that's my excuse.

Well, aside from a small sizing issue with the mouseover on the 
buttonBar with the icon... but it's late so it can get fixed some 
other time.

Once I got the hang of it, it turned out to be way, way, way quicker 
and easier than trying to fight with Flex's default components and 
stylesheeting - let alone muttering about the discrepencies between 
the code Flex Style Explorer generates for you, and how that code 
actually looks.

I might update this, I don't know, hopefully it's useful to someone 
on the interweb - it's the sort of real example I wish had been 
around when I first started a few months ago.










--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











[flexcoders] Extended Visual Component Defaults in Design View

2006-04-13 Thread grae_hall
I've created a series of extended visual components for the project 
I'm currently working on so I've got a centralised location to adjust 
the appearance and methods of any component I put on the stage.

So for example, I have XPanel, which extends Panel, and I've 
overridden commitProperties to set a series of defaults such as 
borderThickness, etc.

It seems to work fine when I run the application, but none of the 
defaults appear in Design View. The component can be dragged onto the 
stage etc, but the properties that appear in the Design View are the 
Flex defaults, not the new defaults I've set.

Where or how exactly do I set the properties within the extended 
class to enable Design View to pick them up and display them?

Here's an example,

package xmx.comps {
import mx.containers.Panel;
import flash.util.trace;
import mx.states.SetStyle;

public class XPanel extends Panel {


public function XPanel() {
super();
var className:String=XPanel;
}

override protected function commitProperties():void {
layout=absolute;
setStyle(cornerRadius, 0);
setStyle(headerHeight, 24);
setStyle(borderThicknessBottom, 0);
setStyle(borderThicknessLeft, 0);
setStyle(borderThicknessRight, 0);
setStyle(borderThicknessTop, 0);
setStyle(borderThicknessTop, 0);
setStyle(headerColors, [0xFF, 
0xFF]);
setStyle(highlightAlphas, [1,1]);
setStyle(backgroundAlpha, 0.3);
setStyle(backgroundColor, 0xFF);
setStyle(dropShadowEnabled, true);
setStyle(shadowDirection, right);
setStyle(shadowDistance, 1);
super.createChildren();
}
}
}

and the MXML that instances it is as follows,

xmxComps:XPanel x=9 y=9 width=234 height=474 
id=panelTest
/xmxComps:XPanel

It appears as expected when the application is run, but it looks like 
a standard Flex panel in Design View.

Is there a simple fix, or am I doing something horrendously incorrect?





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[flexcoders] F2B2 : RE: Extended Visual Component Defaults in Design View

2006-04-13 Thread grae_hall
I've cleaned it up a little - and rectified my main mistake - after 
reading some more documentation I've set the defaults in the 
constructor.

I've not yet been able to figure out how to have those defaults 
present in the design view, yet. So, any help would be appreciated.

This is my updated code,

package xmx.comps {
import mx.containers.Panel;
import flash.util.trace;

public class Panel extends mx.containers.Panel {

public function Panel() {
super();
layout=absolute;
setStyle(backgroundAlpha, 0.3);
setStyle(backgroundColor, 0xFF);
setStyle(borderAlpha, 1);
setStyle(borderColor, 0xFF);
setStyle(borderStyle, solid);
setStyle(borderThickness, 1);
setStyle(borderThicknessBottom, 0);
setStyle(borderThicknessLeft, 0);
setStyle(borderThicknessRight, 0);
setStyle(borderThicknessTop, 2);
setStyle(color, 0x33);
setStyle(cornerRadius, 0);
setStyle(fontSize, 10);
setStyle(headerColors, [0xFF, 
0xBB]);
setStyle(headerHeight, 21);
setStyle(highlightAlphas, [1,1]);
setStyle(dropShadowEnabled, true);
setStyle(titleStyleName, fontBodyB);
}
}
}

and the MXML is as follows,

xmxComps:Panel x=9 y=9 width=234 height=474 id=panelTest 
title=Panel Test
xmxComps:Button x=3 y=3 label=Button/
/xmxComps:Panel

--- In flexcoders@yahoogroups.com, grae_hall [EMAIL PROTECTED] wrote:

 I've created a series of extended visual components for the project 
 I'm currently working on so I've got a centralised location to 
adjust 
 the appearance and methods of any component I put on the stage.
 
 So for example, I have XPanel, which extends Panel, and I've 
 overridden commitProperties to set a series of defaults such as 
 borderThickness, etc.
 
 It seems to work fine when I run the application, but none of the 
 defaults appear in Design View. The component can be dragged onto 
the 
 stage etc, but the properties that appear in the Design View are 
the 
 Flex defaults, not the new defaults I've set.
 
 Where or how exactly do I set the properties within the extended 
 class to enable Design View to pick them up and display them?
 
 Here's an example,
 
 package xmx.comps {
   import mx.containers.Panel;
   import flash.util.trace;
   import mx.states.SetStyle;
 
   public class XPanel extends Panel {
 
 
   public function XPanel() {
   super();
   var className:String=XPanel;
   }
 
   override protected function commitProperties():void {
   layout=absolute;
   setStyle(cornerRadius, 0);
   setStyle(headerHeight, 24);
   setStyle(borderThicknessBottom, 0);
   setStyle(borderThicknessLeft, 0);
   setStyle(borderThicknessRight, 0);
   setStyle(borderThicknessTop, 0);
   setStyle(borderThicknessTop, 0);
   setStyle(headerColors, [0xFF, 
 0xFF]);
   setStyle(highlightAlphas, [1,1]);
   setStyle(backgroundAlpha, 0.3);
   setStyle(backgroundColor, 0xFF);
   setStyle(dropShadowEnabled, true);
   setStyle(shadowDirection, right);
   setStyle(shadowDistance, 1);
   super.createChildren();
   }
   }
 }
 
 and the MXML that instances it is as follows,
 
   xmxComps:XPanel x=9 y=9 width=234 height=474 
 id=panelTest
   /xmxComps:XPanel
 
 It appears as expected when the application is run, but it looks 
like 
 a standard Flex panel in Design View.
 
 Is there a simple fix, or am I doing something horrendously 
incorrect?







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] F2B2 : Eclipse : Changing the Documents location

2006-04-05 Thread grae_hall
I've got My Documents on the root of my C (far more convenient) - 
windows and all my applications see the My Documents directory as being 
mapped to mapped to the root of C - but I'm probably not the only 
person who's had difficulty nailing down exactly how to get Eclipse to 
point there by default instead of off in the default location. When I 
set the document directory location in preferences, it forgets it.

Is it an easy fix?






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] F2B2: Loaded SWF Movie Clip frame as unique image source?

2006-03-31 Thread grae_hall
How's that subject for correct grammar for phrasing a question.

So - what I've been trying to do - I load a mulitframe external SWF 
in via with the Loader - then once loaded I create a new movieclip 
from the loader.content - then I gotoandstop on my desired frame - 
then it gets a little bit sketchy, because I don't really know if I 
can assign the contents of that movie clip to the source of an image.

The reason I'm trying to do that, is so that I can have a multi-
framed SWF, with each frame containing various assets, that I can 
then place into some sort of display object (either image, or another 
movieclip) for use in my user interface.

The two main stumbling blocks to date have been that if add a 
movieclip that's stopped on a certain frame of a loaded swf, then 
make a new movieclip from and stop it on another frame, all of the 
movieclips change to the new frame I wentto in the multi-framed swf.

Short of copying the contents of the movieclip object out to bytecode 
and then writing it back in as a bitmap or something, I can't really 
seem to get it working.

The second stumbling block is I'm unsure of the syntax or the 
feasibility of assigning the contents of a movieclip and the frame 
its on to an Image, and then creating another image, changing the 
movieclips frame, and then assigning that frame to the newly created 
image, giving me to images that are different frames of the same swf.

My current workaround is to load the swf in from scratch per frame I 
require - hardly graceful but until I've got a better solution I'm 
running with it - and hoping caching will make up for my shortcoming. 
It does work though.

So - can I do it? Can I have a loaded multiframed swf in a movieclip 
that I set to a frame, and then assign that frame out to a unique 
image, rinse/repeat allowing me to load the swf once and spit out all 
of its frames to unique displayobjects?

The groups input would be greatly appreciated - well - provided the 
input isn't read the help page for the x class to find that the x 
class entry in the documentation contains nothing other than TBD.

Cheers ladies and gents.





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[flexcoders] Timer problems - timer still firing once after timer is reset.

2006-03-22 Thread grae_hall
I'm having a bit of a problem with the Timer function. And I'm also a 
little unsure of the variable syntax to read the framerate of the 
application.

I've created a custom class to allow me to easily attach listeners and 
actions to components throughout my application in a centralised manner.

I've used a timer that's set to fire once per frame - which is worked 
out by dividing 1000 miliseconds by the application's framerate. 
Although at the moment I'm setting the framerate manually as I can't 
quite figure out how to reference the application framerate dynamically.

My main problem is - that after I call a timer.reset(); before the 
Timer has completed it's currentCount - the timer still fires one more 
time.

I've tried a few things - had a bit of a stab at using 
stopEventPropegation etc - but the syntax for that was odd and it never 
worked. I tried putting in a condition for timer.running before the 
actions I wanted to occur would be run - but the timer reports running 
as true for one instance after I reset - not as soon as I reset it.

My code is here - it's unfinished, and has had a few things stripped 
out for simplicities sake - but it should demonstrate what I'm trying 
to acheive.

override protected function createChildren():void {
timer = new Timer(singleFrame, eventCeil);
thisEventCeil = eventCeil;
addListeners();
}

private function addListeners() {
switch(listenerType) {
case mouse:
listenerTarget.hitArea = listenerHitArea;
listenerTarget.addEventListener
(MouseEvent.MOUSE_OUT, funcOutOverDown);
listenerTarget.addEventListener
(MouseEvent.MOUSE_OVER, funcOutOverDown);
timer.addEventListener(TimerEvent.TIMER, 
timerTick);
break;
case key:
trace(Key Listener Type);
break;
}
}

private function funcOutOverDown(event:Event):void {
thisEventType=event.type;
if (timer.running) {
timer.reset();
trace(terminated timer from event listener:  + 
lastEventVal);
lastEventFloor = thisEventFloor;
thisEventCeil = eventCeil - thisEventFloor;
}
switch(thisEventType) {
case mouseOut:
thisEventEaseCeil = 1;
thisEventFrom = 0;
thisEventTo = 1;
timerInit=true;
break;
case mouseOver:
thisEventEaseCeil = undefined;
thisEventTo = 1;
thisEventFrom = 0;
timerInit=true;
break;
}
if (timerInit) {
thisEventFloor = 0;
timerInit=false;
timer.start();
}
}

private function timerTick(timerEvent:TimerEvent) {
trace(timerEvent);
if (timer.running) {
thisEventFloor = timer.currentCount;
thisEventVal = EasingLib.easeInCirc
(thisEventFloor,thisEventFrom,thisEventTo,thisEventCeil,thisEventEaseCei
l);
lastEventVal = thisEventVal;
if (thisEventFloor = thisEventCeil) {
trace(completed timer:  + lastEventVal +   
+ thisEventFloor);
timer.reset();
lastEventFloor = thisEventFloor;
}
}
}

The problem is - if I get an out or over event before the timer is 
complete - which successfully resets the timer - it still passes the 
timer.running condition.

That's annoying me - and I'm really not sure how to stop it from 
occuring.

That's really the only problem I'm having at present with the code you 
see - everything else seems to behave as I require it. Before I can 
expand it out to cover more conditions and listeners I really need to 
get a handle on the timer's behaviour.

I figured that getting the timer to fire once a frame and then process 
my actions would be a nice non-CPU intensive way to handle my various 
actions, animations etc.

I'd appreciate any input.

Cheers.





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[flexcoders] Re: Timer problems - timer still firing once after timer is reset.

2006-03-22 Thread grae_hall
pretend I proof read that block of code which I copied and pasted out 
of my actual working class.

Pretend the thisEvent=eventCeil; line exists before I refer to 
eventCeil in my timer is instantiated.

Yeah... pretend.

--- In flexcoders@yahoogroups.com, grae_hall [EMAIL PROTECTED] wrote:

 I'm having a bit of a problem with the Timer function. And I'm also 
a 
 little unsure of the variable syntax to read the framerate of the 
 application.
 
 I've created a custom class to allow me to easily attach listeners 
and 
 actions to components throughout my application in a centralised 
manner.
 
 I've used a timer that's set to fire once per frame - which is 
worked 
 out by dividing 1000 miliseconds by the application's framerate. 
 Although at the moment I'm setting the framerate manually as I 
can't 
 quite figure out how to reference the application framerate 
dynamically.
 
 My main problem is - that after I call a timer.reset(); before the 
 Timer has completed it's currentCount - the timer still fires one 
more 
 time.
 
 I've tried a few things - had a bit of a stab at using 
 stopEventPropegation etc - but the syntax for that was odd and it 
never 
 worked. I tried putting in a condition for timer.running before the 
 actions I wanted to occur would be run - but the timer reports 
running 
 as true for one instance after I reset - not as soon as I reset it.
 
 My code is here - it's unfinished, and has had a few things 
stripped 
 out for simplicities sake - but it should demonstrate what I'm 
trying 
 to acheive.
 
 override protected function createChildren():void {
   timer = new Timer(singleFrame, eventCeil);
   thisEventCeil = eventCeil;
   addListeners();
 }
 
 private function addListeners() {
   switch(listenerType) {
   case mouse:
   listenerTarget.hitArea = listenerHitArea;
   listenerTarget.addEventListener
 (MouseEvent.MOUSE_OUT, funcOutOverDown);
   listenerTarget.addEventListener
 (MouseEvent.MOUSE_OVER, funcOutOverDown);
   timer.addEventListener(TimerEvent.TIMER, 
 timerTick);
   break;
   case key:
   trace(Key Listener Type);
   break;
   }
 }
 
 private function funcOutOverDown(event:Event):void {
   thisEventType=event.type;
   if (timer.running) {
   timer.reset();
   trace(terminated timer from event listener:  + 
 lastEventVal);
   lastEventFloor = thisEventFloor;
   thisEventCeil = eventCeil - thisEventFloor;
   }
   switch(thisEventType) {
   case mouseOut:
   thisEventEaseCeil = 1;
   thisEventFrom = 0;
   thisEventTo = 1;
   timerInit=true;
   break;
   case mouseOver:
   thisEventEaseCeil = undefined;
   thisEventTo = 1;
   thisEventFrom = 0;
   timerInit=true;
   break;
   }
   if (timerInit) {
   thisEventFloor = 0;
   timerInit=false;
   timer.start();
   }
 }
 
 private function timerTick(timerEvent:TimerEvent) {
   trace(timerEvent);
   if (timer.running) {
   thisEventFloor = timer.currentCount;
   thisEventVal = EasingLib.easeInCirc
 
(thisEventFloor,thisEventFrom,thisEventTo,thisEventCeil,thisEventEaseC
ei
 l);
   lastEventVal = thisEventVal;
   if (thisEventFloor = thisEventCeil) {
   trace(completed timer:  + lastEventVal 
+   
 + thisEventFloor);
   timer.reset();
   lastEventFloor = thisEventFloor;
   }
   }
 }
 
 The problem is - if I get an out or over event before the timer is 
 complete - which successfully resets the timer - it still passes 
the 
 timer.running condition.
 
 That's annoying me - and I'm really not sure how to stop it from 
 occuring.
 
 That's really the only problem I'm having at present with the code 
you 
 see - everything else seems to behave as I require it. Before I can 
 expand it out to cover more conditions and listeners I really need 
to 
 get a handle on the timer's behaviour.
 
 I figured that getting the timer to fire once a frame and then 
process 
 my actions would be a nice non-CPU intensive way to handle my 
various 
 actions, animations etc.
 
 I'd appreciate any input.
 
 Cheers.








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info

[flexcoders] Re: Timer problems - timer still firing once after timer is reset.

2006-03-22 Thread grae_hall
Well - fortunately the request for thoughts on the timer can be 
disregarded - I've managed to get it all working. The application now 
has a custom class able to be attached to any interface component which 
tweens from a user defined value to a user defined value with a user 
defined easing type. If related listener events are fired while a tween 
is in progress, the class tweens back from the current value to the 
destination value defined in the most recently fired listener - in the 
same number of frames it took to get to its current value.

I had no luck with this basic type of interface functionality using the 
native flex classes - which is a little disappointing.

I'm still having difficulties getting the value of the application 
framerate. So any tips there would be appreciated.






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[flexcoders] Re: Flip and mirror a bitmap in Flex

2006-03-19 Thread grae_hall
The issue is it doesn't have the image loaded completely and added as
an instance - so - you need to get a set of loader listeners for the
image happening - and then on the completion listener run the bitmap
reflect function.

If you embed the image - you should be sweet.

At least - that's what I remember. I haven't got Flex or Flashplayer
8.5 on this PC, so I can't be certain it's not already embeded. :D

I've got bitmap filters running on run-time loaded images using the
bitmap classes etc in an app I'm designing/developing at the moment -
so I know it works.

--- In flexcoders@yahoogroups.com, Michael Schmalle
[EMAIL PROTECTED] wrote:

 Hmm, I was using FireFox. Will have to try it in FB2.
 
 I wonder what the problem is? well, obviously it's that player! ;-)
 
 Peace, Mike
 
 On 3/16/06, Richard Schutten [EMAIL PROTECTED] wrote:
 
  In IE and Opera i couldn't see a reflection of the image but i did
see a
  reflection when i loaded the demo in Flex Builder !
 
  Richard
 
   -Original Message-
  *From:* flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED]
  Behalf Of *Michael Schmalle
  *Sent:* Thursday, March 16, 2006 1:54 PM
  *To:* flexcoders@yahoogroups.com
  *Subject:* Re: [flexcoders] Re: Flip and mirror a bitmap in Flex
 
  Is the image supposed to be reflected also? From the source it
looks like
  it. But, only the text and buttons are reflected.
 
  Peace, Mike
 
  On 3/15/06, Richie Rich [EMAIL PROTECTED] wrote:
  
   Hi Here is a example of what your looking for with sample code I
   believe.
  
  
   http://humanwasteland.com/reflectdemo/ReflectFilterDemo.html
  
   Have Fun,
  
   Rich
  
  
   --- In flexcoders@yahoogroups.com, Richard Schutten rs@ wrote:
   
Hi there,
   
Are there standard flip and mirror routines that can be applied in
   Flex 2
for bitmaps?
   
Greetings,
   
Richard
   
  
  
  
  
  
  
   --
   Flexcoders Mailing List
   FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
   Search Archives:
   http://www.mail-archive.com/flexcoders%40yahoogroups.com
  
  
  
   SPONSORED LINKS
 Web site design
developmenthttp://groups.yahoo.com/gads?t=msk=Web+site+design+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=L-4QTvxB_quFDtMyhrQaHQ
Computer
   software
developmenthttp://groups.yahoo.com/gads?t=msk=Computer+software+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=lvQjSRfQDfWudJSe1lLjHw
Software
   design and
developmenthttp://groups.yahoo.com/gads?t=msk=Software+design+and+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=1pMBCdo3DsJbuU9AEmO1oQ
 Macromedia
  
flexhttp://groups.yahoo.com/gads?t=msk=Macromedia+flexw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=OO6nPIrz7_EpZI36cYzBjw
Software
   development best
practicehttp://groups.yahoo.com/gads?t=msk=Software+development+best+practicew1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=f89quyyulIDsnABLD6IXIw
--
   YAHOO! GROUPS LINKS
  
  
  -  Visit your group
flexcodershttp://groups.yahoo.com/group/flexcoders
  on the web.
  
  -  To unsubscribe from this group, send an email to:
   
[EMAIL PROTECTED][EMAIL PROTECTED]
  
  -  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
  Service http://docs.yahoo.com/info/terms/.
  
  
--
  
 
 
 
  --
  What goes up, does come down.
 
   --
  Flexcoders Mailing List
  FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
 
 
 
   SPONSORED LINKS
Web site design
developmenthttp://groups.yahoo.com/gads?t=msk=Web+site+design+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=L-4QTvxB_quFDtMyhrQaHQ
 Computer
  software
developmenthttp://groups.yahoo.com/gads?t=msk=Computer+software+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=lvQjSRfQDfWudJSe1lLjHw
 Software
  design and

[flexcoders] Re: Flip and mirror a bitmap in Flex

2006-03-15 Thread grae_hall
Dearest Richard,

There's a demo of run time reflection of flex components by Trey Long 
located here  
http://humanwasteland.com/reflectdemo/ReflectFilterDemo.html

it's a good example of how to implement the bitmap, bitmapdata, and 
matrix classes in Flex 2.0

It's a bit technical - but you can view the source and download it.

As far as I'm aware - I've not seen a simplified flip/mirror function 
in Flex - the class that does the flip in that example is 
matrix.scale where he puts (1, -1).

Have a play around with it - I learned a bit from it.

--- In flexcoders@yahoogroups.com, Richard Schutten [EMAIL PROTECTED] wrote:

 Hi there,
 
 Are there standard flip and mirror routines that can be applied in 
Flex 2
 for bitmaps?
 
 Greetings,
 
 Richard








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[flexcoders] Looking for simple working Flex 2.0 remoting examples

2006-03-01 Thread grae_hall
The Flex project I'm working on is up to the stage of commencing 
initial communications from flex swf client to the business logic on 
the backend server. I've got a subcontractor working with me and I've 
handed him the task of getting the remoting functional.

Unfortunately we haven't been able to find any working examples of 
Flex 2.0 remoting.

The backend that we're tying our front end into is running WebOrb - 
we've seen a proof of concept in Flash of the client requesting 
methods on server classes through remoting and recieving objects and 
arrays as results returned from the server.

We're at least sure that we're connecting via AMF through Remoting, 
rather than SOAP, or an HTTP service.

We're just not sure where to start - or where to start researching - 
implementing the remoting functionality in Flex.

Grae







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[flexcoders] application MXML loading children component MXMLs

2006-02-28 Thread grae_hall
I'm writing the foundations of an ecommerce site in Flex. I've created 
an application MXML as the stub with the application tags - and I've 
created the major subsections as MXML components framed by canvas 
tags.

What's the best method of including the component MXML files so that 
data can be shared with relative ease throughout the application, 
whilst still allowing a modular stub/children structure?

I've had a bit of a tinker in the flex store - and it seems to use 
Actionscript to call the component MXMLs with a fileName.function() 
style method - I'm trying to toss up the easiest, quickest and most 
robust way of linking all of my separate bits together.

It's a bit of an amateur question :D






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[flexcoders] syntax / code hinting help for a custom classes 'type' variable

2006-02-27 Thread grae_hall
I'm extending the effects class to allow me to have a custom tag that 
can tween a component in a known and limited number of ways.

I'm not really sure what the correct syntax is to define those limited 
types of class methods.

Say my tween class allows you to tween the alpha, the scale, and the 
coordinates of a designated item on the stage.

So, I'm not sure how to define a variable in my class 
called tweenType so it consists of 3 potential values named alphaFX, 
scaleFX and coordFX, with one of them being a default.

I'd also like to be able to type myMX:effect tweenType=alphaFX... 
and it code hint the known values of the variable in the class.

I'm not really sure what sort object/variable is the correct one to use 
in AS3.

Any help would be greatly appreciated - etc.





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[flexcoders] Removing Default Halo Themes

2006-02-22 Thread grae_hall
I've tinkered around most of today - read quite a bit - and I'm not 
really sure if I'm on the right track.

In my default Flex app the components are obviously pre-styled with 
one of the Themes.

As part of a fairly interesting contract I'm working on - I'd like to 
specify the styles of my components myself - programmatically through 
stylesheets. I'm becoming more aware of how much I have to unstyle 
what seems to be the existing default theme.

For instance - with Flex Style Explorer, button components have a 
nice bevel. The manuals seem to indicate that the default theme 
doesn't allow you to control that aspect of the button component.

Ideally I'd like to create the styles either via stylesheets, or 
programmatically through the drawing API (although - lord knows I'm 
oblivious to the syntax required to take Kevin Hoyts accordian 
example and apply that style of director skinning to a button 
component).

Is there a way to set the themes to close to nill - so I can work my 
way up from there?

And - is there a decent example of succesful reskinning of a button 
component to be found on the interweb? After I crashed explorer by 
freestyling Kevin's Example and attempting to extend the button 
class - I'm cautious with how I'll proceed.

I'd prefer to work with the stylesheets and drawing API - I'd like to 
replicate this base button shape 
http://grae.halltech.com.au/media/ui_icon_ok.gif - and create my own 
custom button components which I can then pass glows, blurs, etc over.

I had a crack at the 9slice - the 9slice accordion skin prior to 
Kevin's demonstrated some issues with masking non-square shapes.

Here's hoping I'm on the right track.

- Grae





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/