Re: [Flashcoders] Decorator Pattern - removing a decorator
it only gets worse :) This is a nice read too: http://www.moserware.com/2008/03/what-does-it-take-to-become-grandmaster.html On Thu, Mar 20, 2008 at 11:08 PM, Jiri Heitlager [EMAIL PROTECTED] wrote: Steven, thanks for that helpfull reply. It is funny becuase I was just thinking about the dualism, on the one hand there are these wonderfull elegant design patterns that supposed to make things easier and on the other hand it seems like coding has just became harder ever since when I started applying them. Knowing about them seems sometimes almost a burden. But the absolute elegance of how they can be used, which is reflected in the many articles and books on them, just makes me want to understand them better. And as you say, applying them and failing horribly is a perfect way to get to know their individual intrisic workings. Strategy is the one that I am just now looking into, because the Decorator and the possibilty of not removing them just doesnt make them suitable for the behaviour I was after on that level. I have something like this now. var item = new Item() item.executeModifier() { modifier.execute(item.mc) } item.setModifier(modifier) this.modifier = modifier item.setClip(mc) this.mc = mc Then I will use the Decorator pattern, for decorating (what else) the items. It so happens that some Items contain text that can be edited. class ItemTextDecorator implements itemInterface{ _item:Iteminterface function ItemTextDecorator(item:Iteminterface) { _item = item } function executeModifier() { _item.executeModifier(_item.mc) } function setModifier(modifier) { _item.setModifier(modifier) } function.setClip(mc) this.mc = mc //additional function to set Text and edit text } It feels beautiful to piece things together like this :) Just understand that you won't understand until you code yourself into a corner a few times. :) When will it end, if ever? What you're experiencing is premature enlightenment. - Tyler Durden The Gang of Four specifically warns about this, and it's important to acknowledge that it's happening. When people first learn about design patterns, they will immediately begin looking for places to apply them. They will do this and fail in some particular way, and in doing so, learn more about that design pattern or perhaps one that they don't know of, yet. The issue most people have is trying to solve a problem with a design pattern they just learned without understanding that it isn't an appropriate pattern. But, you have to do it wrong in order to learn why. Prepare to fail and learn from those failures. It will make you a better coder. Your initial hunch is that your problem would best be solved by the Decorator pattern, but it very well may not be. The Decorator pattern has fallen out of favor in recent years, as many people believe it violates good OOP practices. It has its uses, but they're limited. You should continue coding this using Decorator if you like, so you can discover what its limitations are. It sounds like you're already hitting them. It's possible that Strategy and Composition might be useful here, as well. Just understand that you won't understand until you code yourself into a corner a few times. :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] reparent child to halt scroll
noone have the time to look at this one? On 20 Mar 2008, at 15:25, Allandt Bik-Elliott (Receptacle) wrote: hi guys i'm a bit stuck with a project i'm working on. I have a timeline which all runs off a scrollbar similar to the one in the kirupa forum (http://www.kirupa.com/forum/showthread.php?t=245468 - amended to go horizontal and us Tweener to act a bit more smoothly) at the moment, i have 2 sprites, 1 scrolls with the scrollbar and 1 doesn't. on the scrolling sprite i have several panels and the start of some ticks plus a mask for the non-scrolling textfield which is on the other sprite everything works as it should with this, however - i'd like to push it a bit further so that the title (mainTitle) scrolls with the rest of the panels but when it hits the left hand side, it reparents to the non-scrolling sprite and stays there you can see an example of this at http://www.bbc.co.uk/history/ british/launch_tl_british.shtml - which i think is a really elegant solution to the problem of overlong panels, designed to take several points of interest i've tried having everything on the scrollable sprite and moving the title backwards using a SliderEvent (custom event for the scrollbar) but the globalToLocal() method just gets really jumpy and doesn't seem to put the titles in the right place or return them correctly this is my class: CODE package { //package imports import flash.display.Sprite; //scrollbar imports import com.caurina.transitions.*; import flash.geom.*; import flash.events.*; import flash.text.TextFormat; import com.receptacle.utils.*; internal class TimelineArea extends Sprite { // class variable declarations private var cp:CommonProperties; private var taTitleBarY; private var taPanelY:uint; private var taPanelHeight:uint private var scrollableBase:Sprite; private var scrollbar:Scrollbar private var stage_width:uint; private var stage_height:uint; private var panelY:uint; private var panelColour:uint; private var taTitleBarHeight:uint; private var nonScrollableBase:Sprite; private var commonGrey:uint; private var subheadingFont:String; private var headingFont:String; // constructor public function TimelineArea():void { setVars(); addTicks(); addPanels(); addPeriodBars(); addImageLandmark(); initialiseTimelineScrollBar(); } private function setVars() { scrollbar = new Scrollbar(); cp = new CommonProperties(); stage_width = cp.stage_width; stage_height = cp.stage_height; taTitleBarHeight = cp.taTitleBarHeight; taTitleBarY = cp.taTitleBarY; taPanelY = cp.taPanelY; taPanelHeight= cp.taPanelHeight; commonGrey = cp.tickColour; headingFont = cp.headingFont; subheadingFont = cp.subheadingFont; scrollbar.x = 16; scrollbar.y = 550-cp.titleBarHeight; scrollableBase = new Sprite(); nonScrollableBase = new Sprite(); scrollableBase.y = 0; addChild(scrollableBase); addChild(nonScrollableBase); } private function addPanels():void { trace (Background panels added); createPanel(0, 1000, 0xB6, Prehistory, c. 1.7 million - 4000 B.C.E.); createPanel(1000, 2000, 0xB65B00, Early Civilisations, c. 1.7 million - 4000 B.C.E.); createPanel(3000, 2000, 0x123456, Sumfink Else, c. 1.7 million - 4000 B.C.E.); } private function createPanel(panelX:Number, panelWidth:int, panelColour:uint, pTitle:String, date:String):void { // SimpleRectangle class (rColour:uint, rOutlineColour:uint, rX:Number, rY:Number, rWidth:uint, rHeight:uint) var mainTitlePanel:SimpleRectangle = new SimpleRectangle (0xFF, panelColour, panelX, 0, panelWidth, taTitleBarHeight);
[Flashcoders] AS2: Tweening a very large vector file causes shaking
Hi, so this is a very odd problem, but I'm tweening an extremely large vector file (about 4000x4000px), using the Fuse tween classes. Its basically your standard slide across the surface of a massive object from point to point effect, nothing fancy. But I'm having a bear of a time getting it to animate smoothly. In particular, as it eases into and out of tweens, I'm getting a weird jittering of the MC, so that it stutters to a stop, like a car with bad brakes. The tweens themselves are nothin fancy (see below). It seems like the problem started when I added _rotation to the the mix. The file is vector, imported from AI. is anyone familiar with this problem? Any recommendations for handling this sort of basic (or so I thought) effect? thanks, .m - function slideToPos(){ var xPos = posArray[active][0]; var yPos = posArray[active][1]; var rPos = posArray[active][2]; active++; mainpanel_mc.tween(_x,xPos,2,easeInOutSine); mainpanel_mc.tween(_y,yPos,2.5,easeInOutSine); mainpanel_mc.tween(_rotation,rPos,2.5,easeInOutSine,null,slideToPos2()); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS2: Tweening a very large vector file causes shaking
Hi Matt, Like the analogies :) What tweening engine are you using? If its your engine, there is a good speed comparison here: http://blog.greensock.com/tweening-speed-test/ If so, just change to a different engine, not every car is build to move boulders ;) Sid On Mar 21, 2008, at 2:57 PM, Matt S. wrote: Hi, so this is a very odd problem, but I'm tweening an extremely large vector file (about 4000x4000px), using the Fuse tween classes. Its basically your standard slide across the surface of a massive object from point to point effect, nothing fancy. But I'm having a bear of a time getting it to animate smoothly. In particular, as it eases into and out of tweens, I'm getting a weird jittering of the MC, so that it stutters to a stop, like a car with bad brakes. The tweens themselves are nothin fancy (see below). It seems like the problem started when I added _rotation to the the mix. The file is vector, imported from AI. is anyone familiar with this problem? Any recommendations for handling this sort of basic (or so I thought) effect? thanks, .m - function slideToPos(){ var xPos = posArray[active][0]; var yPos = posArray[active][1]; var rPos = posArray[active][2]; active++; mainpanel_mc.tween(_x,xPos,2,easeInOutSine); mainpanel_mc.tween(_y,yPos,2.5,easeInOutSine); mainpanel_mc.tween(_rotation,rPos, 2.5,easeInOutSine,null,slideToPos2()); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS2: Tweening a very large vector file causes shaking
On Mar 21, 2008, at 9:57 AM, Matt S. wrote: It seems like the problem started when I added _rotation to the the mix. The file is vector, imported from AI. is anyone familiar with this problem? Any recommendations for handling this sort of basic (or so I thought) effect? There's a bug in Flash on certain operating system configs. I just don't know what it is. I've yet to find an appropriate solution for this myself. The issue is related to the rotation. I've actually resorted to using Combustion to do some of my animation work because of it. I too would 'love' to know if anyone has found the core issue or a work around. thanks! jon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS2: Tweening a very large vector file causes shaking
So as far as you know its caused by the combination of large file + rotation? Hmm, perhaps I'll try breaking it up into smaller MC's and then place those in a larger mc... .m On Fri, Mar 21, 2008 at 10:31 AM, Jon Bradley [EMAIL PROTECTED] wrote: On Mar 21, 2008, at 9:57 AM, Matt S. wrote: It seems like the problem started when I added _rotation to the the mix. The file is vector, imported from AI. is anyone familiar with this problem? Any recommendations for handling this sort of basic (or so I thought) effect? There's a bug in Flash on certain operating system configs. I just don't know what it is. I've yet to find an appropriate solution for this myself. The issue is related to the rotation. I've actually resorted to using Combustion to do some of my animation work because of it. I too would 'love' to know if anyone has found the core issue or a work around. thanks! jon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS2: Tweening a very large vector file causes shaking
That's a myth. If he's tweening one or two things the tweening engine makes absolutely no difference. The only differences in terms of speed between tweening engines is how each of they handle a massive number of property updates on a massive number of objects. So there's absolutely no problem using Fuse on that case, the problem's somewhere else. A bottleneck problem isn't solved with a larger bottle. All I can say about the problem is that it seems to be related to rendering so yeah, you'll have to look into what you're doing. Use cacheAsBitmap WHERE appropriate (not in the whole movieclip - it's too big for that), use scrollRect when possible. Remember, complex vector rendering is EXPENSIVE. So 4000px x 4000px is nearly suicidal. Zeh Sidney de Koning wrote: Hi Matt, Like the analogies :) What tweening engine are you using? If its your engine, there is a good speed comparison here: http://blog.greensock.com/tweening-speed-test/ If so, just change to a different engine, not every car is build to move boulders ;) Sid On Mar 21, 2008, at 2:57 PM, Matt S. wrote: Hi, so this is a very odd problem, but I'm tweening an extremely large vector file (about 4000x4000px), using the Fuse tween classes. Its basically your standard slide across the surface of a massive object from point to point effect, nothing fancy. But I'm having a bear of a time getting it to animate smoothly. In particular, as it eases into and out of tweens, I'm getting a weird jittering of the MC, so that it stutters to a stop, like a car with bad brakes. The tweens themselves are nothin fancy (see below). It seems like the problem started when I added _rotation to the the mix. The file is vector, imported from AI. is anyone familiar with this problem? Any recommendations for handling this sort of basic (or so I thought) effect? thanks, .m - function slideToPos(){ var xPos = posArray[active][0]; var yPos = posArray[active][1]; var rPos = posArray[active][2]; active++; mainpanel_mc.tween(_x,xPos,2,easeInOutSine); mainpanel_mc.tween(_y,yPos,2.5,easeInOutSine); mainpanel_mc.tween(_rotation,rPos,2.5,easeInOutSine,null,slideToPos2()); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS2: Tweening a very large vector file causes shaking
thanks Sidney! That's a useful comparison tool. :) .m On Fri, Mar 21, 2008 at 10:06 AM, Sidney de Koning [EMAIL PROTECTED] wrote: Hi Matt, Like the analogies :) What tweening engine are you using? If its your engine, there is a good speed comparison here: http://blog.greensock.com/tweening-speed-test/ If so, just change to a different engine, not every car is build to move boulders ;) Sid On Mar 21, 2008, at 2:57 PM, Matt S. wrote: Hi, so this is a very odd problem, but I'm tweening an extremely large vector file (about 4000x4000px), using the Fuse tween classes. Its basically your standard slide across the surface of a massive object from point to point effect, nothing fancy. But I'm having a bear of a time getting it to animate smoothly. In particular, as it eases into and out of tweens, I'm getting a weird jittering of the MC, so that it stutters to a stop, like a car with bad brakes. The tweens themselves are nothin fancy (see below). It seems like the problem started when I added _rotation to the the mix. The file is vector, imported from AI. is anyone familiar with this problem? Any recommendations for handling this sort of basic (or so I thought) effect? thanks, .m - function slideToPos(){ var xPos = posArray[active][0]; var yPos = posArray[active][1]; var rPos = posArray[active][2]; active++; mainpanel_mc.tween(_x,xPos,2,easeInOutSine); mainpanel_mc.tween(_y,yPos,2.5,easeInOutSine); mainpanel_mc.tween(_rotation,rPos, 2.5,easeInOutSine,null,slideToPos2()); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS2: Tweening a very large vector file causes shaking
Fuse is really really bad IMO for tweening when performance (like with your complex vector graphic) is a concern. I dropped it because it became unusable for me in high stress situations. My current tweener-of-the-month I like is TweenLite. Also, Flash does have a hard time, tweening aside, when very very complex vector graphics are used. We designed a very complex photo-realistic assets representing the inside of an ATM machine, which took us several days to build, and had performance issues that were unrelated to any code (we tested it in fresh .flas with no code) - and these graphics were done with only Flash drawing tools. We used a ton of gradients to achieve photo-realistic rendering, but it came with a price. The main problem we had was sometimes the Flash player (8 at the time) would not load the graphic, sometimes it would - completely random. We finally got it working fine, but learned there are limits to what the browser/player/memory can render. Possible it was related to the video card too, to be fair. Anyway, something to keep in mind. Jason Merrill Bank of America GTO and Risk LLD Solutions Design Development eTools Multimedia Bank of America Flash Platform Developer Community Are you a Bank of America associate interested in innovative learning ideas and technologies? Check out our internal GTO Innovative Learning Blog subscribe. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] strange effects when tweening alpha
Our artist made an animated character by over-lapping different body parts. Strange thing, when I fade out the character using an alpha-tween of the outer-most clip, I can see the overlapping parts at the joints. It's like the alpha is affecting the individual parts within the movieClip rather than being applied to the composite movieClip. This is in AS2, and I just use the mx.transitions Tween class. I guess to cacheAsBitmap before doing the tween, but shouldn't alpha be applied to a composited clip by definition? I can't think of any reason why you would ever want an alpha effect to apply to the individual parts within a movie clip. I mean, if I wanted that effect I would set the alphas of the individual parts, right? Thanks. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] strange effects when tweening alpha
I think that's what happens in Flash too (including older versions of Flash...) with timeline tweens, etc... If your character is over a solid background, you could tween the Tint rather than the alpha. Again, in AS2, this less resource hungry than alpha tweens, so a nice workaround. Andrew Sinning wrote: Our artist made an animated character by over-lapping different body parts. Strange thing, when I fade out the character using an alpha-tween of the outer-most clip, I can see the overlapping parts at the joints. It's like the alpha is affecting the individual parts within the movieClip rather than being applied to the composite movieClip. This is in AS2, and I just use the mx.transitions Tween class. I guess to cacheAsBitmap before doing the tween, but shouldn't alpha be applied to a composited clip by definition? I can't think of any reason why you would ever want an alpha effect to apply to the individual parts within a movie clip. I mean, if I wanted that effect I would set the alphas of the individual parts, right? Thanks. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01736 759321 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] strange effects when tweening alpha
wow, I've already had to deal with this problem... I solved it using some blend mode (I don't remember which one). Try different blend modes to the movieclip containing the body parts, and see if some of them solves your problem. good luck, andrei On Fri, Mar 21, 2008 at 12:38 PM, Glen Pike [EMAIL PROTECTED] wrote: I think that's what happens in Flash too (including older versions of Flash...) with timeline tweens, etc... If your character is over a solid background, you could tween the Tint rather than the alpha. Again, in AS2, this less resource hungry than alpha tweens, so a nice workaround. Andrew Sinning wrote: Our artist made an animated character by over-lapping different body parts. Strange thing, when I fade out the character using an alpha-tween of the outer-most clip, I can see the overlapping parts at the joints. It's like the alpha is affecting the individual parts within the movieClip rather than being applied to the composite movieClip. This is in AS2, and I just use the mx.transitions Tween class. I guess to cacheAsBitmap before doing the tween, but shouldn't alpha be applied to a composited clip by definition? I can't think of any reason why you would ever want an alpha effect to apply to the individual parts within a movie clip. I mean, if I wanted that effect I would set the alphas of the individual parts, right? Thanks. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01736 759321 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] strange effects when tweening alpha
I forgot to say: the desired effect, in my case, was a silhouette. That was what gave the possibility of using one of the blend modes supported by Flash. If you need to keep all the colors of your characters, I guess this solution won't work for you. andrei On Fri, Mar 21, 2008 at 12:53 PM, Andrei Thomaz [EMAIL PROTECTED] wrote: wow, I've already had to deal with this problem... I solved it using some blend mode (I don't remember which one). Try different blend modes to the movieclip containing the body parts, and see if some of them solves your problem. good luck, andrei On Fri, Mar 21, 2008 at 12:38 PM, Glen Pike [EMAIL PROTECTED] wrote: I think that's what happens in Flash too (including older versions of Flash...) with timeline tweens, etc... If your character is over a solid background, you could tween the Tint rather than the alpha. Again, in AS2, this less resource hungry than alpha tweens, so a nice workaround. Andrew Sinning wrote: Our artist made an animated character by over-lapping different body parts. Strange thing, when I fade out the character using an alpha-tween of the outer-most clip, I can see the overlapping parts at the joints. It's like the alpha is affecting the individual parts within the movieClip rather than being applied to the composite movieClip. This is in AS2, and I just use the mx.transitions Tween class. I guess to cacheAsBitmap before doing the tween, but shouldn't alpha be applied to a composited clip by definition? I can't think of any reason why you would ever want an alpha effect to apply to the individual parts within a movie clip. I mean, if I wanted that effect I would set the alphas of the individual parts, right? Thanks. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01736 759321 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Writing Custom MovieClip Classes
oh yeah I Realized it. THanks for the huge help guys. this list rocks! On Thu, Mar 20, 2008 at 8:36 PM, Merrill, Jason [EMAIL PROTECTED] wrote: which is an __ typo, I meant to add the word, extension which is an extension (not directly,but further down the chain) of EventDispatcher Jason Merrill Bank of America GTO and Risk LLD Solutions Design Development eTools Multimedia Bank of America Flash Platform Developer Community Are you a Bank of America associate interested in innovative learning ideas and technologies? Check out our internal GTO Innovative Learning Blog subscribe. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] strange effects when tweening alpha
Our artist made an animated character by over-lapping different body parts. Strange thing, when I fade out the character using an alpha-tween of the outer-most clip, I can see the overlapping parts at the joints. It's like the alpha is affecting the individual parts within the movieClip rather than being applied to the composite movieClip. This is in AS2, and I just use the mx.transitions Tween class. I guess to cacheAsBitmap before doing the tween, but shouldn't alpha be applied to a composited clip by definition? I can't think of any reason why you would ever want an alpha effect to apply to the individual parts within a movie clip. I mean, if I wanted that effect I would set the alphas of the individual parts, right? This is the usual behavior. It's unrelated to player version, actionscript version, or fading/tweening code used. Alphas of children containers are simply multiplied by the alpha value of the parent container. If you don't want that x-ray effect, set blendMode of the container to layer. That forces precomposition of the container content before the alpha is applied so it'll fade as a whole. That's the correct solution for that problem. Using 'empty' filters (say, a blur with a radius of 0) has the same effect. Using cacheAsBitmap *usually* has the same effect too, but it is erratic - depending on changes done to children content, it may force redrawing and you'd lose the flattened transparencies. With all those solutions, if you use different blendModes on the container children you'll lose them. Zeh ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] strange effects when tweening alpha
Funny thing is that even turning on cacheAsBitmap before doing the tween doesn't help. I guess I'll just have to do it faster and hope nobody notices. Huh!? Andrew Sinning wrote: Our artist made an animated character by over-lapping different body parts. Strange thing, when I fade out the character using an alpha-tween of the outer-most clip, I can see the overlapping parts at the joints. It's like the alpha is affecting the individual parts within the movieClip rather than being applied to the composite movieClip. This is in AS2, and I just use the mx.transitions Tween class. I guess to cacheAsBitmap before doing the tween, but shouldn't alpha be applied to a composited clip by definition? I can't think of any reason why you would ever want an alpha effect to apply to the individual parts within a movie clip. I mean, if I wanted that effect I would set the alphas of the individual parts, right? Thanks. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] strange effects when tweening alpha
Thanks Zeh. Your solution should have been SO easy for me to implement, but it seems that setting this using AS right before doing the tween doesn't work. I had to change it in the IDE. But it works great! Thanks! Zeh Fernando wrote: Our artist made an animated character by over-lapping different body parts. Strange thing, when I fade out the character using an alpha-tween of the outer-most clip, I can see the overlapping parts at the joints. It's like the alpha is affecting the individual parts within the movieClip rather than being applied to the composite movieClip. This is in AS2, and I just use the mx.transitions Tween class. I guess to cacheAsBitmap before doing the tween, but shouldn't alpha be applied to a composited clip by definition? I can't think of any reason why you would ever want an alpha effect to apply to the individual parts within a movie clip. I mean, if I wanted that effect I would set the alphas of the individual parts, right? This is the usual behavior. It's unrelated to player version, actionscript version, or fading/tweening code used. Alphas of children containers are simply multiplied by the alpha value of the parent container. If you don't want that x-ray effect, set blendMode of the container to layer. That forces precomposition of the container content before the alpha is applied so it'll fade as a whole. That's the correct solution for that problem. Using 'empty' filters (say, a blur with a radius of 0) has the same effect. Using cacheAsBitmap *usually* has the same effect too, but it is erratic - depending on changes done to children content, it may force redrawing and you'd lose the flattened transparencies. With all those solutions, if you use different blendModes on the container children you'll lose them. Zeh ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] strange effects when tweening alpha
It's also important to clarify something Zeh mentioned when he used the phrases container children and precomposition. (Zeh said it well, but I've seen lots of folks not quite get this idea the first time they hear about it, so this is just a bit of overkill.) The Layer blend mode will not work if applied to a lone, childless movie clip on the stage. Instead, it works on a movie clip within which the children are overlapping. For example, if your character is in the root timeline, it's not possible to apply Layer to all the body parts and correct the problem. If the character is in a movie clip (as it likely is/should probably be), you apply Layer to the parent clip, not the body parts within. The default tool behavior for applying the alpha is to go into the parent and apply it to all the children. This yields the result you're seeing. Layer was introduced with Flash 8 to prevent that. It precomposes everything in the clip so the alpha is applied to one thing as a whole. Rich ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] strange effects when tweening alpha
I just tried the layer thing too - thanks for that useful snippet... Glen -- Glen Pike 01736 759321 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] referencing external CSS file
Hi list... I have an AS2 project with 10 classes with TextFormats instanced throughout. Can anyone recommend a best practice to keep all of these TFs in one place and just have them referenced when needed? I was thinking of making a class just to return different TFs. Is there a way to load a CSS file - not glued to a specific TextField - so that all classes can reference the styles within it? Also, if I can load a global external CSS file, can I apply styles to instanced V2 components from it? - Michael M. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Custom MovieClip Classes
List, I have a MovieClip in my Flash Library with Class Name APanel. The class obviously extends MovieClip; Also I have another MovieClip in the library Called RegistrationPanel and It's class also would extend the MovieClip's one. Now I would the like to let RegistrationPanel inherit some behaviours from APanel. But it allready extends MovieClip... How can I do this ? -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Custom MovieClip Classes
I would maybe use Composition to do this. Have RegistrationPanel contain an instance of APanel and call on it: http://www.moock.org/eas2/compositionVSinheritance.html HTH Glen Omar Fouad wrote: List, I have a MovieClip in my Flash Library with Class Name APanel. The class obviously extends MovieClip; Also I have another MovieClip in the library Called RegistrationPanel and It's class also would extend the MovieClip's one. Now I would the like to let RegistrationPanel inherit some behaviours from APanel. But it allready extends MovieClip... How can I do this ? -- Glen Pike 01736 759321 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Custom MovieClip Classes
Now I would the like to let RegistrationPanel inherit some behaviours from APanel. But it allready extends MovieClip... How can I do this ? You can have RegistrationPanel extend APanel. You need to inherit from MovieClip, but you don't have to do it directly. APanel extends MovieClip, so when RegistrationPanel extends APanel, it will also extend MovieClip. Like a dog is a mammal, and a mammal is an animal, so a dog is an animal, too. Mark On Sat, Mar 22, 2008 at 12:24 AM, Omar Fouad [EMAIL PROTECTED] wrote: List, I have a MovieClip in my Flash Library with Class Name APanel. The class obviously extends MovieClip; Also I have another MovieClip in the library Called RegistrationPanel and It's class also would extend the MovieClip's one. Now I would the like to let RegistrationPanel inherit some behaviours from APanel. But it allready extends MovieClip... How can I do this ? -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Custom MovieClip Classes
Do you want to inherit some or all? If you want to inherit all, have RegistrationPanel extend APanel. If you want to inherit some, have RegistrationPanel instantiate APanel and have proxy methods to just the ones you want. -Steven Omar Fouad wrote: List, I have a MovieClip in my Flash Library with Class Name APanel. The class obviously extends MovieClip; Also I have another MovieClip in the library Called RegistrationPanel and It's class also would extend the MovieClip's one. Now I would the like to let RegistrationPanel inherit some behaviours from APanel. But it allready extends MovieClip... How can I do this ? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Custom MovieClip Classes
Nope look at this. package amlak.ui { import flash.text.*; import flash.display.MovieClip; public class RegistrationPanel extends APanel { public function RegistrationPanel(){ } } } 5000: The class 'amlak.ui.RegistrationPanel' must subclass ' flash.display.MovieClip' since it is linked to a library symbol of that type. I thought that RegistrationPanel would inherit also MovieClip since APanal does. But same Error. On Sat, Mar 22, 2008 at 2:02 AM, Steven Sacks [EMAIL PROTECTED] wrote: Do you want to inherit some or all? If you want to inherit all, have RegistrationPanel extend APanel. If you want to inherit some, have RegistrationPanel instantiate APanel and have proxy methods to just the ones you want. -Steven Omar Fouad wrote: List, I have a MovieClip in my Flash Library with Class Name APanel. The class obviously extends MovieClip; Also I have another MovieClip in the library Called RegistrationPanel and It's class also would extend the MovieClip's one. Now I would the like to let RegistrationPanel inherit some behaviours from APanel. But it allready extends MovieClip... How can I do this ? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders