Design Pattern (MVC)
Hello everyone and Happy new year !
I am trying to apply the MVC pattern to a tile based game. I have trouble to understand at which level I should apply the MVC logic.
For the moment what I've created, it's a class TileGame, this class is used to initialize the application.
In this class I instantiate my MapModel and MapView class. When my map is displayed, the MapView class dispatches an event. This event triggered the instantiation of my HeroModel, HeroView and my GameControl. ( I had an other problem at this point, I needed a reference to the movie clip – hero – for the calculation in my model, the movie clip is created in the HeroView….. the MVC does not allow us to pass information from the view to the model, so I choose to use the GameControl to pass this info to the HeroModel …. I hope it's a good workaround).
For the moment my GameControl only affect the movement of the Hero but at the end it would also affect the position of the map (tiles), it means that the HeroModel would have to update the HeroView and the MapView …it looks a bit dodgy to me ….
So I am a bit lost… Should my MVC be apply to an other level ….the Model regrouping the MapModel and the HeroModel for example?
Thanks for your help. Sibylhun
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 01-10-2007, 09:56 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Help With A Design Pattern
Hi,
I'm hoping someone can help me, as I'm a newbie to ActionScript (and Flash as well, frankly). I need to be able to create a movie that dynamically reads the URLs of images from an XML file and then populates the images on the screen, with some animation connected to the images.
I'm using loadMovie() to load the images, and that works like a champ. But I can't figure out how to "pre-define" an animation when I'm loading the images at run-time. I tried onEnterFrame() to do some basic fade-in/fade-out animation using _alpha, and that worked, but it seems like I could only call onEnterFrame() one time.
Can I call onEnterFrame() in subsequent frames, one per layer? Or should I be using some other "on" method? I sure could use some design help, obviously.
Thanks in advance,
Stan McFarland
Design Pattern Advice
Ok, I know I'm not posting code, but I want some theoretical advice.
I want to build a modular listbox which will allow me to load different items in depending on the situation .Sometimes just text, sometimes a thumbnail with text, sometimes a tiny looping flv etc, but only one kind at a time.
It seems to make sense to me that the items loaded in can be mcs linked to their own separate classes which give them the rellevent functionality. But my problem is that if I make a manager class to attatch the items, how can I then control which item class I want to instantiate without hard-coding it into the class.
Should I write the manager class then create a different Subclass for each kind of item?
Thanks
Recommend A Design Pattern
Hi
I'm setting out to creating a logging application. I wanted to give proper oo and design patterns ago and I was hoping somebody might be able to reccommend one to based on my requirements?
Basically I'll have a logger that collects data and then sends it to a server.
The logging types or classes if you will are
log user info
log environment info
log interaction info
log content info
log session info
My initial inkling would be to go for a strategy pattern. Or would a design pattern even be necessary for this?
Whats your 2 cents ?
Once I get this done I'm going to post a case study/tutorial on it
Using The 'Design Pattern': Suggestions
So I am still in the process of translating some of my AS2 classes over to AS3. AND I have been doing so supplemental reading on design patterns in the process. I am thinking maybe this is the time to really make my classes more effecient using the Design/Decorator Pattern which I read about in Head Start Design Patterns.
So I have this class that extends the Sprite class. Depending on the 'shape type' of the shape I want to draw, it will calculate certain points via a pointLogic method and then based on the 'vis type' will either call drawWireFrame (), drawSolid (), or drawShaded ().
How I was doing this in AS2 was basically extending a base class and then overriding the aforementioned 4 methods in each of the subclasses. In AS3 I am looking to use the same base class and basically attach certain classes that will instruct the base class on the pointLogic (), drawWireFrame (), drawSolid (), and drawShaded () depending on the shape I want to draw.
So I am kinda stumped on how to approach this. I guess the real issue is how do I bring in these classes and have them give their instructions on how to draw the base class? Am I going to need to use something like owner or parentDocument to have these drawing classes talk to the base class.
Any comments, suggestions, questions etc. will be greatly appreciated. THANKS
Using Singleton Design Pattern
Hi,
a little foggy on passing variables to the Constructor from a Singleton instance. Could someone enlighten?
From timeline:
Code:
var c:Calculator = Calculator.getInstance(5,20,30);
Need to pass these to the constructor............
Code:
//
var priceCD:Number = 320;
var priceShocks:Number = 150;
var priceCover:Number = 125;
//
This class in its current state......
Code:
class Calculator {
private var target:MovieClip;
//
private var _priceCD:Number;
private var _priceShocks:Number;
private var _priceCover:Number;
//
private var qty_arr:Array;
private var qty1_txt:TextField;
private var qty2_txt:TextField;
private var qty3_txt:TextField;
//
private var price_arr:Array;
private var price1_txt:TextField;
private var price2_txt:TextField;
private var price3_txt:TextField;
private var priceTotal_txt:TextField;
//
private var total:Number;
//
private function Calculator(newPriceCD:Number, newPriceShocks:Number, newPriceCover:Number) {
//
target = _root;
//
_priceCD = newPriceCD;
_priceShocks = newPriceShocks;
_priceCover = newPriceCover;
//
setVal();
updateQTY();
getTotal();
}
//Singleton Design Pattern
private static var instance:Calculator;
public static function getInstance():Calculator {
if (instance == null) {
instance = new Calculator();
}
return instance;
}
public function get priceCD():Number {
return _priceCD;
}
public function set priceCD(newPriceCD:Number):Void {
if (_priceCD == undefined) {
_priceCD = 0;
}
_priceCD = newPriceCD;
}
public function get priceShocks():Number {
return _priceShocks;
}
public function set priceShocks(newPriceShocks:Number):Void {
if (_priceShocks == undefined) {
_priceShocks = 0;
}
_priceShocks = newPriceShocks;
}
public function get priceCover():Number {
return _priceCover;
}
public function set priceCover(newPriceCover:Number):Void {
if (_priceCover == undefined) {
_priceCover = 0;
}
_priceCover = newPriceCover;
}
private function setVal():Void {
//var target = _root;
//
target.qty_arr = new Array(target.qty1_txt, target.qty2_txt, target.qty3_txt);
for (var i:Number = 0; i<target.qty_arr.length; i++) {
target.qty_arr[i].text = 0;
//trace(target.qty_arr[i].text);
}
}
private function updateQTY():Void {
//var target = _root;
//
var priceCD:Number = 320;
var priceShocks:Number = 150;
var priceCover:Number = 125;
//
target.onEnterFrame = function() {
price1_txt.text = Number(qty1_txt.text)*Number(priceCD);
price2_txt.text = Number(qty2_txt.text)*Number(priceShocks);
price3_txt.text = Number(qty3_txt.text)*Number(priceCover);
};
}
private function getTotal():Void {
var target = _root;
//
target.calculate_btn.onRelease = function() {
target.total = 0;
target.price_arr = new Array(target.price1_txt, target.price2_txt, target.price3_txt);
for (var i:Number = 0; i<target.price_arr.length; i++) {
target.total += Number(target.price_arr[i].text);
trace(target.price_arr[i].text);
}
target.priceTotal_txt.text = target.total;
trace(target.priceTotal_txt.text);
};
}
}
Design Pattern Question...is This The Best Way?
I have multiple instances of a square class that will all be clickable to link to things when clicked. However, when the user changes to "editMode" in my application, all the squares should become draggable and temporarily lose their linking functionality until the user leaves editMode.
What's the best way to approach this? A static "editMode" variable in my square class maybe? If so, do I just have a listener waiting for when editMode changes to change the mouse events or something?
Please Help With Design Pattern Decision
Okay, so I have become familiar enough with the concept of a design pattern in OOP to understand that my problem is design-pattern related (that and some lack of ability to make and stick with a decision, I think...)
So, what I am hoping to discuss is this: Using Flash MX 2004 Pro (and not using components or pre-packaged, post-processed actionscript from some repository), I would like to create a somewhat dynamic menu system. But what's important here is that I want to do it well--not just get it done.
So of the 10,000 approaches I have taken in the last year to doing this, I have narrowed down these following basic concepts:
===========================
[size="BIG"]Concept 1[/size]
Have a class for each button in the menuBar called "menuClip" and have each object react independently to mouse events. Each object, however, when clicked and released would tell the parent class "menuBar" to change it's workings (so it would reach differently to mouse events, being the current selection), to hide the other clips and to load the approriate clip.
[size="BIG"]Concept 2[/size]
Have a menuBar class that automatically creates the menuButtons and associates them with a Controller class that handles the mouse events, the visual appearance of all of the clips and hands off the loading process to an attach Loader class that handles the loading of the appropriate clip.
[size="BIG"]Concept 3[/size]
Have a menuClip class that upon constructing itself, refers to the parent clip ("menuBar" class) to get default construction parameters. Each clip refers to the mouseListener object in the menuBar class to determine how it should look based on the broadcasted state of the menuBar's MouseListener object. The menuBar then would handle the loading of the appropriate clip.
===========================
I have tried at least 100 other ways, but I would really like to know what others have used and what everyone thinks is the most efficient method.
Basically, the things that don't change are this:
I have a list of sections on my website that each have directories. Inside each directory is an index.swf file. The individual buttons I want named for the sections and the clips they should load would be deteremined by "buttonName/index.swf". So when I add a new section, I simply add a new item to my menuItems array and it automatically creates a new button and knows what it is supposed to load without a lot of configuration.
If you have taken the time to read all of this, I would really appreciate your input. I have found that although the help I have received from the OOP group is more valuable than words can express, I am hoping to get a less abstracted, more FLASH oriented viewpoint by posting here.
Thanks in advance for your input,
jase
COMPLEX Required DESIGN PATTERN
hello friends
u pls help me out in retriving the required shape.
there will be say 3 coloumns LETS ASSUME EXAMPLE FOR HEADPHONES
1) first coloumns consists of say 17-20 rows( rows must be varied)
<<ITEMS>>
ex:SONY
PANASONIC etc....
2)second column consists of CATEGORIES OF related ITEMS
ex:WIRED
WIRELESS (CATEGORIES MAY VARY TOO)
3)in the third column consists of DESCRIPTION OF CATEGORIES AND IMAGE OF CATEGORIES RESPECTIVELY. In description we may have 3 -4 fields such as TITLE,PRICE,DESCRIPTION,SHIPPING PRICE.
NOTE: ALL THE DATA SHOULD BE DYNAMICALLY READ FROM OUTSIDE.
COMPANY............CATEGORY............DESCRIPTION
SONY...................................TITLE:
PANASONIC..........WIRED...............PRICE:
KOSS...................................SHIPPING PRICE:
...................WIRELESS............DESCRIPTION :
.....
.....
.....
.....
All the data should be read dynamically .if we add data in the notepad externally the program should be able to create or delate the records itself. here we should not go to the flsah program once again.
HERE I SHOULD BE ABLE TO GET THE SCROLL-BAR TOO.
PLEASE HELP ME TO DESIGN THIS AND PLS GIVE ME THE ACTION SCRIPT TOO.
Help Me Out Howto Design In The Pattern Show
hai friends
i want to design the one as shown in the URL below.
pls go to the bottom of the URL where u find what exactly i want to design.at the bottom of the URL u will find the search bar. the template is like a frame .so pls go through and help me to design in the same way. note that all the data should be dyanamically loaded.
URL:[url=http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=3868315914]
WAITING FOR REPLY
Flash Navigation: Design Pattern?
Hi all,
Im trying to write a navigation system for my flash movie, and want to keep it as object oriented as possible;
What needs to happen is fairly simple i guess : when a button is rolled over, it changes state (enlarges and changes colour) AND all the other buttons change (they shrink and fade out slightly).
My question is about how to approach writing the classes from a design perspective. I havent totally got to grips with using Design patterns but im wondering if the Observer pattern would be suitable:
Have a 'Navigation manager' as the observable subject, and each menu-button MC would be linked to a class that acted as the Observer and registers for updates with the Navigation Manager. When a menu button (observer) is interacted with, the Subject is notified and tells all of the observers to update themselves.
If anyone has any thoughts it'd be much appreciated!
thanks
Tim
A Design Pattern Question, Singleton
Hi all,
Quick one. For those of you that are familiiar with design patterns, I am now studying the Singleton pattern. I know that it is common to mix and match design patterns in an application, so my question, in trying to apply this learning to real world projects, is this:
Wouldn't a ShoppingCart class be considered a case for Singleton? Meaning only one of them can be created in any given session, so wouldn't that be the best option for such a feature?
Thanks.
-LIR
Best Design Pattern Practice For ChildObjects?
I have a class that creates a bunch of boxes. I would like to the boxes to communicate to eachother somehow. So if one box resizes, there would be an event dispatched and all the other boxes would shift over or resize, or change colour, or whatever.
How do I get my boxes to listen to eachother? They are all identical. Is there a certain design pattern that I need to be following?
Any help is appreciated
Design Pattern Samples For Actionscript 2.0
Hi All
I would like to know whether there are any web based material for Design patterns (Actionscript 2.0) likeMVC
Singleton
Observer
I recently took plunge into Object Oriented implementation
Design Pattern For Transition Effect?
I am looking for a design pattern to handling transition effect for a list.
For example, I have a list: A, B, C, D, with A selected. When i press Right Key, the whole list will be shifted, and B will get selected.
Any idea to implement it? I wish to get a design pattern which is generic enough so I can change the effect type at will. thanks
Code Layout/Design Pattern Question
I'm looking for suggestions on the best way to layout my AS code in an application I'm building. It's really a simple web design, but it's the first I've done using pure AS classes/files (none on fla. timeline).
Currently I have my main document class handling all the basic stuff like the layout of some visual elements, resize handler, etc. What I think I need to do is create a navigator/menu class that handles the layout of menu items (will probably be animated somehow). My question is how/where do I assign the listeners for these menu items to have the main docClass do the right thing? Do I just have the menu class assign eventHandlers to the menu items that call a corresponding parent.menuItemClicked(menuItem) method? Then the parent does the corresponding action?
Thanks,
Steve
Build A Pure As3 Project With Design Pattern
Hi all,
probably it's a generic and presumptuous thread: building a pure really reusable As3 project with design patterns. It's too long I'm trying to imagine how and reasearching the web with fews results. I'm looking for a general approach not detailed code.
Where to start? I was thinking to start from a main Application class (something like flex <mx:Application>) which retrieves informations (like:background color, backgroundimage, size, layout) from xml and responsible of the creation of a background, a backgroundImage and manage a layout.
Any ideas or suggestions, someone is interested?
Thanks, Jad.
Which Design Pattern For Standard Flash Website?
Hello OOP gurus
I'm wondering which design pattern is the most appropriate for developing a standard flash website (5 pages, transition between each page etc)
State? Strategy? MVC? Combination of multiple?
Would appreciate any thoughts.
Thanks
What Design Pattern - Change Language Functionality
On my application, I will have a series of buttons to choose a language. When the user chooses a language, all control labels, pop-up messages and others will change at the chosen language.
I would like to do this from an OOP point of view and use Design Patterns. Which one would you recommend to use?
My guess is the Strategy Pattern. Am I right?
Thanks for any comment or link.
Grid Pattern - Popular Design Element
I was curious on how many of you are making that popular grid pattern seen in so many web pages now.
Many of you use Photoshop and I was wondering how you guys/girls are pulling this off.
I use Fireworks and it comes with a Grid Filter which is nice, but how would you do this in Photoshop?
Here is an example of what I am talking about.
http://www.webagent007.com/entry.htm
Sorry but when you get there wait out the flash intro till you get to the image of the KID and then you can navigate and the grid pattern will scroll left/right
How is he making that perfect grid pattern in photoshop... or is he bringing that into Photoshop from Adobe Illustrator or something like that???
I also posted this in the Design area of this Forum... but many of you Flash MX gurus have sites that use this or have refered to sites that use this grid pattern.
Thanks in advance!
Model-View-Controller Design Pattern
I just picked up Advanced ActionScript 3 with Design Patterns, and I'm very interested in the Model-View-Controller pattern. If any of you know what that is, I'd like to talk with you folks about it.
In my latest project I have inadvertently applied the MVC design pattern. My Model class has getters that return data to the caller (which is most often one of my View classes' methods) after validating and formatting it. People who document the MVC pattern typically assume that the data being passed in this way is of some kind of basic type, and that the getter is called infrequently. In my case, the Model class passes BitmapData objects (complex), dozens of times per second (frequent).
This raises an interesting issue. My Model object is unaware and independent of the View and Controller classes. But when the Model passes a reference to some of its data to the other classes, because that data is of type BitmapData, other classes can modify the data that's in the Model. I can prevent this by subclassing BitmapData and overriding its methods and properties, so that only an instance of my Model class can edit it. One could argue that my Model could simply pass a clone of the BitmapData object through the getter, but due to technical constraints I cannot expect that kind of code to run smoothly on most machines.
But is all this protection necessary? Is it the "responsibility" of the Model to prevent other classes from tampering with its data? If I give my Model instance to some other system, shouldn't I be bothered if the other system modifies the Model's data in this way?
'Stickies' Application - Design Pattern Suggestions?
Hi folks,
I'm building my first AS3 project - a 'Stickies' style application to assign tasks to people. Basically just a nice visual wrapper for multiple (and draggable) to-do lists I guess...
I'm trying to work out if there are any design patterns that would be of use here....?
Maybe if I give you some more info you might have some suggestions
Basically, I have the names of some people going across the screen, pulled out of an array. Next to each name is an 'Add sticky' button. Once the sticky is added, you can click on it to type in a task (later on I might hook these up to Basecamp projects using the Basecamp API), and drag it up/down in the list. You can also delete the sticky of course. And further down the line maybe drag it from one person to another.
The other thing is, how to save the data, once you have added some new stickies? Ideally I'd like the Stickies to be accessible online. Saving to MySQL seems overkill though... could you just use a plain text file??
Would the (slightly mysterious) dictionary object be of any use? Or just some multi-dimensional arrays to store stickies for each person?
Cheers.
Data Store / Retrieval Efficiency, And The Singelton Design Pattern
Hi there,
Whilst not strictly an AS3 question, I thought this the best place to ask, as posters here generally seem to work to higher-level best-practices.
I'm building a site for a photographers' agent, and I'm managing about 10 (rising to 20) photographers, each with about 10 collections, picked from any of 150 or so images. The bottom line is there will be at least 1500 images to display (each with filename, credits, id, etc), and a boat-load of data to load in.
Therefore, I've taken great pains to ensure the data is kept lean. For example, the path to a photographer is stored once, an image-size sub-folder is stored only one, and each of the 1500 images only stores it's filename once.
This is opposed to storing the full/path/to/each/filename for each image.
Now, upon completion of loading the data, it's available to my classes, and upon viewing each photographer I'll need to create the 150 or so class instances that will represent the image data (id, name, url, credits, etc) for that particular photographer.
So... getting to the point now:
When I create the image classes, I still need that full/path/to/image, so would it be best toassign the whole url of the image as an instance property in the constructor ie server/photographers/photographer/size/filename.jpg (thus duplicating a lot of data over the 150 images)
or, build the url manually each time I request the url property, using an implicit getter function
If I go the latter route (which is probably best) I'll need a reference to the server, photographer and size variables. These will change as the application changes, so I need some global point of access to them, and here lies my ultimate question:
Should I employ a Singleton to do the overall management of the application? So that the getter function might look like this:
ActionScript Code:
public function get url():String{
var manager = Manager.instance;
var path = manager.getPath();
var folder = manager.getFolder();
var size = manager.getSize();
return path + folder + size + '/' + this.filename;
}
image.url // "photographers/william_lingwood/thumbs/green_apples.jpg"
Or should pass in a reference to the Manager class in the constructor, so I could omit the repetitive static Manager.instance call, and just refer to this.manager?
I guess my question is "in order to keep duplication to a minimum, is it inefficient to constantly be calling a class method to get a simple variable?".
And "is a Singleton the best approach here? If not, what is?"
Sorry I had to ramble through all that. I felt I needed to explain the whole situation as I'm new to design patterns, so I hope it makes sense!
Many thanks,
Dave
"Bank" Design Pattern: Is It Worth It?
A Python-based associate and I have pondered over the use of the following design pattern, which I call a "Bank" (I think it differs somewhat from the Flyweight pattern):
Say you have a game that instantiates Enemy objects. An Enemy, once incapacitated, disappears from the screen. When this happens, you can:delete it, and instantiate a new Enemy the next time you need one (which I think uses up garbage)
preserve it in a storage-type class, so that the next time you need an Enemy, you can try to reuse the ones you already made in the past (which my acquaintance thinks is resource-intensive and uncouth)
Assuming my buddy is wrong, I'm motivated to write a Bank class. A bank is a complicated list, which starts out as empty. When you ask the bank for an object, it searches the list for one, and if it doesn't have one, it'll create one and add it to the internal list. Then it returns a reference to that object and "checks out" the object. When you return the object to the bank, it checks its list for the object, and if it finds it, it "checks in" that object. This minimizes instantiation and eliminates deletion, at the cost of running the loan() and remit() functions.
So my question for you is, is a Bank worth it? I'd like to think so, and once I create a Bank, I can try to determine whether it has any positive impact on my program's performance. But there are good reasons to believe that it isn't, and if anyone has any insight into this, please enlighten me.
HelpHow To Make A Design Page For T-shirt Design Website
Hello..I would like to make a design page that user can design his Tshirt online. It should have the functions like, adding pictures and text on the Tshirt, and the user can modify the font of the text and the position of the picture. After design, the whole information should be sent to the database for producer usage. Therefore, could any one have some good suggestion or source code for these purpose or any good links.
There is a similar function link. http://www.99dogs.com/custom2.html It is the whole process of the design and contains flash. So could any expert help me to achieve these functions in my design page. It is urgent and very important for me. Many thanks in advance!
Flash Design Methods, (what Is The Best Way To Design The Overall Site?)
Hey guys, i am new to flash and so far I have seen a couple ways that you can develop sites. one is to have a main timeline and load swfs into it. and the other is to put everything on the main timeline. I was searching for an article that would give me the advantages and disadvantages of both. anyone know about this?
MVC Pattern
Is there any MVC Pattern samples available for Flash 8(AS2)?
Edited: 02/11/2008 at 01:08:34 AM by kamsky
This Pattern To AS
Hello,
http://theremedy.be/scrap/starsAs.gif
I'm looking for some clues here to generate this kind of pattern using Actionscript.
Probably it's gotta be a "star" attached from the library then generated on stage randomly with colordifference, scaling and skewing.
*Note how the pattern should follow the specified path.
Is it possible? Is it hard to do?
Appreciate any help.
This Pattern To AS
Hello,
http://theremedy.be/scrap/starsAs.gif
I'm looking for some clues here to generate this kind of pattern using Actionscript.
Probably it's gotta be a "star" attached from the library then generated on stage randomly with colordifference, scaling and skewing.
*Note how the pattern should follow the specified path.
Is it possible? Is it hard to do?
Appreciate any help.
Pattern Code
ok,
i have a background pattern, this pattern is made up of dimond shapes, each dimond shape is a movie clip named
"mc-dimond". one of the dimonds is a button, named "b-dimond" now what i want to do is when this button is pressed, each dimond in the pattern needs to change tint in a wave.
now how would i have to do this, i dont want to give each dimond in the pattern an instance name, would an array work for this?, but how?
any help would be great!
thank you.
How To FIll With Pattern
How can I fill the background or a box with a pattern. I'd like to create a "TV scanline" background. For example, in Photoshop I can create a pattern then fill an area with that pattern. Thanks!
Pattern Recognition
Hi,
I am doing a project that involves scanning a black and white(and gray) image of a palm and running it through tests to find out where the lines are. Then comparing the lines to a database of possibilities to output a result closest to the database examples.
Like a fortune teller kind of thing.
Any one have any ideas how to read pixels to compare to stored information on pixels?
Thanks
Jay
Backround Pattern
can someone tell me how you get a pattern like this website in flash? I want to be able to do the drop shadow behind the Main MC and also have the pattern repeat to the edges of whatever size the browser is.
http://www.walltowallrecording.com
thanks in advance.
Non-regular Pattern
I would like to get an information if it is possible to do in
FlashMX 2004 that the sequence of multimedial CD would not have a shape of square or rectangle but a non-regular pattern without frame.
Thanks for your answer
Duplicate Pattern
I'm new to AS3 and coding in general, but can someone post a sample code that would duplicate a movieclip after every half second? And after each movieclip is duplicated, it's rotated and at a different x and y coordinate where it forms a sea shell type pattern? Thanks
Detecting A Pattern
Hi all I am creating a bingo game in my learning curve to learn actionscript.
I have 6 cards set up on the stage as seperate movie clips and 25 dynamic text boxes on each with random numbers in each. What I was hoping was if someone could direct me to a tutorial or how to do pattern detection on each card, any line, 4 corners, Letter I etc etc. So that the game can determine if bingo has been achieved. I have all my blotters and every thing working now and this is the last step but do not have a clue where to start. Any help will be greatly appreicated.
RegExp Pattern Help
Hi all,
I'm trying to construct a RegExp pattern to use, but having no luck.
I'm tryng to match all digits [0-9] in a string that are not a part of a tag sequence.
i.e.
"this is a number 45 and th3r3 are <b0ld> numb3rs </b0ld> everywh3re 99!"
The pattern should match all digits except the ones inside a tag.
Does anyone have a solution for this?
Thanks.
Pattern Matching?
Has anybody ever seen actionscript code to implement pattern matching (i.e., regular expression matching)?
i have a PERL script that i desperately need to port to actionscript (it's a copy of the PHP unserialize() function--very useful). the problem is that it relies on pattern matching.
any help would be much appreciated. here' some of the PERL code...
PHP Code:
if ( $string =~ /^a:(d+):({(.*)})$/s )
{
print "Unserializing complex array ($string)" if ($SERIALIZE_DBG);
my $keys = $1 * 2; #keys in this serialized array
my @chars = split(//, $2); #turn the data into an array of chars
undef $string; #to save memory.
return unserialize_sub( {}, $keys, @chars);
}
Pattern Fill
Hi all,
I want to fill a selected area with a graphic selected by a user from a thumbnail gallery of patterns. For this i am importing that selected pattern (.jpg) in a movieclip and duplicating that movie clip (say 15 times) to cover the whole area to be filled.
Now the problems is flash is loading the same image separately for 15 times, hence taking so much time to have 15 instances of the same small image.
Is there any way to have that image to be loaded only once and we can reuse it as many times as we want to?
Pattern In Flash.
Hi everyone! I have created a pattern(all by myself!) and now I want it to display as a background in my glorious website. In dreamweaver I just assign it as a picture, but I want to publish the site in flash, and when I edit the html, and insert my pattern as image, but then my pattern is just visible on the outside of my swf(my swf's background is all white..)
Please help me on this one, I am utterly stuck!! JR
Replicating A Pattern
This time round i need to get the pattern drawn on the drawing board to be repeated on another area of the stage.I need it to be repeated 4x4 tile. Any idea??
Need Some Pattern Recognizing Help..
Hey all,
Again, I ran into trouble making tetris. Please take a look at the swf attached. None of the controls work yet - press the blue button to start/pause.
Take a look at it, and you'll see that some blocks go through others (which isn't supposed to happen). The blocks are managed into arrays of "yes" or "no". If the blocks below the current moving tetris block are "no", then that current tetris block will continue moving down. If "yes", it will become purple and initiate a new tetris block.
Now, please feel free to browse through the fla to see the structure. Test the movie in Flash and look at the check "yes" or "no" process with the traced commands.
Something is seriously wrong, and I don't know what. There seems to be a pattern of the blocks that go through others, but I can't find it out. (the swf may need to be run 2 or 3 times before a bug appears).
Thanks for your time!
Sound Pattern
Movie
http://www.ramieb.com/fla/flash_dump/soundpattern.swf
Fla
http://www.ramieb.com/fla/flash_dump/soundpattern.fla
Was messing about with a pesudo random pattern generator and the sound object to see what would happen, the sound pattern will change or morph over time......
interesting results, thought id share them
Ramie
Problem With Bg Pattern
Im trying to make a bg pattern fill the browser from flash. It does that now, but if you resize the browser to a larger size the pattern doesn't keep on appearing (understand?).
Plus, I've got this white frame around the edges of the browser... I want that to disappear
I don't think it should be so hard, but I didn't manage to figure it out. I've attached the files
Peace!
MVC Pattern And Delete
Hi,
I'm having a problem when trying to delete a small MVC app. I destroy all assets, remove the observers and delete the class objects, but it still seems to be stuck in memory.
Any help with dissolving a MVC relationship and assets from memory would be greatly appreciated.
Thanks!
Replicating A Pattern
This time round i need to get the pattern drawn on the drawing board to be repeated on another area of the stage.I need it to be repeated 4x4 tile. Any idea??
Need Some Pattern Recognizing Help..
Hey all,
Again, I ran into trouble making tetris. Please take a look at the swf attached. None of the controls work yet - press the blue button to start/pause.
Take a look at it, and you'll see that some blocks go through others (which isn't supposed to happen). The blocks are managed into arrays of "yes" or "no". If the blocks below the current moving tetris block are "no", then that current tetris block will continue moving down. If "yes", it will become purple and initiate a new tetris block.
Now, please feel free to browse through the fla to see the structure. Test the movie in Flash and look at the check "yes" or "no" process with the traced commands.
Something is seriously wrong, and I don't know what. There seems to be a pattern of the blocks that go through others, but I can't find it out. (the swf may need to be run 2 or 3 times before a bug appears).
Thanks for your time!
Sound Pattern
Movie
http://www.ramieb.com/fla/flash_dump/soundpattern.swf
Fla
http://www.ramieb.com/fla/flash_dump/soundpattern.fla
Was messing about with a pesudo random pattern generator and the sound object to see what would happen, the sound pattern will change or morph over time......
interesting results, thought id share them
Ramie
Pattern Fills
Hello,
Is there a way to create a pattern fill in Flash?
for example, if I want to create a shape and fill it with a black and white checkers board..
What's the way to do it ?
Thanks,
Y.
|