Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




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!



FlashKit > Flash Help > Flash Newbies
Posted on: 10-28-2002, 01:34 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

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?

Fill In Pattern Problem..
Hello everyone...

ok here...I just make a draggable bg pattern..which is work ok...my problem is how to fill in the "mc1" or "mc2" with this bg pattern...is it I have to duplicate it..?..when it being drop in "_droptarget"...my second problem is how to remove my previous drag pattern type if I drag a new pattern into the "_droptarget"....

this is my file u guys can take look at it...

http://www.geocities.com/mrkiey/drag.fla


Code:
stop();

for (j=0;j<11;j++){
this["p"+j].jvar = j;
//trace(this["p"+j].jvar);
this["p"+j].onPress = loadPaten;
this["p"+j].onRelease = this["p"+j].onReleaseOutside = dropMe;
}



function loadPaten(pttn){
this.thisDrag = new Object();
this.thisDrag = _root.attachMovie(this.jvar,this.jvar,400+this.jvar);
this.thisDrag._x= _root._xmouse;
this.thisDrag._y= _root._ymouse;
this.thisDrag._xscale=200;
this.thisDrag._yscale=200;
startDrag(this.thisDrag);
}

function dropMe(){
this.thisDrag._xscale=100;
this.thisDrag._yscale=100;
stopDrag();
trace(_droptarget);

}
tq again

Fill In Pattern Problem..
Hello everyone...

ok here...I just make a draggable bg pattern..which is work ok...my problem is how to fill in the "mc1" or "mc2" with this bg pattern...is it I have to duplicate it..?..when it being drop in "_droptarget"...my second problem is how to remove my previous drag pattern type if I drag a new pattern into the "_droptarget"....

this is my file u guys can take look at it...

http://www.geocities.com/mrkiey/drag.fla


