[flexcoders] Security sandbox violation on Bitmapdata.draw( rtmpVid ) despite crosspolicy.xml
Take a look at this video player; notice there is an image on screen before the video begins playback: http://www.huffingtonpost.com/2009/01/14/obama-on-inauguration- you_n_157881.html I'm trying to create similar 'preview frame' functionality in my own custom-built Flex/AS3-based RTMP video player... I need my the player to seek ahead to a given point in video, grab a snapshot for display as a preview frame, then seek back to the beginning before the user initiates playback... Or something like that. I've already got demo code (AS2) for taking a snapshot of a video after it has started playing. The problem is when I try to write code to do the same thing in my AS3 player, I get sandbox violation error as if I were running the demo SWF and my video player SWF on different servers. Both SWFs are in document folders on my computer... The RTMP host and I have confirmed that the permissions for using 'BitmapData.draw( obj )' on a video stream are in place (the demo works) so I've got no idea why I'm getting the sandbox violation error. Can anyone help me to get a snapshot of a video stream and then return the stream to the beginning before the user initiates playback? I've included the FLA for the demo in Flash CS4 and CS3 format: http://www.futurewebstudios.com/bitMapViewer2.zip The demo code is attached separately: --- import flash.display.BitmapData; var nc:NetConnection = new NetConnection(); var ns:NetStream; var myBitmapData:BitmapData = new BitmapData( 160, 120, false, 0x00CC ); var mc_1:MovieClip = this.createEmptyMovieClip( mc, this.getNextHighestDepth() ); btnCap.addEventListener( click, captureVid ); nc.connect( rtmp://okojcizj1r.rtmphost.com/vod ); //nc.connect( rtmp://localhost/vod ); nc.onStatus = function( p_o ) { var code = p_o.code; trace( code ); if ( code == NetConnection.Connect.Success ) { playLive(); } }; function playLive() { trace( playLive ); mc_1._x = 195; mc_1._y = 15; ns = new NetStream( nc ); myVideo.attachVideo( ns ); myVideo.attachAudio( ns ); ns.play( kaye_400 ); ns.onStatus = function( p_o ) { trace( p_o.code ); }; mc_1.attachBitmap( myBitmapData,this.getNextHighestDepth() ); } function captureVid() { trace( captureVid ); myBitmapData.draw( myVideo ); } --- I've also attached a piece of the code in my video player app so you can see what I'm trying to do; if you need to see more of the code, let me know and I'll send it to you: --- public function getScreenCaptureData( seekTime:Number, vidWidth:Number, vidHeight:Number ):Bitmap { var startAt:Number = _netStream.time; trace( this + getScreenCaptureData -- startAt: + startAt + , seekTime: + seekTime + , vidWidth: + vidWidth + , vidHeight: + vidHeight ); _netStream.seek( seekTime ); var tempVid:Video = new Video( vidWidth, vidHeight ); tempVid.attachNetStream( _netStream ); var bd:BitmapData = new BitmapData( vidWidth, vidHeight ); bd.draw( tempVid ); _netStream.seek( startAt ); //to be continued... return new Bitmap(); } --- Thanks in advance for your help.
[flexcoders] Re: Security sandbox violation on Bitmapdata.draw( rtmpVid ) despite crosspolicy
I am testing the video player Flex app over 'file:///C:/' but the Flash CS4 demo is technically on 'file:///C:/' as well. Both are in subdirectories of my desktop/document folder and both are trying to access the very same file over RTMP. Here's the official error from the video player: - Security sandbox violation: BitmapData.draw: file:///C:/.../bin- debug/BaseFLVPlayer.swf cannot access rtmp://.../vod/. No policy files granted access. at flash.display::BitmapData/draw() - I think I'm going test the video player SWF online instead of on my desktop. I don't think it will help but I've got no other ideas at this point. --- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: Are you testing this over http:// or file:// If file:// crossdomain.xml may not be in play. From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of jwebbsuccess Sent: Friday, January 16, 2009 11:50 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Security sandbox violation on Bitmapdata.draw( rtmpVid ) despite crosspolicy.xml Take a look at this video player; notice there is an image on screen before the video begins playback: http://www.huffingtonpost.com/2009/01/14/obama-on-inauguration- you_n_157881.html I'm trying to create similar 'preview frame' functionality in my own custom-built Flex/AS3-based RTMP video player... I need my the player to seek ahead to a given point in video, grab a snapshot for display as a preview frame, then seek back to the beginning before the user initiates playback... Or something like that. I've already got demo code (AS2) for taking a snapshot of a video after it has started playing. The problem is when I try to write code to do the same thing in my AS3 player, I get sandbox violation error as if I were running the demo SWF and my video player SWF on different servers. Both SWFs are in document folders on my computer... The RTMP host and I have confirmed that the permissions for using 'BitmapData.draw( obj )' on a video stream are in place (the demo works) so I've got no idea why I'm getting the sandbox violation error. Can anyone help me to get a snapshot of a video stream and then return the stream to the beginning before the user initiates playback? I've included the FLA for the demo in Flash CS4 and CS3 format: http://www.futurewebstudios.com/bitMapViewer2.zip The demo code is attached separately: --- import flash.display.BitmapData; var nc:NetConnection = new NetConnection(); var ns:NetStream; var myBitmapData:BitmapData = new BitmapData( 160, 120, false, 0x00CC ); var mc_1:MovieClip = this.createEmptyMovieClip( mc, this.getNextHighestDepth() ); btnCap.addEventListener( click, captureVid ); nc.connect( rtmp://okojcizj1r.rtmphost.com/vod ); //nc.connect( rtmp://localhost/vod ); nc.onStatus = function( p_o ) { var code = p_o.code; trace( code ); if ( code == NetConnection.Connect.Success ) { playLive(); } }; function playLive() { trace( playLive ); mc_1._x = 195; mc_1._y = 15; ns = new NetStream( nc ); myVideo.attachVideo( ns ); myVideo.attachAudio( ns ); ns.play( kaye_400 ); ns.onStatus = function( p_o ) { trace( p_o.code ); }; mc_1.attachBitmap( myBitmapData,this.getNextHighestDepth() ); } function captureVid() { trace( captureVid ); myBitmapData.draw( myVideo ); } --- I've also attached a piece of the code in my video player app so you can see what I'm trying to do; if you need to see more of the code, let me know and I'll send it to you: --- public function getScreenCaptureData( seekTime:Number, vidWidth:Number, vidHeight:Number ):Bitmap { var startAt:Number = _netStream.time; trace( this + getScreenCaptureData -- startAt: + startAt + , seekTime: + seekTime + , vidWidth: + vidWidth + , vidHeight: + vidHeight ); _netStream.seek( seekTime ); var tempVid:Video = new Video( vidWidth, vidHeight ); tempVid.attachNetStream( _netStream ); var bd:BitmapData = new BitmapData( vidWidth, vidHeight ); bd.draw( tempVid ); _netStream.seek( startAt ); //to be continued... return new Bitmap(); } --- Thanks in advance for your help.
[flexcoders] Re: Security sandbox violation on Bitmapdata.draw( rtmpVid ) despite crosspolicy
I tested the video player SWF online... Just as I thought; it didn't make a difference. I need to figure out how the Flash CS4/AS2 demo is able to successfully get a snapshot and why the Flex/AS3 video player is not. --- In flexcoders@yahoogroups.com, jwebbsuccess jw...@... wrote: I am testing the video player Flex app over 'file:///C:/' but the Flash CS4 demo is technically on 'file:///C:/' as well. Both are in subdirectories of my desktop/document folder and both are trying to access the very same file over RTMP. Here's the official error from the video player: - Security sandbox violation: BitmapData.draw: file:///C:/.../bin- debug/BaseFLVPlayer.swf cannot access rtmp://.../vod/. No policy files granted access. at flash.display::BitmapData/draw() - I think I'm going test the video player SWF online instead of on my desktop. I don't think it will help but I've got no other ideas at this point. --- In flexcoders@yahoogroups.com, Alex Harui aharui@ wrote: Are you testing this over http:// or file:// If file:// crossdomain.xml may not be in play. From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of jwebbsuccess Sent: Friday, January 16, 2009 11:50 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Security sandbox violation on Bitmapdata.draw( rtmpVid ) despite crosspolicy.xml Take a look at this video player; notice there is an image on screen before the video begins playback: http://www.huffingtonpost.com/2009/01/14/obama-on-inauguration- you_n_157881.html I'm trying to create similar 'preview frame' functionality in my own custom-built Flex/AS3-based RTMP video player... I need my the player to seek ahead to a given point in video, grab a snapshot for display as a preview frame, then seek back to the beginning before the user initiates playback... Or something like that. I've already got demo code (AS2) for taking a snapshot of a video after it has started playing. The problem is when I try to write code to do the same thing in my AS3 player, I get sandbox violation error as if I were running the demo SWF and my video player SWF on different servers. Both SWFs are in document folders on my computer... The RTMP host and I have confirmed that the permissions for using 'BitmapData.draw( obj )' on a video stream are in place (the demo works) so I've got no idea why I'm getting the sandbox violation error. Can anyone help me to get a snapshot of a video stream and then return the stream to the beginning before the user initiates playback? I've included the FLA for the demo in Flash CS4 and CS3 format: http://www.futurewebstudios.com/bitMapViewer2.zip The demo code is attached separately: --- import flash.display.BitmapData; var nc:NetConnection = new NetConnection(); var ns:NetStream; var myBitmapData:BitmapData = new BitmapData( 160, 120, false, 0x00CC ); var mc_1:MovieClip = this.createEmptyMovieClip( mc, this.getNextHighestDepth() ); btnCap.addEventListener( click, captureVid ); nc.connect( rtmp://okojcizj1r.rtmphost.com/vod ); //nc.connect( rtmp://localhost/vod ); nc.onStatus = function( p_o ) { var code = p_o.code; trace( code ); if ( code == NetConnection.Connect.Success ) { playLive(); } }; function playLive() { trace( playLive ); mc_1._x = 195; mc_1._y = 15; ns = new NetStream( nc ); myVideo.attachVideo( ns ); myVideo.attachAudio( ns ); ns.play( kaye_400 ); ns.onStatus = function( p_o ) { trace( p_o.code ); }; mc_1.attachBitmap( myBitmapData,this.getNextHighestDepth() ); } function captureVid() { trace( captureVid ); myBitmapData.draw( myVideo ); } --- I've also attached a piece of the code in my video player app so you can see what I'm trying to do; if you need to see more of the code, let me know and I'll send it to you: --- public function getScreenCaptureData( seekTime:Number, vidWidth:Number, vidHeight:Number ):Bitmap { var startAt:Number = _netStream.time; trace( this + getScreenCaptureData -- startAt: + startAt + , seekTime: + seekTime + , vidWidth: + vidWidth + , vidHeight: + vidHeight ); _netStream.seek( seekTime ); var tempVid:Video = new Video( vidWidth, vidHeight ); tempVid.attachNetStream( _netStream ); var bd:BitmapData = new BitmapData( vidWidth, vidHeight ); bd.draw( tempVid ); _netStream.seek( startAt ); //to be continued... return new Bitmap(); } --- Thanks in advance for your help.
[flexcoders] Security sandbox violation on Bitmapdata.draw( rtmpVid ) despite crosspolicy.xml
Take a look at this video player; notice there is an image on screen before the video begins playback: http://www.huffingtonpost.com/2009/01/14/obama-on-inauguration- you_n_157881.html I'm trying to create similar 'preview frame' functionality in my own custom-built Flex/AS3-based RTMP video player... I need my the player to seek ahead to a given point in video, grab a snapshot for display as a preview frame, then seek back to the beginning before the user initiates playback... Or something like that. I've already got demo code (AS2) for taking a snapshot of a video after it has started playing. The problem is when I try to write code to do the same thing in my AS3 player, I get sandbox violation error as if I were running the demo SWF and my video player SWF on different servers. Both SWFs are in document folders on my computer... The RTMP host and I have confirmed that the permissions for using 'BitmapData.draw( obj )' on a video stream are in place (the demo works) so I've got no idea why I'm getting the sandbox violation error. Can anyone help me to get a snapshot of a video stream and then return the stream to the beginning before the user initiates playback? I've included the FLA for the demo in Flash CS4 and CS3 format: http://www.futurewebstudios.com/bitMapViewer2.zip The demo code is attached separately: --- import flash.display.BitmapData; var nc:NetConnection = new NetConnection(); var ns:NetStream; var myBitmapData:BitmapData = new BitmapData( 160, 120, false, 0x00CC ); var mc_1:MovieClip = this.createEmptyMovieClip( mc, this.getNextHighestDepth() ); btnCap.addEventListener( click, captureVid ); nc.connect( rtmp://okojcizj1r.rtmphost.com/vod ); //nc.connect( rtmp://localhost/vod ); nc.onStatus = function( p_o ) { var code = p_o.code; trace( code ); if ( code == NetConnection.Connect.Success ) { playLive(); } }; function playLive() { trace( playLive ); mc_1._x = 195; mc_1._y = 15; ns = new NetStream( nc ); myVideo.attachVideo( ns ); myVideo.attachAudio( ns ); ns.play( kaye_400 ); ns.onStatus = function( p_o ) { trace( p_o.code ); }; mc_1.attachBitmap( myBitmapData,this.getNextHighestDepth() ); } function captureVid() { trace( captureVid ); myBitmapData.draw( myVideo ); } --- I've also attached a piece of the code in my video player app so you can see what I'm trying to do; if you need to see more of the code, let me know and I'll send it to you: --- public function getScreenCaptureData( seekTime:Number, vidWidth:Number, vidHeight:Number ):Bitmap { var startAt:Number = _netStream.time; trace( this + getScreenCaptureData -- startAt: + startAt + , seekTime: + seekTime + , vidWidth: + vidWidth + , vidHeight: + vidHeight ); _netStream.seek( seekTime ); var tempVid:Video = new Video( vidWidth, vidHeight ); tempVid.attachNetStream( _netStream ); var bd:BitmapData = new BitmapData( vidWidth, vidHeight ); bd.draw( tempVid ); _netStream.seek( startAt ); //to be continued... return new Bitmap(); } --- Thanks in advance for your help.
[flexcoders] Security sandbox violation on Bitmapdata.draw( rtmpVid ) despite crosspolicy.xml
Take a look at this video player; notice there is an image on screen before the video begins playback: http://www.huffingtonpost.com/2009/01/14/obama-on-inauguration- you_n_157881.html I'm trying to create similar 'preview frame' functionality in my own custom-built Flex/AS3-based RTMP video player... I need my the player to seek ahead to a given point in video, grab a snapshot for display as a preview frame, then seek back to the beginning before the user initiates playback... Or something like that. I've already got demo code (AS2) for taking a snapshot of a video after it has started playing. The problem is when I try to write code to do the same thing in my AS3 player, I get sandbox violation error as if I were running the demo SWF and my video player SWF on different servers. Both SWFs are in document folders on my computer... The RTMP host and I have confirmed that the permissions for using 'BitmapData.draw( obj )' on a video stream are in place (the demo works) so I've got no idea why I'm getting the sandbox violation error. Can anyone help me to get a snapshot of a video stream and then return the stream to the beginning before the user initiates playback? I've included the FLA for the demo in Flash CS4 and CS3 format: http://www.futurewebstudios.com/bitMapViewer2.zip The demo code is attached separately: --- import flash.display.BitmapData; var nc:NetConnection = new NetConnection(); var ns:NetStream; var myBitmapData:BitmapData = new BitmapData( 160, 120, false, 0x00CC ); var mc_1:MovieClip = this.createEmptyMovieClip( mc, this.getNextHighestDepth() ); btnCap.addEventListener( click, captureVid ); nc.connect( rtmp://okojcizj1r.rtmphost.com/vod ); //nc.connect( rtmp://localhost/vod ); nc.onStatus = function( p_o ) { var code = p_o.code; trace( code ); if ( code == NetConnection.Connect.Success ) { playLive(); } }; function playLive() { trace( playLive ); mc_1._x = 195; mc_1._y = 15; ns = new NetStream( nc ); myVideo.attachVideo( ns ); myVideo.attachAudio( ns ); ns.play( kaye_400 ); ns.onStatus = function( p_o ) { trace( p_o.code ); }; mc_1.attachBitmap( myBitmapData,this.getNextHighestDepth() ); } function captureVid() { trace( captureVid ); myBitmapData.draw( myVideo ); } --- I've also attached a piece of the code in my video player app so you can see what I'm trying to do; if you need to see more of the code, let me know and I'll send it to you: --- public function getScreenCaptureData( seekTime:Number, vidWidth:Number, vidHeight:Number ):Bitmap { var startAt:Number = _netStream.time; trace( this + getScreenCaptureData -- startAt: + startAt + , seekTime: + seekTime + , vidWidth: + vidWidth + , vidHeight: + vidHeight ); _netStream.seek( seekTime ); var tempVid:Video = new Video( vidWidth, vidHeight ); tempVid.attachNetStream( _netStream ); var bd:BitmapData = new BitmapData( vidWidth, vidHeight ); bd.draw( tempVid ); _netStream.seek( startAt ); //to be continued... return new Bitmap(); } --- Thanks in advance for your help.
[flexcoders] Security sandbox violation on Bitmapdata.draw( rtmpVid ) despite crosspolicy.xml
Take a look at this video player; notice there is an image on screen before the video begins playback: http://www.huffingtonpost.com/2009/01/14/obama-on-inauguration- you_n_157881.html I'm trying to create similar 'preview frame' functionality in my own custom-built Flex/AS3-based RTMP video player... I need my the player to seek ahead to a given point in video, grab a snapshot for display as a preview frame, then seek back to the beginning before the user initiates playback... Or something like that. I've already got demo code (AS2) for taking a snapshot of a video after it has started playing. The problem is when I try to write code to do the same thing in my AS3 player, I get sandbox violation error as if I were running the demo SWF and my video player SWF on different servers. Both SWFs are in document folders on my computer... The RTMP host and I have confirmed that the permissions for using 'BitmapData.draw( obj )' on a video stream are in place (the demo works) so I've got no idea why I'm getting the sandbox violation error. Can anyone help me to get a snapshot of a video stream and then return the stream to the beginning before the user initiates playback? I've included the FLA for the demo in Flash CS4 and CS3 format: http://www.futurewebstudios.com/bitMapViewer2.zip The demo code is attached separately: --- import flash.display.BitmapData; var nc:NetConnection = new NetConnection(); var ns:NetStream; var myBitmapData:BitmapData = new BitmapData( 160, 120, false, 0x00CC ); var mc_1:MovieClip = this.createEmptyMovieClip( mc, this.getNextHighestDepth() ); btnCap.addEventListener( click, captureVid ); nc.connect( rtmp://okojcizj1r.rtmphost.com/vod ); //nc.connect( rtmp://localhost/vod ); nc.onStatus = function( p_o ) { var code = p_o.code; trace( code ); if ( code == NetConnection.Connect.Success ) { playLive(); } }; function playLive() { trace( playLive ); mc_1._x = 195; mc_1._y = 15; ns = new NetStream( nc ); myVideo.attachVideo( ns ); myVideo.attachAudio( ns ); ns.play( kaye_400 ); ns.onStatus = function( p_o ) { trace( p_o.code ); }; mc_1.attachBitmap( myBitmapData,this.getNextHighestDepth() ); } function captureVid() { trace( captureVid ); myBitmapData.draw( myVideo ); } --- I've also attached a piece of the code in my video player app so you can see what I'm trying to do; if you need to see more of the code, let me know and I'll send it to you: --- public function getScreenCaptureData( seekTime:Number, vidWidth:Number, vidHeight:Number ):Bitmap { var startAt:Number = _netStream.time; trace( this + getScreenCaptureData -- startAt: + startAt + , seekTime: + seekTime + , vidWidth: + vidWidth + , vidHeight: + vidHeight ); _netStream.seek( seekTime ); var tempVid:Video = new Video( vidWidth, vidHeight ); tempVid.attachNetStream( _netStream ); var bd:BitmapData = new BitmapData( vidWidth, vidHeight ); bd.draw( tempVid ); _netStream.seek( startAt ); //to be continued... return new Bitmap(); } --- Thanks in advance for your help.
[flexcoders] Why Isn't MouseEvent.ROLL_OVER/OUT Firing Consistantly? I Just Want to Toggle!
I working on a VideoScreen component, which at this point just extends UIComponent and contains a Video object as its first child. After the Video is added to the stage, I create an overlay using a Sprite object. The overlay isn't added to the stage until the user does a MouseEvent.ROLL_OVER the VideoScreen component. The overlay is removed from the stage on MouseEvent.ROLL_OUT. The problem here is that sometimes the MouseEvent.ROLL_OVER doesn't fire, which throws the toggle off (ROLL_OUT will add the overlay to the stage instead of removing it). Can you help me figure this out? Here is some of my debugging output; in this case the error happens just after COUNT 2 where two 'ROLL_OUT' events are fired without a 'ROLL_OVER' between them: --VideoScreen mouseRollOverOutListener COUNT: 1 (Odd numbers should always be MouseEvent type='rollOver') [MouseEvent type=rollOver bubbles=false cancelable=false eventPhase=2 localX=16 localY=62 stageX=16 stageY=62 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] Showing overlay (expecting FALSE)... _isShowingOverlay current value: false Overlay should now be TRUE _isShowingOverlay: true VideoScreen mouseRollOverOutListener COUNT: 2 (Odd numbers should always be MouseEvent type='rollOver') [MouseEvent type=rollOut bubbles=false cancelable=false eventPhase=2 localX=-1 localY=-1 stageX=-1 stageY=-1 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] Hiding overlay (expecting TRUE)... _isShowingOverlay current value: true Overlay should now be FALSE _isShowingOverlay: false VideoScreen mouseRollOverOutListener COUNT: 3 (Odd numbers should always be MouseEvent type='rollOver') [MouseEvent type=rollOut bubbles=false cancelable=false eventPhase=2 localX=-1 localY=-1 stageX=-1 stageY=-1 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] Showing overlay (expecting FALSE)... _isShowingOverlay current value: false Overlay should now be TRUE _isShowingOverlay: true VideoScreen mouseRollOverOutListener COUNT: 4 (Odd numbers should always be MouseEvent type='rollOver') [MouseEvent type=rollOver bubbles=false cancelable=false eventPhase=2 localX=2 localY=69 stageX=2 stageY=69 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] Hiding overlay (expecting TRUE)... _isShowingOverlay current value: true Overlay should now be FALSE _isShowingOverlay: false VideoScreen mouseRollOverOutListener COUNT: 5 (Odd numbers should always be MouseEvent type='rollOver') [MouseEvent type=rollOut bubbles=false cancelable=false eventPhase=2 localX=-1 localY=-1 stageX=-1 stageY=-1 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] Showing overlay (expecting FALSE)... _isShowingOverlay current value: false Overlay should now be TRUE _isShowingOverlay: true VideoScreen mouseRollOverOutListener COUNT: 6 (Odd numbers should always be MouseEvent type='rollOver') [MouseEvent type=rollOver bubbles=false cancelable=false eventPhase=2 localX=8 localY=78 stageX=8 stageY=78 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] Hiding overlay (expecting TRUE)... _isShowingOverlay current value: true Overlay should now be FALSE _isShowingOverlay: false -- Here is the VideoScreen; just place it in a project sub-folder called 'controls' and use it as MXML: controls:VideoScreen id=videoScreen width=300 height=225 fixDistortion=true / package com.futurewebstudios.controls { import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; import flash.media.Video; import flash.net.NetStream;import mx.core.UIComponent; import mx.events.FlexEvent; public class VideoScreen extends UIComponent { //--\ // Private properties //--\ private const DEFAULT_WIDTH:Number = 320; private const DEFAULT_HEIGHT:Number = 240; private var _video:Video; private var _videoIsDistorted:Boolean; private var _overlay:Sprite; private var _isShowingOverlay:Boolean; private var _overlayShowCount:uint = 1; private var _stream:NetStream; private var _streamIsChanged:Boolean; //changes to true once set, to false after used private var _maintainAspectRatio:Boolean; //needs no boolean state value; handled on property change //--\ // Public properties //--\ [Bindable( event=videoIsDistortedChanged )] [Inspectable( defaultValue=false )] public function set fixDistortion( value:Boolean ):void {if ( _videoIsDistorted != value ){ _videoIsDistorted = value;} } public function get fixDistortion():Boolean {
[flexcoders] Re: How Do I Programatically Make Flash Movie's Stage Expand Over its Container
Thanks for your help. I got the effect working to my expectations with your suggestion. I made the Flash movie's height the size that I wanted it to expand to, then I used JavaScript to toggle the height of the movie's container div back and forth between the 'hidden' state and the 'revealed' state height. Rock on. --- In flexcoders@yahoogroups.com, fotis.chatzinikos [EMAIL PROTECTED] wrote: It is usually done but setting the wmode to transparent (or simething similar cannot remember - google for it) instead of opaque (flash objects in an html page are rendered on top of everything else this way) --- In flexcoders@yahoogroups.com, Paul Andrews paul@ wrote: - Original Message - From: jwebbsuccess jwebb@ To: flexcoders@yahoogroups.com Sent: Sunday, October 19, 2008 11:58 PM Subject: [flexcoders] How Do I Programatically Make Flash Movie's Stage Expand Over its Container Div? http://www.futurewebstudios.com/clientspace/OMCC/ohpws_preview/index.p hp In the animation on the page above, notice the toy soldier spinning the candy cane. The candy cane gets cut off by the bottom of the stage as it spins. I'd like to grow the stage height to reveal the whole candy cane as it spins, then shink it back to it's starting height once the cane stops spinning. Does anyone know how to make the flash movie expand over the HTML div it is contained inside without changing the div's size? I've seen Flash ads on websites like Yahoo.com and Huffingtonpost.com where mousing over the ad makes the ad expand to an arbitrary size without moving any of the page elements, as if the flash movie suddenly overlaps the rest of the page. Once you mouseout, the movie returns to its original size/state inside the div. I think the movie is always at the full size, but has a transparent background. Then you just mask the contents and change the size of the mask.. I've already got the code that fires an event when the toy solider starts and stops the spin. Now I need the code to resize the animation without without moving any HTML elements. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f- b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Re: Why is This Video Showing Up Distorted in my FLV Player?
Just a little clean up here... I figured out why the video was distorted. When playing an FLV inside a player that has a width and height smaller than the FLV's default sizes, you must set the video.smoothing property to true. If you are using a player component that does not expose the video object, you have to go into the component's source somehow or build your own player. I chose the latter and had success. --- In flexcoders@yahoogroups.com, jwebbsuccess [EMAIL PROTECTED] wrote: Thanks for reading. I'm using an open source video player found here: http://www.fxcomponents.com/flex-video-player/ http://www.fxcomponents.com/flex-video-player/ The video in this player shows up distorted even though I've verified that maintainAspectRatio is set to true, the ratio between the FLV default size (360 x 270) and the video screen size (300 x 225) has been preserved. This player is calling an FLV on a separate server. http://www.law.com/jsp/nylj/PubArticleNY.jsp? hubtype=TopStoriesid=12024\ 25167541 http://www.law.com/jsp/nylj/PubArticleNY.jsp? hubtype=TopStoriesid=1202\ 425167541 The player below is displaying the same FLV file. In this case, the player is playing an FLV on the same server: http://www.gcnewyork.com/display.php/file=/video/nyljStory10 http://www.gcnewyork.com/display.php/file=/video/nyljStory10 Do you have any idea on what I have to do to make the 1st player's playback crystal clear like the 2nd player?
[flexcoders] How Do I Programatically Make Flash Movie's Stage Expand Over its Container Div?
http://www.futurewebstudios.com/clientspace/OMCC/ohpws_preview/index.p hp In the animation on the page above, notice the toy soldier spinning the candy cane. The candy cane gets cut off by the bottom of the stage as it spins. I'd like to grow the stage height to reveal the whole candy cane as it spins, then shink it back to it's starting height once the cane stops spinning. Does anyone know how to make the flash movie expand over the HTML div it is contained inside without changing the div's size? I've seen Flash ads on websites like Yahoo.com and Huffingtonpost.com where mousing over the ad makes the ad expand to an arbitrary size without moving any of the page elements, as if the flash movie suddenly overlaps the rest of the page. Once you mouseout, the movie returns to its original size/state inside the div. I've already got the code that fires an event when the toy solider starts and stops the spin. Now I need the code to resize the animation without without moving any HTML elements.
[flexcoders] Re: How Do I Programatically Make Flash Movie's Stage Expand Over its Container
I don't think that's the case. When I've seen those ads - like the UPS Brown ad for example, I've been able to select the HTML elements surrounding the Flash div just like normal HTML. If the Flash movie overlapped the other HTML elements to begin with, you wouldn't be able to select the text underneath it, transparent or not. Any other ideas? --- In flexcoders@yahoogroups.com, Paul Andrews [EMAIL PROTECTED] wrote: - Original Message - From: jwebbsuccess [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Sunday, October 19, 2008 11:58 PM Subject: [flexcoders] How Do I Programatically Make Flash Movie's Stage Expand Over its Container Div? http://www.futurewebstudios.com/clientspace/OMCC/ohpws_preview/index.p hp In the animation on the page above, notice the toy soldier spinning the candy cane. The candy cane gets cut off by the bottom of the stage as it spins. I'd like to grow the stage height to reveal the whole candy cane as it spins, then shink it back to it's starting height once the cane stops spinning. Does anyone know how to make the flash movie expand over the HTML div it is contained inside without changing the div's size? I've seen Flash ads on websites like Yahoo.com and Huffingtonpost.com where mousing over the ad makes the ad expand to an arbitrary size without moving any of the page elements, as if the flash movie suddenly overlaps the rest of the page. Once you mouseout, the movie returns to its original size/state inside the div. I think the movie is always at the full size, but has a transparent background. Then you just mask the contents and change the size of the mask.. I've already got the code that fires an event when the toy solider starts and stops the spin. Now I need the code to resize the animation without without moving any HTML elements. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469- 446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Why is This Video Showing Up Distorted in my FLV Player?
Thanks for reading. I'm using an open source video player found here: http://www.fxcomponents.com/flex-video-player/ http://www.fxcomponents.com/flex-video-player/ The video in this player shows up distorted even though I've verified that maintainAspectRatio is set to true, the ratio between the FLV default size (360 x 270) and the video screen size (300 x 225) has been preserved. This player is calling an FLV on a separate server. http://www.law.com/jsp/nylj/PubArticleNY.jsp?hubtype=TopStoriesid=12024\ 25167541 http://www.law.com/jsp/nylj/PubArticleNY.jsp?hubtype=TopStoriesid=1202\ 425167541 The player below is displaying the same FLV file. In this case, the player is playing an FLV on the same server: http://www.gcnewyork.com/display.php/file=/video/nyljStory10 http://www.gcnewyork.com/display.php/file=/video/nyljStory10 Do you have any idea on what I have to do to make the 1st player's playback crystal clear like the 2nd player?
[flexcoders] Re: Why Doesn't This JavaScript Regular Expression Work in AS3?
Josh, You're pretty awesome off the top of your head. Your change works. Thanks a bunch. Do you have a general statement about the difference between JS and AS3 regular expressions by chance? --- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote: Off the top of my head: var regex = /^true,\s*\$/; result = regex.test(str); On Mon, Aug 11, 2008 at 3:54 AM, jwebbsuccess [EMAIL PROTECTED]wrote: Exactly, haykelbj. What I need help with is rewriting the regular expression for the isCurrency test so that the strings true,$ or true, $ will return true in AS3. I'm not so hot at writing regexps... isCurrency returns true on those two strings in JavaScript; I don't know why they return false in AS3. --- In flexcoders@yahoogroups.com, haykelbj haykelbj@ wrote: The JavaScript and ActionScript codes are not doing exactly the same thing. In your AS code, at a certain point you are doing the following assignment: _testValue = qualifier.toLowerCase()+ ,$; This will result in _testValue = true,$ which will make the test isCurrency.test(_testValue) return false which is right because isCurrency's regex is /^, ?\$/. --- In flexcoders@yahoogroups.com, jwebbsuccess jwebb@ wrote: I have a regular expression that works in JavaScript and does not work in ActionScript 3, even though both languages supposedly use the ECMAScript standard for regular expressions. I need the expression to return true when ever it tests the two strings below: true,$ true, $ I need the expression to return false whenever the string is not the same as one of the two above. I've attached the HTML that demonstrates that the regular expressions work in JavaScript. Can you modify the same expressions in the Flex code, provided below, to produce the same result? Thanks. --- html head style type=text/css #doc {background-color:#EFEFEF;text-align:center;} #testBlock {background-color:#FF;text-align:left;width:600px;height:500px;margin: 0 auto;border:1px solid #FF9900;padding:0 20px;} .regexp {color:#FF;} .testval {color:#00CC00;} /style /head body id=doc div id=testBlock h1 id=test1/h1 h1 id=test2/h1 h1 id=testValue/h1 pThe only two true values should be true,$ and true, $; everything else should be false./p script type=text/javascript //TEST YOUR REGULAR EXPRESSIONS HERE. var re1 = /^true\b(.*)$/; var re2 = /^, ?\$/; var str = true,$; //THE VALUES USED IN YOUR TESTS WILL APPEAR IN THE PAGE... document.getElementById( test1 ).innerHTML = Regular Expression 1: span class='regexp' + re1 + /span; document.getElementById( test2 ).innerHTML = Regular Expression 1: span class='regexp' + re2 + /span; document.getElementById( testValue ).innerHTML = Test Value: span class='testval' + str + /span; if ( ( resultArray = re1.exec( str ) ) != null ) { alert( Test 1 successful ); if ( re2.test( resultArray[ 1 ] ) ) { alert( Test 2 successful ); } else { alert( Test 2 failed ); } } /script /div /body /html --- ?xml version=1.0? !-- wrapper/GetURLInfo.mxml -- mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; creationComplete=runRegExpTest( event ) mx:Script ![CDATA[ import mx.events.FlexEvent; import mx.controls.Alert; [Bindable] private var _test1:String = ; [Bindable] private var _test2:String = ; [Bindable] private var _testValue:String = ; private function runRegExpTest( e:FlexEvent ):void { var isTrue:RegExp =/^true\b(.*)$/; var isCurrency:RegExp =/^, ?\$/; var qualifier:String = TRUE; _test1 = isTrue.toString(); _test2 = isCurrency.toString(); var msg1:String; var msg2:String; if ( isTrue.test( qualifier.toLowerCase() ) ) { _testValue = qualifier.toLowerCase()+ ,$; msg1 = The qualifier is: + qualifier.toLowerCase() + , the test value is ( + _testValue + ) and returns: + isCurrency.test( _testValue ).toString(); trace( msg1 ); Alert.show( msg1 ); if ( isCurrency.test( _testValue ) ) { msg2 = The test is SUCCESSFUL!; trace
[flexcoders] Re: Why Doesn't This JavaScript Regular Expression Work in AS3?
Exactly, haykelbj. What I need help with is rewriting the regular expression for the isCurrency test so that the strings true,$ or true, $ will return true in AS3. I'm not so hot at writing regexps... isCurrency returns true on those two strings in JavaScript; I don't know why they return false in AS3. --- In flexcoders@yahoogroups.com, haykelbj [EMAIL PROTECTED] wrote: The JavaScript and ActionScript codes are not doing exactly the same thing. In your AS code, at a certain point you are doing the following assignment: _testValue = qualifier.toLowerCase()+ ,$; This will result in _testValue = true,$ which will make the test isCurrency.test(_testValue) return false which is right because isCurrency's regex is /^, ?\$/. --- In flexcoders@yahoogroups.com, jwebbsuccess jwebb@ wrote: I have a regular expression that works in JavaScript and does not work in ActionScript 3, even though both languages supposedly use the ECMAScript standard for regular expressions. I need the expression to return true when ever it tests the two strings below: true,$ true, $ I need the expression to return false whenever the string is not the same as one of the two above. I've attached the HTML that demonstrates that the regular expressions work in JavaScript. Can you modify the same expressions in the Flex code, provided below, to produce the same result? Thanks. --- html head style type=text/css #doc {background-color:#EFEFEF;text-align:center;} #testBlock {background-color:#FF;text-align:left;width:600px;height:500px;margin: 0 auto;border:1px solid #FF9900;padding:0 20px;} .regexp {color:#FF;} .testval {color:#00CC00;} /style /head body id=doc div id=testBlock h1 id=test1/h1 h1 id=test2/h1 h1 id=testValue/h1 pThe only two true values should be true,$ and true, $; everything else should be false./p script type=text/javascript //TEST YOUR REGULAR EXPRESSIONS HERE. var re1 = /^true\b(.*)$/; var re2 = /^, ?\$/; var str = true,$; //THE VALUES USED IN YOUR TESTS WILL APPEAR IN THE PAGE... document.getElementById( test1 ).innerHTML = Regular Expression 1: span class='regexp' + re1 + /span; document.getElementById( test2 ).innerHTML = Regular Expression 1: span class='regexp' + re2 + /span; document.getElementById( testValue ).innerHTML = Test Value: span class='testval' + str + /span; if ( ( resultArray = re1.exec( str ) ) != null ) { alert( Test 1 successful ); if ( re2.test( resultArray[ 1 ] ) ) { alert( Test 2 successful ); } else { alert( Test 2 failed ); } } /script /div /body /html --- ?xml version=1.0? !-- wrapper/GetURLInfo.mxml -- mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; creationComplete=runRegExpTest( event ) mx:Script ![CDATA[ import mx.events.FlexEvent; import mx.controls.Alert; [Bindable] private var _test1:String = ; [Bindable] private var _test2:String = ; [Bindable] private var _testValue:String = ; private function runRegExpTest( e:FlexEvent ):void { var isTrue:RegExp =/^true\b(.*)$/; var isCurrency:RegExp =/^, ?\$/; var qualifier:String = TRUE; _test1 = isTrue.toString(); _test2 = isCurrency.toString(); var msg1:String; var msg2:String; if ( isTrue.test( qualifier.toLowerCase() ) ) { _testValue = qualifier.toLowerCase()+ ,$; msg1 = The qualifier is: + qualifier.toLowerCase() + , the test value is ( + _testValue + ) and returns: + isCurrency.test( _testValue ).toString(); trace( msg1 ); Alert.show( msg1 ); if ( isCurrency.test( _testValue ) ) { msg2 = The test is SUCCESSFUL!; trace( msg2 ); Alert.show( msg2 ); } else { msg2 = The 'isCurrency' RegExp is UNSUCCESSFUL; trace( msg2 ); Alert.show( msg2 ); } } } ]] /mx:Script mx:Form color=#FCFCFC cornerRadius=10 borderStyle=outset backgroundColor=#FAF7F7 mx:FormItem label='isTrue' regular expression test: fontSize=18 color=#00 mx:Label text={ _test1 } fontSize=18 color=#BF5100 fontWeight=bold/ /mx:FormItem
[flexcoders] Why Doesn't This JavaScript Regular Expression Work in AS3?
I have a regular expression that works in JavaScript and does not work in ActionScript 3, even though both languages supposedly use the ECMAScript standard for regular expressions. I need the expression to return true when ever it tests the two strings below: true,$ true, $ I need the expression to return false whenever the string is not the same as one of the two above. I've attached the HTML that demonstrates that the regular expressions work in JavaScript. Can you modify the same expressions in the Flex code, provided below, to produce the same result? Thanks. --- html head style type=text/css #doc {background-color:#EFEFEF;text-align:center;} #testBlock {background-color:#FF;text-align:left;width:600px;height:500px;margin: 0 auto;border:1px solid #FF9900;padding:0 20px;} .regexp {color:#FF;} .testval {color:#00CC00;} /style /head body id=doc div id=testBlock h1 id=test1/h1 h1 id=test2/h1 h1 id=testValue/h1 pThe only two true values should be true,$ and true, $; everything else should be false./p script type=text/javascript //TEST YOUR REGULAR EXPRESSIONS HERE. var re1 = /^true\b(.*)$/; var re2 = /^, ?\$/; var str = true,$; //THE VALUES USED IN YOUR TESTS WILL APPEAR IN THE PAGE... document.getElementById( test1 ).innerHTML = Regular Expression 1: span class='regexp' + re1 + /span; document.getElementById( test2 ).innerHTML = Regular Expression 1: span class='regexp' + re2 + /span; document.getElementById( testValue ).innerHTML = Test Value: span class='testval' + str + /span; if ( ( resultArray = re1.exec( str ) ) != null ) { alert( Test 1 successful ); if ( re2.test( resultArray[ 1 ] ) ) { alert( Test 2 successful ); } else { alert( Test 2 failed ); } } /script /div /body /html --- ?xml version=1.0? !-- wrapper/GetURLInfo.mxml -- mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; creationComplete=runRegExpTest( event ) mx:Script ![CDATA[ import mx.events.FlexEvent; import mx.controls.Alert; [Bindable] private var _test1:String = ; [Bindable] private var _test2:String = ; [Bindable] private var _testValue:String = ; private function runRegExpTest( e:FlexEvent ):void { var isTrue:RegExp =/^true\b(.*)$/; var isCurrency:RegExp =/^, ?\$/; var qualifier:String = TRUE; _test1 = isTrue.toString(); _test2 = isCurrency.toString(); var msg1:String; var msg2:String; if ( isTrue.test( qualifier.toLowerCase() ) ) { _testValue = qualifier.toLowerCase()+ ,$; msg1 = The qualifier is: + qualifier.toLowerCase() + , the test value is ( + _testValue + ) and returns: + isCurrency.test( _testValue ).toString(); trace( msg1 ); Alert.show( msg1 ); if ( isCurrency.test( _testValue ) ) { msg2 = The test is SUCCESSFUL!; trace( msg2 ); Alert.show( msg2 ); } else { msg2 = The 'isCurrency' RegExp is UNSUCCESSFUL; trace( msg2 ); Alert.show( msg2 ); } } } ]] /mx:Script mx:Form color=#FCFCFC cornerRadius=10 borderStyle=outset backgroundColor=#FAF7F7 mx:FormItem label='isTrue' regular expression test: fontSize=18 color=#00 mx:Label text={ _test1 } fontSize=18 color=#BF5100 fontWeight=bold/ /mx:FormItem mx:FormItem label='isCurrency' regular expression test: fontSize=18 color=#00 mx:Label text={ _test2 } fontSize=18 color=#BF5100 fontWeight=bold/ /mx:FormItem mx:FormItem label='test value is: fontSize=18 color=#00 mx:Label text={ _testValue } fontSize=18 color=#BF5100 fontWeight=bold/ /mx:FormItem /mx:Form /mx:Application
[flexcoders] Re: Firefox Bug -- Top-level Floating Flash Div Appears BELOW Page-Based Flash Div
Anyone out there have a clue? --- In flexcoders@yahoogroups.com, jwebbsuccess [EMAIL PROTECTED] wrote: I don't know why this is happening. I have two HTML DIVs, each one containing a dynamically generated Flash movie. One of them is part of the page layout and the other floats onto the screen above the layout. The floating DIV should always be on top but it is not. The two Flash movies seem to swap depths as they redraw themselves, which creates a weired overlap issue. This happens even though I've set the z-index on both of the target HTML DIVs. I've included text from my HTML page and it's JS and CSS support files. The JS is set to stop the Flash movie from appearing if the user has seen the ad once that day so clear your cache and cookies for each test. Thanks for your help. --- html !-- To deploy the Interstitial Ad solution, transfer the script and link tags from the header, the body tag's 'onLoad' statement, and the 'INTERSTITIAL AD SECTION' to the page where the ad should appear. Next, make sure the 'interstitial.js' and the 'interstitial.css' files are referenced from the script and link tags, respectively. -- script type=text/javascript src=src/interstitial.js/script link rel=stylesheet type=text/css href=src/interstitial.css / titleIA Test (HTML/External Scripts)/title /head body onLoad=if (showAd) appear(); div style=margin-top:100; margin-left:100;z-index:1; !-- This is the link to the remote OAS ad tag -- script type=text/javascript document.write('scr'+'ipt language=JavaScript type=text/javascript src=http://oascentral.law.com/RealMedia/ads/adstream_jx.ads/intersti tial.law.com/IHC/@x96/scr'+'ipt'); /script /div !-- INTERSTITIAL AD SECTION -- div id=floatingflash style=top:-400px;left:-150px;margin-left:45%;z-index:100; !-- This is the close button that appears over generated/visible ads -- div id=hideButtonTab a id=hideButton href=javascript:disappear ();Close [ X ]/a /div !-- This is the link to the remote OAS ad tag -- script type=text/javascript if ( userHasNotSeenAd() ) { showAd = true; document.write('scr'+'ipt language=JavaScript type=text/javascript src=http://oascentral.law.com/RealMedia/ads/adstream_jx.ads/intersti tial.law.com/IHC/@x96/scr'+'ipt'); !-- Wait one second after call to ad tag, then test size of floatingflash div -- setTimeout('showHideButtonIfAdScheduled()', 1000 ); } /script /div !-- END INTERSTITIAL AD -- /body /html ---src/interstitial.css-- #floatingflash { position:absolute; display: block; } a#hideButton { /* Display property is changed to from 'none' to 'block' upon triggering the 'showHideButtonIfAdScheduled()' function */ display: none; float: right; height: 16px; border: 1px solid #00; /* black */ padding-top: 1px; padding-right: 8px; padding-bottom: 1px; padding-left: 5px; color: #00; background-color:#CC; font-size: 11px; font-family: Arial, Verdana, Helvetica, sans-serif; font-weight: 600; text-decoration: none; text-align: left; } a#hideButton:hover { color: #2080AF; background-color:#CC; } #hideButtonTab { width: 100%; position: absolute; top: -18px; } ---src/interstitial.js-- var timeout; var showAd = false; /* -- COOKIE LOGIC -- */ function cookiesEnabled() { Set_Cookie( 'test', 'none', '', '/', '', '' ); /* If Get_Cookie succeeds, cookies are enabled, since the cookie was successfully created. */ if ( Get_Cookie( 'test' ) ) { cookie_set = true; Delete_Cookie('test', '/', ''); } else { document.write( 'cookies are not currently enabled.' ); cookie_set = false; } return cookie_set; } function setQuestCookie() { Set_Cookie(questFlash,already seen,24,/,,); } function Set_Cookie( name, value, expires, path, domain, secure ) { // set time, it's in milliseconds var today = new Date(); today.setTime( today.getTime() ); /* if the expires variable is set, make the correct expires time, the current script below ( expires = expires * 1000 * 60 * 60 * 24 ) will set 'expires' for 'X' number of days; to make it set for hours, delete * 24, for minutes, delete * 60 * 24 */ if ( expires ) { expires = expires * 1000 * 60 * 60; } var expires_date = new Date( today.getTime() + (expires
[flexcoders] Firefox Bug -- Top-level Floating Flash Div Appears BELOW Page-Based Flash Div
I don't know why this is happening. I have two HTML DIVs, each one containing a dynamically generated Flash movie. One of them is part of the page layout and the other floats onto the screen above the layout. The floating DIV should always be on top but it is not. The two Flash movies seem to swap depths as they redraw themselves, which creates a weired overlap issue. This happens even though I've set the z-index on both of the target HTML DIVs. I've included text from my HTML page and it's JS and CSS support files. The JS is set to stop the Flash movie from appearing if the user has seen the ad once that day so clear your cache and cookies for each test. Thanks for your help. --- html !-- To deploy the Interstitial Ad solution, transfer the script and link tags from the header, the body tag's 'onLoad' statement, and the 'INTERSTITIAL AD SECTION' to the page where the ad should appear. Next, make sure the 'interstitial.js' and the 'interstitial.css' files are referenced from the script and link tags, respectively. -- script type=text/javascript src=src/interstitial.js/script link rel=stylesheet type=text/css href=src/interstitial.css / titleIA Test (HTML/External Scripts)/title /head body onLoad=if (showAd) appear(); div style=margin-top:100; margin-left:100;z-index:1; !-- This is the link to the remote OAS ad tag -- script type=text/javascript document.write('scr'+'ipt language=JavaScript type=text/javascript src=http://oascentral.law.com/RealMedia/ads/adstream_jx.ads/interstitial.law.com/IHC/@x96;/scr'+'ipt'); /script /div !-- INTERSTITIAL AD SECTION -- div id=floatingflash style=top:-400px;left:-150px;margin-left:45%;z-index:100; !-- This is the close button that appears over generated/visible ads -- div id=hideButtonTab a id=hideButton href=javascript:disappear();Close [ X ]/a /div !-- This is the link to the remote OAS ad tag -- script type=text/javascript if ( userHasNotSeenAd() ) { showAd = true; document.write('scr'+'ipt language=JavaScript type=text/javascript src=http://oascentral.law.com/RealMedia/ads/adstream_jx.ads/interstitial.law.com/IHC/@x96;/scr'+'ipt'); !-- Wait one second after call to ad tag, then test size of floatingflash div -- setTimeout('showHideButtonIfAdScheduled()', 1000 ); } /script /div !-- END INTERSTITIAL AD -- /body /html ---src/interstitial.css-- #floatingflash { position:absolute; display: block; } a#hideButton { /* Display property is changed to from 'none' to 'block' upon triggering the 'showHideButtonIfAdScheduled()' function */ display: none; float: right; height: 16px; border: 1px solid #00; /* black */ padding-top: 1px; padding-right: 8px; padding-bottom: 1px; padding-left: 5px; color: #00; background-color:#CC; font-size: 11px; font-family: Arial, Verdana, Helvetica, sans-serif; font-weight: 600; text-decoration: none; text-align: left; } a#hideButton:hover { color: #2080AF; background-color:#CC; } #hideButtonTab { width: 100%; position: absolute; top: -18px; } ---src/interstitial.js-- var timeout; var showAd = false; /* -- COOKIE LOGIC -- */ function cookiesEnabled() { Set_Cookie( 'test', 'none', '', '/', '', '' ); /* If Get_Cookie succeeds, cookies are enabled, since the cookie was successfully created. */ if ( Get_Cookie( 'test' ) ) { cookie_set = true; Delete_Cookie('test', '/', ''); } else { document.write( 'cookies are not currently enabled.' ); cookie_set = false; } return cookie_set; } function setQuestCookie() { Set_Cookie(questFlash,already seen,24,/,,); } function Set_Cookie( name, value, expires, path, domain, secure ) { // set time, it's in milliseconds var today = new Date(); today.setTime( today.getTime() ); /* if the expires variable is set, make the correct expires time, the current script below ( expires = expires * 1000 * 60 * 60 * 24 ) will set 'expires' for 'X' number of days; to make it set for hours, delete * 24, for minutes, delete * 60 * 24 */ if ( expires ) { expires = expires * 1000 * 60 * 60; } var expires_date = new Date( today.getTime() + (expires) ); document.cookie = name + = +escape( value ) + ( ( expires ) ? ;expires= + expires_date.toGMTString() : ) + ( ( path ) ? ;path= + path : )
Re: FW: [flexcoders] Custom Component not Responding to Event Dispatch - Can You
BTW everyone, I forgot to here's what the app looks like before any data is displayed: http://pdfserver.amlaw.com/Production/WebApp/view/pages/APTI/myaccountprofiledemo.html I'm only expecting data to display on first page at this point. As you see in the example, the display pods on the first page of the application are empty; no text fields appear inside them. Brian, do the text fields show up after you compile the project on your side? I'll wait for your screenshots. --- In flexcoders@yahoogroups.com, Dealy, Brian [EMAIL PROTECTED] wrote: Hi, I put your zip file into my flex builder and ran it under debug after commenting out a few imports i did not have and which it did not seem to need, but it ran and seems to dispatch ok for me. I put breakpoints on the event handlers and they were reched and I snapped what the screen looks like, etc. (not sure if attachments will work here, email me and I will send them direct). here are screen snaps of what it looked like and the debug showing the contents after a handler was called. the only thing I noticed that I had a problem with is Flex Builder complained about the XML files in the project as some had an or a '/ in them. I removed them before running... practiceArea.xml was one (if not the only one) I hope this helps. Brian Brian Dealy Vice President - Technology SAIC Technical Fellow Science Application International Corp. San Diego, CA 858-826-4457 [EMAIL PROTECTED] From: [EMAIL PROTECTED] oo.com [mailto:[EMAIL PROTECTED] oups.yahoo.com] On Behalf Of jwebbsuccess Sent: Monday, January 07, 2008 11:43 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Custom Component not Responding to Event Dispatch - Can You Help Me Debug? I'm developing a custom component called 'DisplayPod' that is supposed to build its internal controls based on an event. Once the application's 'front controller' parses external application data into different categories, it notifies all instances of the DisplayPod custom component through event dispatching. The custom event type that is dispatched, called DisplayPodEvent, has different names; each name correlates to one of the parsed categories. If an instance-level property in the DisplayPod matches the event name, the component will build itself accordingly (the component's child-level controls are determined by the associated category so it is designed to build its controls for any of the categories it has been pre-set to dipslay). The problem is that the DisplayPod is not responding to the event dispatch, even though it is clearly listening for that event. When I debug the app, I get the following output: [SWF] C:\...\Flex Builder 3\MyAccountFlexDemo\bin-debug\MyAccountFlexDemo.swf - 1,271,036 bytes after decompression The displayProfile Display Pod is listenting. The displayAccessInfo Display Pod is listenting. The displayContactInfo Display Pod is listenting. Dispatching... All 5 DisplayPodEvents have been dispatched. The DisplayPod instances have been preset with their own names to match the available DisplayPodEvents... The DisplayPod instances have successfully attached the appropriate event listener function (via 'addEventListener()' )... The FrontController has dispatched all of the versions of the DisplayPodEvent as required... Additionally, I've registered the DisplayPod custom component with each of the DisplayPodEvent names through a metadata tag. With all these factors considered, I don't understand why the DisplayPod's listener function isn't triggered after the FrontController does its event dispatch. Can you help me figure why this isn't happening as it should and how to trigger the listener function? Thanks. I've included a code sample in this thread and I've placed the entire app here: http://www.futurewebstudios.com/flex_src.zip Here's the code where the dispatch is taking place; this should REPLACE the file of the same name in the zip file as it is more current: package controller { import flash.events.Event; import flash.events.EventDispatcher; import flash.net.URLLoader; import flash.net.URLLoaderDataFormat; import flash.net.URLRequest; import mx.core.Application; import mx.events.FlexEvent; import model.ApplicationDataModel; import model.data.User; import events.DisplayPodEvent; /* The FrontController class is the centralized location for event handling in the application. */ public class FrontController extends EventDispatcher { /* Class-level properties */ public static const XML_DATA_SOURCE:String = model/database/xml/; /* Instance
[flexcoders] Custom Component not Responding to Event Dispatch - Can You Help Me Debug?
I'm developing a custom component called 'DisplayPod' that is supposed to build its internal controls based on an event. Once the application's 'front controller' parses external application data into different categories, it notifies all instances of the DisplayPod custom component through event dispatching. The custom event type that is dispatched, called DisplayPodEvent, has different names; each name correlates to one of the parsed categories. If an instance-level property in the DisplayPod matches the event name, the component will build itself accordingly (the component's child-level controls are determined by the associated category so it is designed to build its controls for any of the categories it has been pre-set to dipslay). The problem is that the DisplayPod is not responding to the event dispatch, even though it is clearly listening for that event. When I debug the app, I get the following output: [SWF] C:\...\Flex Builder 3\MyAccountFlexDemo\bin-debug\MyAccountFlexDemo.swf - 1,271,036 bytes after decompression The displayProfile Display Pod is listenting. The displayAccessInfo Display Pod is listenting. The displayContactInfo Display Pod is listenting. Dispatching... All 5 DisplayPodEvents have been dispatched. The DisplayPod instances have been preset with their own names to match the available DisplayPodEvents... The DisplayPod instances have successfully attached the appropriate event listener function (via 'addEventListener()' )... The FrontController has dispatched all of the versions of the DisplayPodEvent as required... Additionally, I've registered the DisplayPod custom component with each of the DisplayPodEvent names through a metadata tag. With all these factors considered, I don't understand why the DisplayPod's listener function isn't triggered after the FrontController does its event dispatch. Can you help me figure why this isn't happening as it should and how to trigger the listener function? Thanks. I've included a code sample in this thread and I've placed the entire app here: http://www.futurewebstudios.com/flex_src.zip Here's the code where the dispatch is taking place; this should REPLACE the file of the same name in the zip file as it is more current: package controller { import flash.events.Event; import flash.events.EventDispatcher; import flash.net.URLLoader; import flash.net.URLLoaderDataFormat; import flash.net.URLRequest; import mx.core.Application; import mx.events.FlexEvent; import model.ApplicationDataModel; import model.data.User; import events.DisplayPodEvent; /* The FrontController class is the centralized location for event handling in the application. */ public class FrontController extends EventDispatcher { /* Class-level properties */ public static const XML_DATA_SOURCE:String = model/database/xml/; /* Instance-level properties */ private var _app:MyAccountFlexDemo = Application.application as MyAccountFlexDemo; [Bindable] private var _dataModel:ApplicationDataModel = ApplicationDataModel.getInstance(); /* Class constructor */ public function FrontController():void { _app.addEventListener( FlexEvent.CREATION_COMPLETE, onCreationComplete ); } /* Instance-level methods */ private function onCreationComplete( e:FlexEvent ):void { var usersXmlLoader:URLLoader = new URLLoader(); usersXmlLoader.dataFormat = URLLoaderDataFormat.TEXT; usersXmlLoader.addEventListener( Event.COMPLETE, onUsersXMLLoadComplete ); usersXmlLoader.load( new URLRequest( XML_DATA_SOURCE + users.xml ) ); var accessInfoXmlLoader:URLLoader = new URLLoader(); accessInfoXmlLoader.dataFormat = URLLoaderDataFormat.TEXT; accessInfoXmlLoader.addEventListener( Event.COMPLETE, onAccessInfoXMLLoadComplete ); accessInfoXmlLoader.load( new URLRequest( XML_DATA_SOURCE + dpAccessInfoForm.xml ) ); var contactInfoXmlLoader:URLLoader = new URLLoader(); contactInfoXmlLoader.dataFormat = URLLoaderDataFormat.TEXT; contactInfoXmlLoader.addEventListener( Event.COMPLETE, onContactInfoXMLLoadComplete ); contactInfoXmlLoader.load( new URLRequest( XML_DATA_SOURCE + dpContactInfoForm.xml ) ); var passwordEditXmlLoader:URLLoader = new URLLoader(); passwordEditXmlLoader.dataFormat = URLLoaderDataFormat.TEXT; passwordEditXmlLoader.addEventListener( Event.COMPLETE, onPasswordEditXMLLoadComplete ); passwordEditXmlLoader.load( new URLRequest( XML_DATA_SOURCE + dpPasswordEditForm.xml ) ); var profileXmlLoader:URLLoader = new URLLoader();