Re: [flexcoders] flex and automation

2008-06-27 Thread Pascal Robert
It might work with a command-line browser (curl, wget)?

 There are no flex user groups in my area and I've been trying for a  
 long time to find a
 solution to this problem with no success.

 I need to generate a series of charts every few minutes/hours/days  
 on an automated basis. I
 pull the data for the charts from the database and draw the chart,  
 then save it as an image
 and potentially notify someone where they can find the image as a  
 png or a pdf.

 I am using java on the backend to communicate with the database and  
 flex to draw the
 charts. The same app which draws the chart can also be called by a  
 user to get a live
 snapshot. But the automation just isn't working. It works fine on my  
 local development
 machine, but this application is deployed on a headless server and  
 the flex process never
 gets to launch since it needs to run on a browser. I've looked at  
 solutions for getting it to
 run headless but so far I can't get it to work.

 Does anyone know how to automate flex in this way? I know flex is  
 meant to be interactive,
 but is there anyway I can still use the flex charting for automated  
 output?


 


---
Pascal Robert

http://www.macti.ca
http://www.linkedin.com/in/macti

Skype: MacTICanada
AIM/iChat : MacTICanada




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

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

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* 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] Web Service called two times in a row

2008-06-25 Thread Pascal Robert
Hello,

I'm trying to display videos (either FLV with On2 or H.264/AAC stuff)  
in a loop.  The idea is to fetch the first video by calling a Web  
service (SOAP) and when the video is done, I attach the complete  
event to a method that fetch the next video.  It work well for the  
first pass (first and second videos), but after the second video is  
complete, my Flex app call the Web services two times in a row, so  
instead of having the first video played back in full, it plays for a  
fraction of a second, and the second video is displayed.

The code at startup:

mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;  
backgroundColor=#00 layout=absolute  
creationComplete=setTimers()
...
mx:WebService id=service 
wsdl=http://localhost/cgi-bin/WebObjects/ServeurCalendrier.woa/-/ws/CalService?wsdl
 
 useProxy=false showBusyCursor=false
mx:operation name=loadVideos
mx:request xmlns=
ordre
{ordre}
/ordre
/mx:request
/mx:operation
/mx:WebService
...
public function setTimers():void {
service.loadVideos.send(new Number(0));
currentState = 'Video';
}

The video is displayed in a state:

mx:State name=Video
mx:AddChild position=lastChild
mx:Repeater id=videoRepetition  
dataProvider={service.loadVideos.lastResult}
mx:VideoDisplay id=boiteVideo  
source={videoRepetition.currentItem.url}  
complete=next(event.target.getRepeaterItem()) autoPlay=true /
/mx:Repeater
/mx:AddChild
/mx:State

And the method who is called on the complete() event:

public function next(anObject:Object):void {
service.loadVideos.send(anObject.ordre);
}

The Web service log:

juin 25 10:25:20 ServeurCalendrier[] (ERXNSLogLog4jBridge.java:40)  
INFO  NSLog  - 1 : http://localhost/calendriers/videos/WOWODC_Keynote2.flv
juin 25 10:25:56 ServeurCalendrier[] (ERXNSLogLog4jBridge.java:40)  
INFO  NSLog  - 2 : http://localhost/calendriers/videos/WOWODC_Keynote.flv
juin 25 10:26:41 ServeurCalendrier[] (ERXNSLogLog4jBridge.java:40)  
INFO  NSLog  - 1 : http://localhost/calendriers/videos/WOWODC_Keynote2.flv
juin 25 10:26:41 ServeurCalendrier[] (ERXNSLogLog4jBridge.java:40)  
INFO  NSLog  - 2 : http://localhost/calendriers/videos/WOWODC_Keynote.flv

So at 10:26:41, the Flex app is fetching both video #1 and #2, but #2  
should have been fetched at 10:27:17, and I don't know why :-/  Is  
this because it's the same video, and when I fetch them again, the  
runtime thinks that the videos are in the complete() state?

---
Pascal Robert

http://www.macti.ca
http://www.linkedin.com/in/macti

Skype: MacTICanada
AIM/iChat : MacTICanada