ActionScript Code:
stop();        for (j=0;j<11;j++){            this["p"+j].jvar = j;            //trace(this["p"+j].jvar);            this["p"+j].onPress = loadPaten;            this["p"+j].onRelease = this["p"+j].onReleaseOutside = dropMe;        }        function loadPaten(pttn){    this.thisDrag = new Object();    this.thisDrag = _root.attachMovie(this.jvar,this.jvar,400+this.jvar);     this.thisDrag._x= _root._xmouse;    this.thisDrag._y= _root._ymouse;    this.thisDrag._xscale=200;    this.thisDrag._yscale=200;    startDrag(this.thisDrag);}function dropMe(){    this.thisDrag._xscale=100;    this.thisDrag._yscale=100;    stopDrag();    trace(_droptarget);    }


tq again

Flash Pattern Fill
ok, I've searched the forums, searched google, and no advice, tut is helping me out.

I'm trying to tile an image in flash but it gets all stretched out - not tiling.

I've tried importing the gif, making shape, placing gif on stage, breaking it apart, then sampling it with eyedropper, then use bucket to fill, as one tut said to do. This isn't working.

Also, tried making shape, selecting Bitmap in color properties, then filling shape with, but it doesn't work. Stretched out. Tried making shape with Bitmap as fill, and this doesn't work. What's the deal????

Can someone please help.

Pattern Fill With Problem
help with this flash please what i am trying is to fill it with the grid pattern but when i resize window it's duplicating it ... download fla to better understand what i am trying to say thank you


www.malikmata.com/patternfill.fla

45 Degree Line Fill Pattern Help
I'm wanting to use a 45 degree line fill pattern on a Flash interface, but get the look I want.

The effect I'm looking for is used on countless other sites, examples being the "Auxiliary Panel" on the Flash index page of www.2advanced.com, and the background image used on http://archiv.style-force.net/v8/index.htm.

I assumed creating this affect would be the easiest thing in the world - but after drawing a 45 degree line in Flash and then experimenting with numerous different line styles and sizes, still can't get that look.

The problem seems to be that the lines I draw remain strong and sold, whereas the lines I want to create appear more blocky and aliased.

I'm feelin really stupid now, so any help in doing what I imagine is really simple, would be appreciated. Thanks in advance.

Fill Mc With A Pattern Image In The Library
hi all,

i'm creating an mc and i would like to have it filled with a bitmap image that sits in my library. After digging in the documentation i ended up with this code, but it does not seem to work, nothing is rendered:


ActionScript Code:
var preloaderBar:MovieClip = this.createEmptyMovieClip("preloaderBar",this.getNextHighestDepth());
preloaderBar._x=0;
preloaderBar._y=180;
preloaderBar._width=Stage.width;
preloaderBar._height=20;
var bmpd:BitmapData = BitmapData.loadBitmap("stripes");
preloaderBar.attachBitmap(bmpd,preloaderBar.getNextHighestDepth(), "auto",false);

any idea?

Pattern Fill With Action Script?
Hi,
Anyone knows if it's possible to fill a rectangle with a bitmap with action script?
Thanks.

Newbie Question - Creating Custom Fill Pattern
Greetings,

I'm trying to make TV scan lines as a background and I have the lines as a 2x2 jpeg. How do I create a custom fill from this to use as a backgound? In other words, how do I make an image the fill.


Thanks,

Stephen

Fill Changes Through Scripting (the Fill Being A Jpeg)
i'm looking for a way to control the fill of an elipse (an external jpeg), through scripting, loading in another via a selection menu.

at present the jpeg is limited by a mask i have over it (showing only the elipse shape i want), but i'd like to make this object moveable so treating it as a fill would simplify (and hopefully speed up) the process.

any help i'd be grateful

How Do U Fill A Shape Once U've Deleted The Fill
I have a problem, i have a button, i deleted the fill accidently, how do i go about filling it again, i am a beginner!

Why I Can't Fill "fill Color" When I Draw A Shape With The Pen Tool?
The title says it all, when I draw a shape with the pen tool I can't fill the fill color for the shape, I only can change the stroke color.
By the way, I'm sure I have connected all the lines for the shape

How Do I Fill Another Textbox As I Fill The First One
Hi,

what I need is, that as a user is filling in his name in the text box for the name field, the input textfield for the email id starts getting filled simultaneously...

for e.g. the user starts typing in
John Doe
the email field should become
John.Doe@domain.com

but it should go like... when the user types "J"
the email field becomes "J@domain.com"

and when he hits the space bar it becomes a dot in the email field

do you think it can be done... i think we can use listenersfor the same but have never used them... can neone help

Fill / Not Fill All The Screen...?
hello!

um, i didn't have any luck searching threads, so i'll have to ask:

how would i proceed if i wanted to make the background mc always cover all the screen, but other movies on top of it would always stay centered & never resizing? all i know is how to make flash movie fill screen by setting all the marginals at 0 and so on.

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.

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.

Pattern Generator
I have absolutely no idea what this is, but I enjoyed making it.

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

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

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 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.

Fullscreen Pattern
hi!

i want my flash to be window filling no mather what res. No problem, but only when having a regular fill color as background clip. It stretches to the edge
But i want to use a digonal stripe pattern in my background. How do i do this?

btw, don't have to be diagonal lines, can also be a grid or something liek that. Just don't want to resize it, i want it to tile like it would in html.

thanks.

Pattern Editor
Im building a pattern editor in flash (kinda like fruity loops). The general idea is that you can load a sample and click on one of 16 buttons to place the sound in relation to time. The editor is time based, so the movie isnt dependant on framerate. This way i can let the usre determine the speed of playback. There is a problem however. Probably caused by the flashplayer the editor doesnt run as tight as the real thing (fruity). Im talking about a difference in milliseconds here but its obvious enough.

Is there anything I can do to solve this?

THNX
Jan

Randomize Pattern
I'd like aan action script to random a pattern with 2 movieclips. The movieclips are both square 20x20 pixels, but they have a different color. Let's say I want 15 squares (movieclips) on the x axes en 8 on the y axes.
Each time you load, the pattern will looks different, not in the form (15 squares x 8 squares) but in color impression.
I have to work with speciaal colors, is not possible voor what I need to randomize the value of r, g, b.

Thanks

worfoual

How May I Create A 5x5 Pattern With One Single Mc?
How may I create a 5x5 pattern with one single mc?

mc:

o

5x5 pattern:

o o o o o
o o o o o
o o o o o
o o o o o
o o o o o

Pattern Background Problem
HI all,
Im working on a website at the minute and have a pattern background at 800X600 pixels but when the browser is made bigger. Say 1024X768 I have a white border that fills the gap how can I solve this problem as simple as possible, without a pop up

Thanks

Background Pattern In Flash
hello, i'm working on my new site and i'd like to try to make it all in flash... but i have a problem... i want to make a background pattern so that the viewer doesnt have to download a giant image... but is it posible?!
also there must come more tiles when the user resizes the browser window because the site is full screen.. i was thinking about something with duplicateMovieClip() but ik can't figure out how to do it...

by the way could you also check out the menu bar...(link) when you click at one side of the bar it will go to an other side of the screen... does it work well and doesn't it take to much cpu?!

i hope that anyone can help me!

Putting Pattern Background In My SWF
Hi,
Im making a new web site (all in flash) and im trying to do something new (for me).
i want the site to have a background like this (see file included),
my question is -
should i just put it on the lower Layer in the SWF,
should i load it and then put it,
is there any other option?

any other suggestions are most welcome,
Avi.

Pattern Mangles On Import
im bringing in a shot from PS that has a dotted pattern of 1 pixel squares across it and when i export the flash movie, there is a glitch in the pattern. it joins two rows of dots when there is supposed to be a space there. any idea how to get around this type of thing. i have redone the pattern in photoshop and its not in the original.

[F8] Loading SWF In A Pattern And By Priority..
Hi all..

k.. What i have is a Main movie that has a list component which loads label names and data numbers from an xml file.. when i select an item from the list the name and data will show in a dynamic txt field.. next to that txtfield i have a button which loads a swf file with a countdown script into a container MC on the stage.. this swf gets the name and number values from the txt fields and starts to count down from the number it just got from the the txt field.. when it has finished counting.. it deletes itself..

What i want is the ability to press the button again and then load another instance of the swf into the same container.. but in a pattern and by priority.. ect. if MC 2 finishes its countdown it will delete itself.. and the other MC's will relocate by priority (from the one which has been loaded first to the one loaded last.. something like this below:

-- MC 1 -- -- MC 5 -- -- MC 9 --
-- MC 2 -- -- MC 6 --
-- MC 3 -- -- MC 7 --
-- MC 4 -- -- MC 8 --

and so on...

How do i do something like this..? and is it possible at all.? any ideas??
thx in advance

PS. sry for my bad spelling and unclear description.. i hope you understand what i mean...

Spiral Pattern With DuplicateMovieClips
I'm practicing working with rotation and patterns in flash, im working on createing a simple spiral pattern, using duplicateMovieClips. I was hoping to achieve clips starting at the center and getting progressively bigger.

At the moment i have the starting at the center and scale thing down but i cant seem to create a spiral pattern. The best i have achieved is a circle, can someone point me in the right direction.


setProperty('newclip' + i, _x, 200);
setProperty('newclip' + i, _y, 550);
setProperty('newclip' + i, _rotation, 360/30*i);

Is this approach overly simplistic for what im trying to achieve?

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

Copyright © 2005-08 www.BigResource.com, All rights reserved