Right now, I've got a switch statement which is being used to create objects based on a string. There are three types of objects which extend an abstract generic object. I should really be using a factory pattern, which I'm figuring out right now. My issue is thus: flexibility of the factory pattern, but right now I'm storing the would-be products in special dictionaries dedicated to their type.
i'm trying to search a string for a particular pattern, and replace it with elements from within the pattern... for example..here's the given string...if you want to learn how to use regexp, {url===http://somesite.com, text===click here}.
the pattern... {url===http://somesite.com, text===replacement text}
and the intended result... if you want to learn how to use regexp, click here.
of course, i'll extract the url and do something else with it... i'm just wondering what the regexp is for that pattern, and how i can extract things from the results returned.
My data is of mixed types like String, Array Collection, Boolean. I have to populate the data into appropriate UI component - for example Boolean to check box, Array to List. So we have created a factory class which will return 3 different type of component based on the input argument.
MultiLineCheckBox which extends mx.controls.CheckBox and few methods are overridden to bring the multiple line label. [URL]. It works perfect.Am using the MultiLineCheckBox in the entire application wherever I want check Box. Now I went into a scenario where I want check Box instead of MultiLineCheckBox. How to rewrite my CCheckBox to handle MultiLineCheckBox and also default CheckBox? Each of the CCheckBox class has lot of methods init.
at the moment I've got a (perhaps) requirement for specifying precedence to certain queries within a movie, which will be dealing with the upload of assets through flash to a php backend.
Does anyone have any info, or maybe a pointer in the right direction with regards to how flash deals with the internal URLRequest stack. If that's even how it works.
I may be vastly over simplifying the way flash works, but the only analogy I have is my own exploration into protoyping an AJAX query stack a couple of years ago, where you'd be able to alter the stack ordering depending on request priority as it were.
Rather than use a hard-coded switch statement where you pass it the string name of a class and it then instantiates the appropriate class, I'd like to pass the actual name of the class to my factory method and have it dynamically create an instance of that class. I thought it would be trivial and am surprised it is not working. I must be missing something quite basic:
sample code:
createProduct(50, "Product1Class"); createProduct(5, "Product2Class"); private function createProduct(amount:uint, productClassName:String):void { var productReference:Class;
[Code].....
The only thing that may be a little odd (not sure) is that these "products" are actually linked Library items (ie: I have a movieClip in the Library that has a linkage to Product1Class and another to Product2Class both of which extend ProductBaseClass, which in turn extends MovieClip.
I've got this issue implementing the Factory method. Following is the snippet of the the main chart class which calls ChartFactory's method to attain the proper object. I Type Cast chartobject so as to be able to call the Show method; I am apprehensive about that as well.
container = new VBox(); container.percentWidth = 100; container.percentHeight = 100; super.media.addChild(container); chartObject = new ChartBase(); [Code] .....
I am loading products from XML in Roll Over ,A movie clip appears I m trying to display Description , Price & Link in a MovieClip when I move to that movieClip , as it moves away from image(on which roll-over was trigrred ) my description movieClip gone
I am with big problem, example I am making a "item product", that he goes to show image, the description of the product and the price of the product, the image, the description and the price, I am catching these data of my HTML.[code]As I would make thus, in my HTML I have that to put 4 images, 4 description and 4 prices it to works normal, without giving error, but if I to place 2 images, 2 description and 2 prices it show 2 products, but it still goes until the end of timeline showing nothing.how I would make if I placed only 3 or 2 products, it I would only twirl these 3 with Loop, if I placed 1 product only show 1 time without loop, it he would be without Loop and thus for ahead?
I have a client that wants a list a products to scroll across the top of the screen on his website.I am sure there is a way to do that in Flash but the extent of my experience is fade-out slideshows.Can anyone direct me to a great tutorial for scrolling text.
I am glad for my first participation in this forum. Currently, I am working on Flash8, were doing a banner animation. It has buttons created by XML binding. When you click the buttons, appropriate product picture appears and when you click on the picture page is redirected to that products page. I want that animation to be automatically browsing products. And when you click some button browsing would stop, picture would appear, if no action wait for a while and continue browsing(first picture, second picture, ...) automatically.
I have connected to a web service built in java and would now like to add the products to a stage. I want to show 5 products and if a user clicks <- the previous 5 and -> next 5.
Code: import mx.data.components.WebServiceConnector // Add preloader here var wsConn:WebServiceConnector = new WebServiceConnector(); wsConn.addEventListener("result", res); [Code] .....
In the res function I would like to add my movieclips but I don't know how to move on.
I was wondering if anyone has attempted in profiting off of using Flash to make useful applications? I started the website [URL] which the products are both made in flash (one of the members here coded it for me). I am just interested in seeing if anyone else has tried selling flash as software? If your wondering I have sold about $450 worth of the basketball/football one and just started the first aid one
Trying to make a code that displays a number of products/images. Problem is pretty simple... when I put in a new picture, it ends on top of and covers the last. Do I use an image array to fix this? And how?
Also, if I want to position my array/gallery somewhere else on stage, where/how do I adjust the x y values?
my .fla file:
Code: var myPicture:Picture = new Picture("bilde1.jpg", 100, 100); addChild(myPicture);
i'm trying to create an online brochure that users design with products/images they've selected. users will be able to drag a thumbnail to a pre-designed area, then swap them around to their liking. currently i'm in the beginning stages and just learning the power of actionscript.
i've attached two sample .fla files i've been working with. the first sample i have two thumbnails drag to a target and enlarge to a defined size. the second sample i used a tutorial from flashkit --- drag drop swap. it works but the as is not up-to-date. i'm trying to incorporate the two ideas together but get bizarre effects. most of the examples i find are close but no cigar.
I'm currently making my own shoot'em up game where the player can switch between two player types which will fire their own bullet type in this case, squares and circles. I've setup the player switch function via pressing "space" button (switching between the two player types) and the default bullet type is "squares" and I'm not sure to approach the coding with changing the bullet type to "circles".I've written 2 classes for the bullet and player setup:Player Class: Creates instance of bullet on screen and enables the switch player type function
Bullet Class: Enables bullet properies and bullet types Player Class: Code:function onKeyDown(event:KeyboardEvent):void {if (event.keyCode == 32) //// pressing/holding "space bar" to function
I am working on a project where the user can add items to a "board". What I need is to generate a list at the side of the "board" with the names of the products selected (there could be multiple inctances of the same product used). When I drag a product to the trash, I also need it to disappear from the list as well.
I can't understand why should I even use the Singleton pattern in ActionScript 3. Can anyone explain me this? Maybe I just don't understand the purpose of it. I mean how it differs from other patterns? How it works? I checked the PureMVC source and it's full of Singletons. Why are they using them in the View, Module, Controller?
I am working on a Flash project that initially had a simple template for the animation, but has grown to have different "states" with multiple templates (not under my control)Because of this, my update (ENTER_FRAME) loop is now starting to look a bit like this:
private function update():void { switch (state) { case "intro": switch(layoutState) {
I remember seeing someone a while back using actionscript a method to draw a pattern. I thought it was a really interesting take on as and kept in the back of my head for when the possibility came up.
If I place a pattern or object over a 3d object created in CS4, will it affect it by warping it in any way.I'm looking for a way to push a pattern over a 3d object, for the pattern to look like the 3d object is "under" it.
I would like to create a repeating pattern using a bitmap from my library as a background. I would like the pattern to always fill the stage area when the brower window is scaled. The code below works, but I think it may not be the most efficient way to handle this. Seems to be a little slow.
function onResizeStage(evt:Event):void{ backGroundSprite.graphics.beginBitmapFill(pattern(0, 0)); backGroundSprite.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight); backGroundSprite.graphics.endFill(); }
How can I find a given bitmap pattern on a bitmap ( loaded jpeg )? Is there any flash classes / functions for this purpose?Here is the sample image and has 4 patterns.What I want is to get the bounding informations of the 4 patterns on the image ( x , y , width , height ).
I'm looking to get some good books on design patterns and I'm wondering what particular pattern you'd recommend for a Realtime Strategy Game (like Starcraft), MVC?. I'd like to make a basic RTS in Flash at some point and I want to start studying the best pattern for this.
Just curious. TweenLite/TweenMax is a very common animation library, and I was wondering how someone would classify the design pattern used in TweenLite.For those of you unfamiliar, here's some example code from their website:[code]