[flexcoders] Connecting to swf dynamically in AS3
I'm trying simply, to load a series of seven small swfs (globes), i don't want them to play automatically. So, I assume I have to externalize and internalize play/stop methods, because I notice SWFLoader doesn't have play or stop methods. Sorry if I sound like a luddite in this area because this is the first time I've ever tried to access a swf using the system manager. I noticed that the init event doesn't trigger, so I am probably doing this wrong: var swf:SWFLoader = new SWFLoader(); swf.x = x-7; swf.id = globe+_swfIndex; swf.width=30; swf.height=30; swf.y = y-7; swf.scaleX=.5; swf.scaleY=.5; swf.filters = [new GlowFilter (0x4A88C6,1.0,8.0,8.0,2,3,false,false)]; swf.source = _globe; swf.addEventListener(Event.INIT,onSWFCreation); _myUIComponent.addChild(swf); makeLabel(x,y,s,u); _swfIndex++; ... private function onSWFCreation(e:Event){ trace (target,e.currentTarget.id); loadedSM = SystemManager(e.currentTarget.id.content); } Thanks,Patrick
[flexcoders] Slightly OFF Topic: Flash CS3
OK, in an actionscript 3 flash project, how do I do this? stop(); this.globe.play(); Basically, how do I do timeline commands? I'm a little confused how Flash CS3 works with AS3. I feel like it's the first time I used the program again. Thanks, Patrick
[flexcoders] Re: Connecting to swf dynamically in AS3
Ah, that was weird, by default it was publishing a flash 8 movie. It's been a while since I've been inside Flash (been using flex until cs3 cameout :) Are there any examples of how to access methods in Flash from Flex and best practices in creating new flash classes? Thanks, Patrick --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Are the globes Flex 2.x Apps? If they are Flash 8 swfs you may not get INIT. -Alex From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of patricklemiuex Sent: Thursday, June 07, 2007 11:56 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Connecting to swf dynamically in AS3 I'm trying simply, to load a series of seven small swfs (globes), i don't want them to play automatically. So, I assume I have to externalize and internalize play/stop methods, because I notice SWFLoader doesn't have play or stop methods. Sorry if I sound like a luddite in this area because this is the first time I've ever tried to access a swf using the system manager. I noticed that the init event doesn't trigger, so I am probably doing this wrong: var swf:SWFLoader = new SWFLoader(); swf.x = x-7; swf.id = globe+_swfIndex; swf.width=30; swf.height=30; swf.y = y-7; swf.scaleX=.5; swf.scaleY=.5; swf.filters = [new GlowFilter (0x4A88C6,1.0,8.0,8.0,2,3,false,false)]; swf.source = _globe; swf.addEventListener(Event.INIT,onSWFCreation); _myUIComponent.addChild(swf); makeLabel(x,y,s,u); _swfIndex++; ... private function onSWFCreation(e:Event){ trace (target,e.currentTarget.id); loadedSM = SystemManager(e.currentTarget.id.content); } Thanks,Patrick
[flexcoders] OK,
Alex thanks. Couple questions? Where is this flash integration kit? Is there a simple external shell class to start with this? What about accessing simple timeline controls? All I want to do is be able to tell my timeline in my loaded SWF to play. Thanks, Patrick
[flexcoders] Re: Accessing the illusive stage Object through sprite (a near impossible feat)
Michael, Thanks so much, where was that event hiding? I was using a hackish timer to do the job. However, your solution doesn't work from within the class that I create (haven't tried outside yet). Is there a way to do this all from inside the class I am using, or does the event listener have to sit outside the class? Really, I think it would have been better, but maybe it's not even possible to make the constructor function of classes automatically have access to the stage object on instantiation? Also, to trap keyboard events the only way I could make it works is the following: stage.focus = this.parent; this.stage.addEventListener(KeyboardEvent.KEY_DOWN,keyHandler); this.stage.addEventListener(KeyboardEvent.KEY_UP,keyHandler); --- In flexcoders@yahoogroups.com, Michael Schmalle [EMAIL PROTECTED] wrote: Hi, The stage object does not get defined until right at the end of the players init cycle. Try listening to the Sprites Event.ADDED_TO_STAGE event, then access the stage object. Peace, Mike On 5/31/07, patricklemiuex [EMAIL PROTECTED] wrote: Dear Actionscript wizards: I have an all as3.0 project. I can never seem to access the stage object (I've posted several times and never can get any appropriate solutions)? i thought this was automatic with every class that extends sprite... I get a null object reference trying to access the stage object. I must be doing something incorrectly, though I have studied this in a few places. public class AbstractSlideView extends Sprite { protected var _data:PictureProviderXML; //protected var _data:PictureProvider; private var _paramObj:Object; public function AbstractSlideView() { var timer:Timer = new Timer(1000,1); timer.addEventListener(TimerEvent.TIMER, installVars); timer.start(); this.stage.focus = this; this.addEventListener(KeyboardEvent.KEY_DOWN,keyHandler); this.addEventListener(KeyboardEvent.KEY_UP,keyHandler); } -- Teoti Graphix http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com You can find more by solving the problem then by 'asking the question'.
[flexcoders] quick object question
I have string, which is the id of my object. How do I convert my string name into the id property of my object?\ Why am I doing this you ask, because it's flashvars default that I want to access a certain panel when my app loads. Thanks, Patrick
[flexcoders] Custom Datatip Renderes for charts
I want to customize the datatip for my chart app. I notice things like dollar signs are removed when I try to use them in labelfunction etc. Is there an example of this out there. -want to make rounded corners -some alpha transparency -custom fonts colors
[flexcoders] SWF Size gets bigger (and bigger... but why??)
I noticed i changed about 4 lines of code in my app and then compiled - it went from 420K to 634K... So, I copied my MXML file into a new MXML File and then my compile size is back to normal? Does anyone know why this happens? Kinda sucks, yes? Thanks, Patrick
[flexcoders] Custom Datatip Renderes for charts
Ok, well I've gotten this far with my datatip renderer. It looks like all the chart classes call the graphics utilities class to draw the boring square box, no rounded rectangle method exists in this class. If I just roll my own rounded rectangle box inside my DataTipRenderer constructor, it hides the label... So it looks like i need to do is, first extend the graphicsutilities class and and then override the fillrect method to draw a rounded rectangle, finally extend each chart to use my new extended graphics utilities instead of the native one. Does that sound right? package com.me.data { import flash.display.Graphics; import flash.geom.Rectangle; import mx.charts.HitData; import mx.charts.chartClasses.DataTip; import mx.charts.chartClasses.GraphicsUtilities; import mx.graphics.IFill; import mx.graphics.RoundedRectangle; import mx.graphics.SolidColor; import mx.graphics.Stroke; import flash.display.Sprite; import mx.core.IDataRenderer public class CustomDataTip extends DataTip implements IDataRenderer { override protected function updateDisplayList(unscaledWidth:Number,unscaledHeight:Number):void { // super.updateDisplayList(unscaledWidth, unscaledHeight); var g:Graphics = graphics; var xpos:Number = 0; var ypos:Number = 0; //var fill:IFill = IFill(new SolidColor(getStyle(backgroundColor), 0.5)); //var stroke :Stroke= new Stroke(getStyle(borderColor), 0, 100); //GraphicsUtilities.fillRect(g, xpos, ypos, unscaledWidth,unscaledHeight, fill, stroke); var edit:Sprite = new Sprite(); edit.graphics.beginFill(getStyle(backgroundColor),.5); edit.graphics.drawRoundRect(xpos,ypos,unscaledWidth,unscaledHeight,6); edit.graphics.endFill(); addChild(edit); } } }
[flexcoders] ChartItemEvent Bug
I noticed a bug in double click events... i have a couple charts in my application, only one is getting the doubleclick event but I have created 3 of them. top20channelschart.addEventListener(ChartItemEvent.ITEM_DOUBLE_CLICK, getSnappData); tho, when I switch the line to top20channelschart.addEventListener(ChartItemEvent.ITEM_CLICK, getSnappData); it always works fine, unfortunately, what to do about making a double click event, roll my own? Thanks, Patrick
[flexcoders] MouseEvent.CLICK - TextField bugs - not receiving events - general bugs
I am a little beside myself because I have sprites and there are some bugs in Flashplayer that I've noticed about click events not being received with TextFields TextFormatter Objects added to sprites. I have a button and 2 out of 10 clicks, i don't receive a click event! It's like there's almost a dead spot where no clicking can be received? I even added a transparent layer to try to see if it is a depth issue. Has anyone come across this type of unexpected behavior? I know that I can't be the only programmer who has issues with this sort of thing? The only work around is to get a mouseDown and get an X Y point and determine mouse position? Any ideas? Questions: 1. Invisible parts of sprites should not stop click events from sprite underneath, correct? 2. Why does a TextField Object have an automatic 100 pixel tall height when none is specified. Why Does this ghost height invalidate clicks beneath? This is a bug, correct?
[flexcoders] SOLVED: MouseEvent.CLICK - TextField bugs - not receiving events - general bugs
This is all do to TextField boxes that are overlapping my button sprites. Personally, if a textfield is blank, I think the sprite underneath should allow MouseEvents from underneath, because in a sense an invisible area of a TextField should be like an invisible part of a sprite. Any one else have any input on this? Thanks, Patrick --- In flexcoders@yahoogroups.com, patricklemiuex [EMAIL PROTECTED] wrote: I am a little beside myself because I have sprites and there are some bugs in Flashplayer that I've noticed about click events not being received with TextFields TextFormatter Objects added to sprites. I have a button and 2 out of 10 clicks, i don't receive a click event! It's like there's almost a dead spot where no clicking can be received? I even added a transparent layer to try to see if it is a depth issue. Has anyone come across this type of unexpected behavior? I know that I can't be the only programmer who has issues with this sort of thing? The only work around is to get a mouseDown and get an X Y point and determine mouse position? Any ideas? Questions: 1. Invisible parts of sprites should not stop click events from sprite underneath, correct? 2. Why does a TextField Object have an automatic 100 pixel tall height when none is specified. Why Does this ghost height invalidate clicks beneath? This is a bug, correct?
[flexcoders] Charting Components - mx Series Zoom effect bug
I have some panels with resize effects, that pop up a chart. I notice on super long data results in my Area Chart that the animation doesn't tween and draw the chart completely
[flexcoders] Chart components, Continued - Mx Series Zoom effect issues not drawing all
(I just accidentally hit enter on yahoo and it posted my incomplete message, d'oh!) Here's my issue I have a panel that pops up on a resize effect... I have a chart on this panel with a lot of data, using an mx:SeriesZoom, sometimes the tween sets the floor not at 0, but at about 20 or thirty, refreshing the data it draws correctly the second time. I found a way around the issue by adding a startDelay to the the SeriesZoom, however, this produces the chart to draw once right away when it populates and then redraw when it animates after my starDelay of 500 milliseconds. I turned off the visibility of the area series, but the SeriesZoom doesn't automatically turn the visibility on when it starts, which is odd, shouldn't it? Ok, so if I can't seem to dispatch an event from the SeriesZoom and then try to get the event.currentTarget.visible=true;how do I make this animation work correctly? Thanks, Patrick
[flexcoders] OMFG, i am about to go crazy
So, I just launched this slide show today... And, I don't use the f*king crappy IE7. And one of the other developers is asking me why my buttons don't work... button clicks events seem to navigate the user to a url?? I am so frustrated because this makes me look like I am some kind of shitty developer. What the hell to do? I think adobe should sue Microshit!
[flexcoders] System Memory Bug - tracing output kicks an errror but not always
I have this exact line of code on two projects on my computer this works, on my work computer it kicks an error trace(Memory: ,flash.system.System.totalMemory/1024); Description ResourceIn Folder LocationCreation Time Id 2 1120: Access of undefined property flash. SimpleTween.as MeBucket3/com/me/views/typesline 531May 8, 2007 9:05:56 AM 283048 Thanks, Patrick
[flexcoders] Acessing stage Height
I have a sprite, it's added to the display... I understand that any display object has access to the stage Object. Can someone clear the confusion for me, what's the deal here, I get a null error trying to access the stage height... I've even tried to call another method after addChild to make sure that it's already in the display. My preloader extends sprite (of course). This is baffling. var _preloader = new _preloader(); addChild(_preloader); _preloader.getHeight(); inside my preloader... public function getHeight(){ trace (this.stage.stageHeight); //returns null object reference??? Thanks, Patrick
[flexcoders] Getting Index of Array Collection from current Mouse Position in areaChart
I can get the coordinates from Ely's example working, but instead of a plot chart, I am using an area Chart. Is it possible to get a reference to my arrayCollection inndex from a mouseover position? I'm trying to make a chart zoomble by mousing over the chart and holding the mouse over it... Thanks, Patrick
[flexcoders] Getting Index of Array Collection from current Mouse Position in areaChart
Forgive if you see this post, I haven't seen my post, post and I haven't seen a reply. Is it possible to get an index of an array collection from a mouseover on an area chart. Thanks, Patrick
[flexcoders] Adding Percent to the label field on the left
I created a column chart and I want to add a percent sign to each of the values on the verticalAxis. How do I do this? Thanks, Patrick
[flexcoders] Slightly Off Topic - AMFPHP 1.9 bug or something else is odd
Uncommenting out the commented line produces an error, where nothing is being returned to remoting. Any one have issues with this? foreach ($demos as $key =$props){ $value['demos'][$key] = $props; //$value['actualpercent'][$key] =int($props)*10; } Thanks, patrick
[flexcoders] Why does modifying an ArrayColleciton DataProvider reset headerRenderer?
Hey guys, I have this issue, I just got stopped by one of the people here and they didn't like the way I implemented a combobox in a custom headerRenderer. The issue is that, when you change the ArrayCollection that's binded to the dataGrid, it resets the combobox, as if it gets reinitialized. So the problem is I want to show the data of This Week by default, when the data is changed, this property changes, drops back to the first value of the combobox... So, I had to set a When in my combobox, but I don't want to do that it's not user friendly, I want to set this so the user can see the value of time, Week,Month etc. I'm using an example based on Ben Clinkinbeard's blog. Can anyone please explain how to avoid this? Why does this work this way? Any Help, this is something others have noted too... Patrick Lemiuex Like sands through the hourglass, these are the times of our compile.
[flexcoders] Removing focus from a dataGrid
Hi There, I posted this, and searched and still did not find an answer, I have multiple datagrids on the screen... Can you point me in the right direction of how to remove focus from the other while one is selected? Cheers, Hope you can help me. Patrick
[flexcoders] Re: Compile sizes of swf file getting bigger and bigger
This is not the answer to my problem, thanks tho. Patrick --- In flexcoders@yahoogroups.com, Daniel Wabyick [EMAIL PROTECTED] wrote: Make sure your swf files / extensions are marked as binary in CVS. It could be that its checking it in as ascii, which might explain the file size increase. patricklemiuex wrote: Any body notice the size of their swf files increasing after committing to a cvs server. I am having an issue where my swf file went from 490 to 1.7 meg. To fix this I have to check out my project into a new workspace. This happens every time I commit. Thanks, Patrick
[flexcoders] Re: how to draw over an image
Quite simply you can create a VBox, HBox or Canvas, add a SWFloader then add a UIcomponent to draw what you want, stacking order is all based on adding Children to the display object. Here's a sample of some code I used to add a horizontal Gradient Bar inside and HBox for a poll and quiz app... I hope this helps you out. Patrick var myUIComponent:UIComponent = new UIComponent; tileHolder.addChild(myUIComponent); var colors:Array = [0xFEAF39,0xFF9900]; var barHeight:Number = 25; var barWidth:Number = 270; if (leftMove==true) imageHolder.width = 0; if (leftMove!=true) barWidth = (barWidth - imageHolder.width); textHolder.width = barWidth; textHolder.maxWidth = barWidth; if (yesno==true) colors = [0xBD0202,0xFF]; if ((yesno==true)(i%2!=1)) colors = [0x009900,0x00FF00]; if (quiz==true) colors = [0xBD0202,0xFF]; if ((quiz==true)(setCorrect==true)) colors = [0x009900,0x00FF00]; var _backSprite:Sprite = new Sprite(); var matrix:Matrix = new Matrix(); matrix.createGradientBox(barWidth,barHeight,0,0,0); var alphasGrey:Array = [10,10]; var ratiosGrey:Array = [0x00,0xFF]; var colorsGrey:Array = [0xCC,0x66]; _backSprite.graphics.lineStyle(); _backSprite.graphics.beginGradientFill(GradientType.LINEAR,colorsGrey,alphas,ratiosGrey,matrix); _backSprite.graphics.drawRect(0,0,barWidth,barHeight+2); _backSprite.graphics.endFill(); _backSprite.alpha=.2; --- In flexcoders@yahoogroups.com, dodger6135396 [EMAIL PROTECTED] wrote: Using ActionScript3.0 and Flex2.0.1 I want to display an image /photograph. Then I want to draw shapes on top of this image, but I dont want to alter the image. For example the image would be located at x=0, y=0, width = 320 and height = 240, then at a Z order higher above the image a transparent something located at the same coordinates would allow the user to highlight parts of the image. Please is this even possible?. Is there a technique for doing this?. Thanks in anticipation.
[flexcoders] Caret on DataGrid, any help out tehre
I can't seem to figure out how to make the caret not show up on a datagrid... this one is driving me a little nuts, because it's the last issue with my project, why doesn't this work... any help out there on this one. Why does making the textbox selectable=false not handle this one. Thanks, Patrick mx:DataGrid id=dgNewest styleName=newestPolls dataProvider={newestAC} itemClick=itemClickEvent(event); width=200 height=145 top=8 left=7 verticalScrollPolicy=off mx:columns mx:DataGridColumn sortable=false editable=false headerRenderer={newestHeaderRenderer} mx:itemRenderer mx:Component mx:HBox horizontalScrollPolicy=off mx:Text id=pollNameNewest selectable=false truncateToFit=true width=190 text={data.poll}/ /mx:HBox /mx:Component /mx:itemRenderer /mx:DataGridColumn /mx:columns /mx:DataGrid
[flexcoders] Re: Caret on DataGrid, any help out there: SOLVED
I had an item alpha=0 on top with a textfield... Wow, the stupidest thing in the world... --- In flexcoders@yahoogroups.com, patricklemiuex [EMAIL PROTECTED] wrote: I can't seem to figure out how to make the caret not show up on a datagrid... this one is driving me a little nuts, because it's the last issue with my project, why doesn't this work... any help out there on this one. Why does making the textbox selectable=false not handle this one. Thanks, Patrick mx:DataGrid id=dgNewest styleName=newestPolls dataProvider={newestAC} itemClick=itemClickEvent(event); width=200 height=145 top=8 left=7 verticalScrollPolicy=off mx:columns mx:DataGridColumn sortable=false editable=false headerRenderer={newestHeaderRenderer} mx:itemRenderer mx:Component mx:HBox horizontalScrollPolicy=off mx:Text id=pollNameNewest selectable=false truncateToFit=true width=190 text={data.poll}/ /mx:HBox /mx:Component /mx:itemRenderer /mx:DataGridColumn /mx:columns /mx:DataGrid
[flexcoders] Security SandBox issue
Hi, I am going crazy again. I am having an issue with not being able to navigateTo A URL from our site... works fine if no www. is there, but with it I get a security sandbox violations issue. I'm loading a crossdomain policy and trying to allow the domain and everything - what to do? SecurityError: Error #2137: Security sandbox violation: http://me.com/_p/viewer/pollandquiz.swf?docId=-4935715412555856092 cannot navigate window _self within http://www.me.com/patrickdj/ (allowScriptAccess is ). Attempted URL was /_poll/takeit.php?pollid=1663. at global/flash.net::navigateToURL() at components::PutPoll/handlePutPoll() at components::PutPoll/__put_button_click()
[flexcoders] Re: Security SandBox issue SOLVED
Sorry, this stuff catches me, i forget about all the FUN SUPER FUN security... embed allowscriptaccess=always allownetworking=external -- In flexcoders@yahoogroups.com, patricklemiuex [EMAIL PROTECTED] wrote: Hi, I am going crazy again. I am having an issue with not being able to navigateTo A URL from our site... works fine if no www. is there, but with it I get a security sandbox violations issue. I'm loading a crossdomain policy and trying to allow the domain and everything - what to do? SecurityError: Error #2137: Security sandbox violation: http://me.com/_p/viewer/pollandquiz.swf?docId=-4935715412555856092 cannot navigate window _self within http://www.me.com/patrickdj/ (allowScriptAccess is ). Attempted URL was /_poll/takeit.php?pollid=1663. at global/flash.net::navigateToURL() at components::PutPoll/handlePutPoll() at components::PutPoll/__put_button_click()
[flexcoders] showCaret not on DataGrid
Hi there, I'm using a datagrid control, how do I set the showCaret property to false when mousing over to any item in my custom itemRenderer I'm a little confused because I see the listBase has the showCaret property but not the datagGrid. I don't want show any carets or have the selection tool viewable at all. Thanks, Patrick
[flexcoders] How do you not show the focused item in a datagrid
I have 4 of them on the screen at one time... how do I hide the selections from the other 3 when another has got focus. I just need a simple example. Thanks, Patrick
[flexcoders] Compile sizes of swf file getting bigger and bigger
Any body notice the size of their swf files increasing after committing to a cvs server. I am having an issue where my swf file went from 490 to 1.7 meg. To fix this I have to check out my project into a new workspace. This happens every time I commit. Thanks, Patrick
[flexcoders] EventDispatching Listening
I'm using bubbling, or at least i think i am to capture an event... I've extended the event class to make my own event mechanism. the events are being dispatched, however the problem is, that I'm adding an event listener to my custom mxml component to receive the events and nothing happens. I've probably got something backwards... Doesn't bubbling set to true allow the event to be captured by any component in the order that they are created? my code is as follows: var evt:MeEvent = new MeEvent(MeEvent.REMOTE,true); dispatchEvent(evt); --- package com.me { import flash.events.Event; public class MeEvent extends Event { public static const REMOTE:String = remote; public var realTarget:*; public function MeEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false) { super(type, bubbles, cancelable); } } } -- And inside my custom component this is the event listener. private function init():void{ this.addEventListener(MeEvent.REMOTE, handleEvent); } Thanks for your time, Patrick