Dynamic Masking
Hi all,
newbie trying to do dynamic masking with externally loaded images. followed a tutorial that led me to this code:
Code:
//Make Mask
function dynmask(){
_root.createEmptyMovieClip('rectmask',1);
_root.rectmask.moveTo(0,0);
_root.rectmask.beginFill(0x000088)
_root.rectmask.lineTo(100,0);
_root.rectmask.lineTo(100,100);
_root.rectmask.lineTo(0,100);
_root.rectmask.endFill();
_root.maskme.setMask(_root.rectmask);
}
masker.onRelease = function(){
//Load Image
_root.createEmptyMovieClip('maskme', 0);
_root.maskme.loadMovie("http://farm2.static.flickr.com/1145/1075852283_69ddb14267.jpg", "pic");
_root.maskme._x = 0;
_root.maskme._y = 0;
dynmask();
}
syntax appears right, but its not working. this should be super simple.
I was clobbered over the head this morning when asked to get the site I'm working on to flow like this:
http://tronicstudio.com/
more specifically, the way the images transition when clicked on...the collections section. Its real slick, and I'm trying to figure out if its a dynamic mask or an image sequence. I need to make an XML powered gallery that works that fast.
any tips?
thanks!
- dan.
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 09-12-2007, 08:31 PM
View Complete Forum Thread with Replies
Sponsored Links:
Dynamic Masking
is it possible to mask multiple movie clips with the same mask using the setMask method?
i have a group of clips that must share a mask at runtime, and the last movie clip is the only one that is masked after looping through them and calling the setMask function on each of them.
View Replies !
View Related
Dynamic Masking
hi all ...
Im using Flash 5. I want to put a mask over an empty movieclip and then dynamically attach new movieclips to the empty one. The new movieclips should then be masked. However when I try this it doesnt work ... there doesnt appear to be any masking. Am I doing something wrong or is it just not possible?
thanks in advance ...
thesquirrel
View Replies !
View Related
Dynamic Masking
i've got two external swf loaded onto the main stage...
and i want
one mask over the other
so my script is like this,
HolderA.setMask(HolderB);
it doesn't work, why?
if not, how can I work it out right?
thx in advance
View Replies !
View Related
Dynamic Masking
I have this ripple masking effect I want to apply to 20 photos in an animation, one at a time. The masking effect has a total of 10 layers, every other layer would contain the same photo. Does any one know the easiest way to go about doing this. Are there any sample online I can check out?
Thanks :-)
View Replies !
View Related
Dynamic Masking
Hi there,
Here's my prob. I have a holder where my extern. files are loaded in.
I made a new mc and won't to use this as a mask.
I placed this on top off the holder layer.
Then I applied following code:
holder.setMask(maskMovieClip);
now I see the mask is on to off the loaded files(externals) but it's not masking.
How get this working?
Big thx in advance, grtz
View Replies !
View Related
Dynamic Masking
Hello, I am trying to make a movie where a dragable drill will go into a cut away block of wood and when the drill is removed the side view of the hole is left. I have no trouble with the start and stop drag of the drill and have it confined to just strait up and down.
I know I need a mask to show the hole. But I can't figure out how to make it work like an eraser and not just a window mask.
I have attached a swf that shows what I am trying to do. The drill in this goes in and when raised leaves a colored hole (side view) of where it was. Thanks for any help!!
View Replies !
View Related
Dynamic Masking Of JPG's
I am getting very strange results when I try to mask an MC that loads a dynamic JPG. The masking will work sometimes and not others. Also, I have noticed that if I have multiple keyframes on the mask layer, it causes problems too.
Is anyone else getting this?
Regards,
Brian.
View Replies !
View Related
Dynamic Masking
i want to create an effect in which the backround image builds in randomly block by block. kind of like mosiac peices the appear one at a time until the entire backround image appears.
please point me in the right direction to do this. open source?
View Replies !
View Related
Dynamic Masking
Ive attemtped to search for my problem in the Forum but havnt succeeded in finding the solution (not that it isnt there, just that I didnt find it).
Problem: I have a background image. I want to reveal another smaller image on top as if pulling a curtain across and then closing it again. I tried masking a white box over the smaller image but the white box conceals the background image. I know the solution is simple, I just dont know enough to do it.
View Replies !
View Related
Dynamic Masking
OK. I have 3 instances. One is draggable and will contain the information for the section (newswindow). The second is the button with the applied startDrag code, nested within newswindow (dragbutton). The third is a semi-transparent graphic I want to be masked by newswindow, so when the user drags newswindow the graphic remains stationary while newswindow (and thus the graphic's mask) is moving across the screen. The semi-transparent graphic and newswindow are on the _root level, while dragbutton is contained within newswindow.
The code I've applied to the semi-transparent graphic is (aside from setting the mask, the rest of this code is pretty much guess-work):
Code:
onClipEvent (load)
{
this.setMask(newswindow);
}
onClipEvent(mouseMove)
{
this.setMask(newswindow);
updateAfterEvent();
}
The code I've applied to dragbutton is
Code:
on (rollOver) {
dragbutton.useHandCursor = false;
}
on (press) {
dragbutton.useHandCursor = false;
_parent.startDrag(newswindow);
}
on (release) {
stopDrag();
}
Now, when I drag newswindow the semi-transparent graphic is not only unmasked, but also moves along with newswindow, rather than remaining stationary with a dynamic mask. Could someone PLEASE help me out with this problem? Could someone let me know what I'm doing wrong, or let me know a more efficient/easier way to get newswindow to be the stationary graphic's dynamic mask? Help will be GREATLY appreciated.
Thank you very much for your time,
Carl
View Replies !
View Related
Dynamic Masking Using AS
I have seen really cool dynamic masking used as a transition in flash banners, etc. I was hoping someone could steer me in the right direction toward duplicating this effect... Check out the main imagewindow here - www.billboard.com - notice how the dynamic 'wipe' changes each time? any help would be much appreciated!
View Replies !
View Related
Dynamic Masking
Hi,
How do i do a dynamic masking. ie: user draw a shape on the stage and clicks next button on the next screen only the shape he drew is masked. it looks like the part he selected is cropped.
can anyone help me to figure this out.
Thanks
Nameez
View Replies !
View Related
[F8] Dynamic Masking
Ok, I believe its done with the scrollBar component ... but I'm not sure.
Here is what I want to happen.
I have a single mc on the stage. Right now you can drag and drop (and a duplicate of that clip appears) ... However I need the dup'ed clips to be behide some kind of a mask.
Here is the twist, outside of the "Mask" there is a trash can, which users can drag any dup'ed clip to and it will erase it.
Please advise me on how this is possible.
If my explanation is not clear enough, I will try and make it more clear.
- Steven
View Replies !
View Related
Help With Dynamic Masking
I'm having a weird issue with a little script I wrote, and was hoping someone could spot the (probably boneheaded) mistake I'm making.
The code basically just draws circles at the above the top of the stage and then moves them downward until they're out of view, then removes them. Easy, right? Works fine, but when I apply the container with the circles as a mask, nothing moves.
Code:
var ldr = new Loader();
var urlrequest:URLRequest = new URLRequest(url);
ldr.load(urlrequest);
ldr.mask = mc_container;
addChild(ldr);
stage.addEventListener(Event.ENTER_FRAME, drawMask);
function drawMask(e:Event):void
{
var mc_mask:Sprite = new Sprite();
if( mc_container.numChildren < poplimit )
{
mc_mask.graphics.beginFill(0x000000,1);
var size:Number = Math.floor((Math.random()*100)) + 20;
var circlex:Number = Math.ceil(Math.random()*mc_bbox.width) + mc_bbox.x;
var circley:Number = 0 - (size * 2);
mc_mask.graphics.drawCircle(0, 0, size);
mc_mask.graphics.endFill();
var speed = Math.round((Math.random() * 5)) + 1;
mc_mask.x = circlex;
mc_mask.y = circley;
mc_container.addChild(mc_mask);
speedArray.push(speed);
}
moveMask();
}
function moveMask():void
{
for( var i:int = 0; i < mc_container.numChildren; i++ )
{
mc_container.getChildAt(i).y += speedArray[i];
if( mc_container.getChildAt(i).y > (mc_bbox.height + mc_container.getChildAt(i).height) ) {
removeMask(i);
}
}
}
The weird thing is, if instead of applying the mc_container object as a mask, I display it directly, I get black circles moving down the screen at various speeds, exactly like I'd expect. But when it's applied as a mask to the ldr movie (which is a swf, by they way), i get static circles that don't move anywhere. What the hell?
View Replies !
View Related
Dynamic Masking
I have a project where I let the user draw shapes to reveal a background image. However, if a user draws a shape clockwise, then draws another shape counter-clockwise, the to shapes subtract where they overlap, rather than just appearing as one shape.
Does anyone know a way around this issue? Ive tried making and masking a copy of the background for each shape, however, it gets bogged down as you add more shapes.
M
View Replies !
View Related
Dynamic Masking
Hi,
How do i do a dynamic masking. ie: user draw a shape on the stage and clicks next button on the next screen only the shape he drew is masked. it looks like the part he selected is cropped.
can anyone help me to figure this out.
Thanks
Nameez
View Replies !
View Related
Dynamic Masking
Hey all, below is a small function that I have made, its purpose is to load an image (filename) place it on the stage in a container movieclip, and then mask the image with an allready defined square on the stage (placement).
When i call the function once, it works fine, but when i do it twice, it only works the last time i call it... What am I doing wrong?
Code:
makePicture("picture1.jpg", "maskemc1", 1, 0, 0);
makePicture("picture2.jpg", "mask_mc2", 2, 0, 100);
function makePicture(filename:String, placement:String, theNumber:Number, xvar:Number, yvar:Number):Void {
createEmptyMovieClip("container"+tal, tal);
x = eval("container"+tal);
ref = this["mclListener"+tal];
var ref:Object = new Object();
ref.onLoadInit = function(target_mc:MovieClip) {
target_mc._x = xvar;
target_mc._y = yvar;
target_mc.setMask(placement);
};
ref2 = this["clipLoader"+tal];
var ref2:MovieClipLoader = new MovieClipLoader();
ref2.addListener(ref);
ref2.loadClip(filename, x);
}
View Replies !
View Related
Dynamic Masking?
This is the on going answer to an age old question of mine. How in the hell do you get a mask to acurately mask a movie clip. I can get a mask to move around with a motion tween but I can't get my movie clip to play while it is masking. I just stays static when it should be playing.
My end goal is to try to have some randomly moving movie clips floating around on a mask independent of assigned motion tweens.
In the past I have had no problem getting things to move around in a random fashion, and I have made dynamic/moveable masks (much easier with Flash MX). I have never been able to get both to work together.
Who's got the kung fu?
View Replies !
View Related
Dynamic Masking
Does anyone know where I could find some documentation on how to create dynamic masks such as the ones used on: http://www.digisoftstudios.com/ (in particular the transitions from section to section).
I'm thinking that this is done by either creating a movieclip of the box moving into position and then duplicating it with actionscript. Then again the animation of the box could be scripted as well. Any thoughts?
Thanks
p
View Replies !
View Related
Masking Dynamic Mc's
Hi guys!
Having a problem which probably has a pretty simple solution, but I just don't see it...
This is it: I'm dynamically loading jpg's into newly created MC's (createEmptyMovieclip) and doing it in such a way, that they'll stack on top of one another. This way I could later on - when the new one's loaded - make this appear with an expanding mask and when that's done, remove the previous one.
The problem here is, I just don't seem to be able to get the setMask to work on the newly created mc's. It'll work on anything, except for those.
I've put my code below... it's just a small portion of the whole bunch, but it's the part that's causing me a headache!
ActionScript Code:
imageCounter = 1;
function loadNewImage(image){
// count +1 for new depth
imageCounter += 1
//create it
_root.createEmptyMovieClip("newMovie"+imageCounter,imageCounter)
_root["newMovie"+imageCounter]._x = imageCounter *100;
//just trying to fix the object this way = test
tempObj = ["newMovie"+imageCounter];
//trace("temp" + tempObj);
// setting the mask
_root.tempObj.setMask(_root.maskImages);
//attach the loader and it's events
_root.attachMovie("mainImageLoader", "mainImageLoader",1000);
_root.mainImageLoader.onEnterFrame = function(){
mainImgGeladen=_root["newMovie"+imageCounter].getBytesLoaded();
//trace(mainImgGeladen);
}
// now were done - LOAD IT
_root["newMovie"+imageCounter].loadMovie(image, "none")
}
Thanx in advance
View Replies !
View Related
Animated Masking A Dynamic Image Is Causing Dynamic Image To Disappear Intermedently.
You can find the file here of what I am trying to do:
http://www.yourfilelink.com/get.php?fid=462218
Please tell me if you are having problems downloading it.
This has always irritated me and I can't seem to find a way around it.
I dynamically load an image to a movie instance and the movie instance is masked. The masking is animation on it, so that it looks like the image is animated via masking. It works if the masking animation is one long shape motion tween, but if I make the masking animation frame by frame, the image being masked disappears and reappears only when it is a long shape tween of the mask.
Please refer to the downloadable sample to understand what I mean. Is there a way around this?
I have seen page flip samples that is able to do what I am trying to do, but they used really advanced actionscripting to do this. I am using timeline.
View Replies !
View Related
Masking Dynamic Text?
After spending the most of this day doing the tutorial by Patrick on scrolling text (the easy one without the scroll bar) I finally got it.....BUT???? the scrolling text is in a masked layer whish evidently keeps the text from apearing? When I drag the layer out from the mask everything works fine and I can see the text and scroll it but as soon as i put it back under the mask the dynamic text doesn't show? the text is written in the action script of the movie clip object as described in the tutorial? HELP?
View Replies !
View Related
Masking Dynamic Text
hey guys,
I was just wondering it was possible to mask dynamic or input text. I tried doing it and it didnt work. But when I changed the text to static everything worked fine. Any ideas. Thanks for the help guys
Don
View Replies !
View Related
Masking Dynamic Text
is there any way you can use a mask layer on dynamic text? every time i attempt it the mask layer always seems to be ignored when it is made into a swf file.......
please tell me someone knows what i'm talking about....
View Replies !
View Related
Masking A Dynamic Component
I created a dynamic table that shows countries and values for each country (from a text file).
That table was created with attachMovie
I want to display on the stage only a small portion of the table, so I want to mask it.
I tried using a mask in the upper layer but then it didnt display the data.
Note: The move hierarchy is: _root > component Table > Movie Clip Table > (Script which create the table).
¿Is there any way to do it by Actionscript or with scrollpane component? (or other way).
Ive tried with scrollpane but it dindnt show the dynamic data, only the graphics.
Thanks in advance,
Asterix.
View Replies !
View Related
Masking Dynamic Text?
At least it's seems its being done on this site -->
http://www.code-media.com/home.htm
(in the leftdown corner)...
How is it done? Is it done using a pixelfont? Or maybe err... AARGH, pls help me out... I'm trying to
make sharp looking (like dynamic text is) fonts (preferable arial) mask. Thus far I have not succeeded
View Replies !
View Related
Masking Dynamic Text
Is it not possible to mask dynamic text fields? My text just dissappears when I place a mask layer above it... If I change the text to static it appears... I need to use dynamic text so I can use a scoll bar on it!
Cheers,
GP
gp@1lg.com
View Replies !
View Related
Masking Dynamic Textboxes In FMX?
Hi All,
I can't display any text in dynamic textboxes when they're on a mask.
If I put a mask on a dynamic textbox, nothing shows... the cursor changes into the text editing cursor but no text appears. If I put the textbox outside a masked layer, then it does show...
How is this possible, and how can I mask a dynamic textbox???
Anyone?
Best,
-- Jaron
View Replies !
View Related
Masking Dynamic Text
Hello,
i have a movie with 2 layers
one is a mask animation the other contains a dynamic text field
on playing a movie i dynamic set text for the text movie but the text only shows once then vanishes then the masking animation plays
Can you mask dynamic texts?
Kendall
View Replies !
View Related
Dynamic Text Box's Masking
Please Tell me how can i mask a dynamic/input text box.
i am using Flash MX, and when i mask a Dynamic / Input Text Box, Nothing is Displayed.
If some one can send me sample fla, i will be thankfull to him.
Thank u
View Replies !
View Related
Dynamic Text + Masking
Is there a way to get a mask layer to stay on top of text that loads dynamically? Since the mask is premade, I've got it over everything except the text and a curveto movie clip which load at run-time. I tried making the mask into a movieclip and setting a depth for it to stay on top (which works for graphics but not masks apparently).
View Replies !
View Related
Masking Dynamic Text?
Hi..
I have a movie with a clip that has dynamic text.
I have set up a mask for the layer with the clip in it, and when I have the project opened on the stage, it looks fine, but when I test the published movie, the dynamic text disappears.. Any ideas? Is this a "known issue" with Flash MX or a bug?
If I change the text to static text, the mask works correctly.
Thanks,
Rich
View Replies !
View Related
Dynamic Masking On Loadmovies
I want to have a same dynamic mask on my each load movie when it is called.
Actually I am trying to have duplicate movieclip which build a grid step by step and act as a dynamic mask and whenever movie loads it plays and reverses itself on new movieload do the same again.
Help is always appreciated
Thanks.
View Replies !
View Related
Masking Dynamic Images
Hi everyone.....I'm using Flash MX and am having a problem masking dynamic pictures. Can this be done?
The code I have on the first frame of my actions layer is this:
stop();
images =new Array("image0.jpg","image1.jpg","image2.jpg");
function randomImage(){
randomNumber = random (images.length);
loadMovie (images[randomNumber], "_root.background");
}
randomImage();
I get the random images to show up but not so much with the masking.
Thanks for the help!
View Replies !
View Related
Masking Dynamic/no AA Text
Hey, everybody.
I've been using Flash since Flash 3, and I've finally gotten pretty good at it lately (as far as I'm concerned, anyway). I'm also a long-time FlashKit fan and this is my first visit to the forums (but I will definitely be a frequenter from now on).
My new website design is comprised of 100% Flash (here is a pic of what is done so far). Normally, if I run into a problem I can think of a way to fix it and do so.
However, this one's a doozy
Naturally, I do not want all of the text loaded into the content frame to be AntiAliased, because it's though on the system. Easy enough, just make it dynamic text. Well, come to find out, you can't mask Dynamic Text. With the scrollbar code I wrote I need to be able to mask the text.
So my question is this: is there any way to mask Dynamic Text, or to make Static Text not AntiAliased?
Thanks in advance, any help is greatly appreciated!
--AcidGoat
View Replies !
View Related
Masking Dynamic Text
Hi,
I know all about masking text using embedded font but I am trying to mask dynamic text and it does not work. I created a movieclip and named it content. There is only one frame with actionscript:
this.createTextField("actionText",1,0,0,420,220);
actionText.html = true;
actionText.type = "dynamic";
actionText.multiline = true;
actionText.font = "ArialEmbed";
actionText.embedFonts = true;
actionText.textColor = 0x000000;
actionText.wordWrap = true;
function loadExplanation(butText){
loadVarsText = new loadVars();
loadVarsText.load(butText);
loadVarsText.onLoad = function(success) {
if (success) {
actionText.htmlText = this.fieldContents;
}
}
}
loadExplanation("introduction2.txt");
As you can see I created a new font based on Arial.
Then on the main stage I put a mask (maskClip) and then this actionscript:
content.setMask(maskClip);
The text only shows up when I remove
actionText.embedFonts = true;
but is of course not masked. When the line of code is present the text is never visible.
Any ideas?
View Replies !
View Related
Dynamic Images And Masking?
Hi, i'm building a dynamic photo gallery. Everything is working fine, I decided to add a masking effect to the photos, as soon as i do this the images don't show? Any ideas?
I'm masking the layers which contain the MC which are used as a dropzone.
Anyone have any ideas, i would greatly appreciate it
View Replies !
View Related
|