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




[F8] Apply Filter To Mc Drawn With Api



Obvioulsy I'm blind.... WHY is't this code working...??!!!!!


Code:
import flash.filters.GlowFilter;
this.createEmptyMovieClip("mc_line",1);
with ("mc_line"){
lineStyle(20, 0xd1bca3,100);
_root.moveTo(0, 160);
_root.lineTo(Stage.width, 160);

// glow on the line
var glow:GlowFilter = new GlowFilter(0x003a68, 0.5, 0, 10, 5, 10,true);
var myTempFilters:Array = mc_line.filters;
myTempFilters.push(glow);
mc_line.filters = myTempFilters;
}



I've tried the glow-on-the-line part inside and outside the with statement.
The glow-on-the-line part works fine if I put an instance of a movie clip on the stage but not as above...

Why?!

I'd be greatful for a hint in the right direction...



FlashKit > Flash Help > Flash ActionScript
Posted on: 09-26-2006, 12:11 PM


View Complete Forum Thread with Replies

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

Bitmapdata, Apply Filter To One Channel? Realease A Filter
Hi there, I have two question:

Is it possible to apply a filter only to one channel or to access only one channel?
I've found somewhere:
Display.BitmapData.Channel.ALPHA
Is it something we can access at runtime?


When I appply a filter to a Bitmapdata, the Bitmapdata isn't really modified but just filtered, so if for example I copy one of its channel to another bitmapdata, I copy the source bitmap without the filter...
What I'd like to do is "release" the filter so it definetely modify the image. Is it a function to do so or can I only perform this by doing a screenshot of my MovieClip?


Thank you inadvance for your help.

How To Apply More Than One Filter Via Script...
Hi all...
Like the topic says...

How can I apply two filters (ie. Glow and Blur) via script on the same MC?

Thanks...

Apply Filter @ Runtime
hi everybody.


I've got 4 dynamic TextFields inside a MovieClip.
on onRollOver I want to apply a DropShadowFilter to this MovieClip, and on onRollOut I want to remove the DropShadowFilter.

pretty simple task, I hope
..how do I do it?


here's my onRollOver and onRollOut-code:

ActionScript Code:
allContainer_mc.textHolder10.onRollOver = function(){
    trace("onRollOver");
}
//
allContainer_mc.textHolder10.onRollOut = function(){
    trace("onRollOut");
}



thanks

Apply Website Transition Filter?
Hey I'm new to AS , so I was wondering how would I go at attempting this?

On the website I'm building , I currently have it so when you click a link, it removes the current page and animates a new one, really simple, but how would I apply a filter transition? I downloaded a blur filter and installed it to flash cs3, so instead of just removing a page and motion tweening the new one, i would like to just do a motion blur tween between the current page, and the page clicked, how would I do that? This is my current code.



Should I upload the .fla file?

(EDIT) why wont it let me upload my code in CODE brackets? it gives me this error:

You have included 5 images in your message. You are limited to using 4 images so please go back and correct the problem and then continue again.

Change Color Then Apply Filter?
I have a simple circle movie clip in my library. The circle is green. I would like, at runtime, to change its color to blue, red, whatever. Then I want to apply a bevel filter to it.

The problem is that after I apply the color, the filter is ignored.

//First change color
var changeColor = new Color(mcCircle);
changeColor.setRGB(bitOnColor);

//Then apply filter
var innerBevel:BevelFilter = new flash.filters.BevelFilter();
var myFilters:Array = mcCircle.filters;
myFilters.push(innerBevel);
mcCircle.filters = myFilters;

Clearly I'm missing the point here. Anyone know the right way to do this? Thanks very much.

-jheske

Apply Text Filter Dynamically
How can I add a glow filter to a textfield via actionscript? I know the procedure for doing the same thing with a movieclip, but the TextField class (and TextFormat) don't seem to accept filters as a property?

What I have so far:


ActionScript Code:
import flash.filters.*;var text_glow:GlowFilter = new GlowFilter(0xFF0000, 80, 10, 10, 100, 3, false, false);var some_txt:TextField;//Want to apply filter to text field  

Unable To Apply Blur Filter
The code below fades three mc instances into each other. The movieclip instances are called, picture1_mc, picture2_mc,picture3_mc. They are based on three bitmap images that also sit in the library. I manually converted the original bitmaps into movieclips on the stage area. The fade code works fine, but what I would like to do is allow the user to
mouse click and cause a blur effect whilst the images are cycling along. My problem is that Im not sure how to apply this within my mousedown function. The applyFilter method seems to call for bitmaps but I'm dealing with movieclips. Thanks for any guidance
import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.filters.BlurFilter;
var filter2:BlurFilter = new BlurFilter(Math.ceil(Math.random()*5), Math.ceil(Math.random()*5), 3);

init = function () {
currentIndex = 1;
currentLayer = 1;
howLongToWait = 0;
_root.attachMovie("picture1_mc", "pic1", 0);
addNewPic();
};
addNewPic = function () {
clearInterval(myInterval);
if (currentIndex%3 != 0) {
currentIndex++;
} else {
currentIndex = 1;
}
newlyAdded_mc = _root.attachMovie("picture"+currentIndex+"_mc", "pic"+currentIndex, currentLayer++);
newlyAdded_mc._alpha = 0;
newlyAdded_mc.onEnterFrame = function() {
this._alpha += 2;
if (this._alpha>=100) {
this.onEnterFrame = null;
myInterval = setInterval(addNewPic, howLongToWait*100);
}
};
};
// run init()
init();
onMouseDown = function ()
{
//problems here!!!!!!!!!
var pointoint = new Point(_root._xmouse, _root._ymouse);
var rec:Rectange = new Rectangle(100,100,6,6);
//problem applying filter
//????.applyFilter(?????,rect,point,filter2)
};
myListener = new Object();
Mouse.addListener(myListener);

[AS3.0] Apply Filter To TextField Programmatically
Hi there!

I tried this using

Code:
textField.filters = [new GlowFilter()]
or just like in Flash8 passing the .filters array ref to another array and pushing filter to that array [was it?], but none of these steps worked.

Applying filter to Sprite, within which the TextField (_title) is contained:
Code:
var tit:Sprite = new Sprite();
tit.addChild(_title);
tit.filters = [new GlowFilter(0xFFFFFF,1,5,5,2,2)]
addChild(tit);
worked, however this method (using extra sprite for a textfield) is just too dirty, let alone we want to apply filters to multiple textfields..

Anyone knows how to apply filter directly to TextField instance in AS3.0?

Thanks!

Apply Filter To Just One Bitmap Data, No The Others?
Greetings,

I was following lee's tutorial on how to create advanced effects on bitmap data (like using the blur filter). I am not used to working with bitmap data and don't find it's creation and structure intuitive. Something I am not understanding is how to just blur a single clip and build the draw loop so that only that clips bitmap data gets drawn and blurred while other clips stay untouched. Any object I put onto the main timeline ends up bluring. I tried creative a sprite that contained the clip and then targeted that sprite, but still, any clip, or any object on the stage was blured and redrawn. Any help would be appreciated. Thanks!
Code:

import caurina.transitions.*;

var bmd:BitmapData = new BitmapData(550, 400, true, 0x000000);
var bm:Bitmap = new Bitmap(bmd);

var s:Sprite = new Sprite();
addChild(s);
s.addChild(bm);

var bf:BlurFilter = new BlurFilter(8, 8, 3);
var cmf: ColorMatrixFilter = new ColorMatrixFilter([1,0,0,0,0,
                                       0,1,0,0,0,
                                       0,0,1,0,0,
                                       0,0,0,1,0]);

var logo:Logo = new Logo();
s.addChild(logo);
logo.scaleX = logo.scaleY = .14;

function mover(){
   var myY:Number = Math.random()*stage.stageHeight;
   var myTrans:String
   myY <= logo.y ? myTrans = "easeOutExpo" : myTrans = "easeOutBounce";
   Tweener.addTween(logo,{x:Math.random()*stage.stageWidth,
                        y:myY, time: 1,
                        rotation:Math.random()*300, onComplete:mover,
                      transition:myTrans});
}


mover();

addEventListener(Event.ENTER_FRAME, loop);

function loop(e:Event):void{
   bmd.draw(s);
   bmd.applyFilter(bmd, bmd.rect, new Point(0,0), bf);
   bmd.applyFilter(bmd, bmd.rect, new Point(0,0), cmf);
   bmd.scroll(0, -5);
}

Apply Animated Filter To An Image
I'm at war with this code for a week now .. I managed to get ripple effect, but it doesn't apply to image positioned behind. So I need some directions on how to achieve that.
Right now the image is steel and doesn't move with the ripples. Any help is appritieted

The code itself is in 2 classes, first is Ripples.as
Code:

package
{
   import flash.display.Sprite;
   import flash.events.*;
   import RippleCanvas;
   public class Ripples extends Sprite {
      private var subobj:RippleCanvas;
      public function Ripples() {   
      trace("Ripples Initialized");
      var subobj = new RippleCanvas();
      this.addChild(subobj);

      }
   }
}


And second is RippleCanvas.as
Code:

package
{
  import flash.display.Bitmap;
  import flash.display.BitmapData;
  import flash.display.Sprite;      
  import flash.events.*;
  import flash.events.*;   
  import flash.geom.*;   
  import flash.filters.*;
  import flash.display.BlendMode;
   public class RippleCanvas extends Sprite
   {
      internal var sourceBmp:BitmapData;      
      internal var paintBmpData:BitmapData;
      internal var paintBmpData2:BitmapData;      
      private var buffer:BitmapData;      
      private var paintBmp:Bitmap;
      private var output:Bitmap;
      private var brush:Sprite;
      private var logo:Sprite;
      private var filter:BitmapFilter;
      private var filter2:BitmapFilter;
      private var disp:BitmapFilter;
      private var outputBmpData:BitmapData;
      private var surface:BitmapData;
      internal var pt = new Point(0,0);
      internal var matrix1 = new Matrix();
      public function RippleCanvas()
      {
         paintBmpData = new BitmapData(128, 98, false, 0x40);
         //new image(166,240);
         paintBmpData2 = new image(166,240);
         //new BitmapData(128, 98, false, 0x40);
         logo = new Sprite();
         brush = new Sprite();
         brush.graphics.beginFill(0xFFFFFF,1);
         brush.graphics.drawCircle(0,0,4);
         trace ("RIppleCanvas started..");
//         surface = new BitmapData(128, 98, true, 0x000000);         
         surface=new image(166,240);
         surface.blendMode = BlendMode.ADD;
         surface.draw(logo);
         sourceBmp=new image(166,240);
         sourceBmp.blendMode = BlendMode.ADD;
//             sourceBmp = new BitmapData(128, 98, false, 0x40);                              
         buffer = paintBmpData.clone();         
         outputBmpData = new BitmapData(128, 98, false, 0x40);
         //new image(166,240);
         scaleX = 8.0;
         scaleY = 8.0;
         this.addEventListener(MouseEvent.MOUSE_DOWN, this.downEvent, false, 0, true);                                             
         this.addEventListener(MouseEvent.MOUSE_UP, this.upEvent, false, 0, true);   
         this.addEventListener(Event.ENTER_FRAME, this.update, false, 0, true);         
         paintBmp = new Bitmap(paintBmpData);
         var cmat:Array = [ 1, 1, 1,1, 1, 1, 1, 1, 1 ] ;
         filter = new ConvolutionFilter(3, 3, cmat, 9, 0);
         filter2 = new BlurFilter(4,4);
         output = new Bitmap(outputBmpData);
//         output.blendMode = BlendMode.ADD;               
//         paintBmp.blendMode = BlendMode.ADD;
         addChild(output);         
         addChild(paintBmp);
         //var tf = new TextField();
         //tf.text = "testing123";
         //addChild(tf);
      disp = new DisplacementMapFilter(paintBmpData2, new Point(), 4, 4, 48, 48, DisplacementMapFilterMode.IGNORE );
      this.filters = new Array(new BlurFilter(16, 16));
         this.blendMode = BlendMode.ADD;
      }
      function update(e:Event)
      {
         if(parent!=null){
               var localPt:Point = parent.globalToLocal(new Point(parent.mouseX*0.125, parent.mouseY*0.125));                              
               var m:Matrix = new Matrix();
               m.translate(localPt.x, localPt.y);
               sourceBmp.draw(brush, m, null, 'invert');
            }
         trace (localPt);
         paintBmpData.applyFilter(sourceBmp, paintBmpData.rect, pt, filter);
         paintBmpData.draw(paintBmpData, matrix1, null, 'add');
         paintBmpData.draw(buffer, matrix1, null, 'difference');         
         paintBmpData.draw(paintBmpData, matrix1, new ColorTransform(0, 0, 0.98609374, 1, 0, 0, 2, 0));         
         paintBmpData2.draw(paintBmpData, matrix1);
         outputBmpData.applyFilter(surface, outputBmpData.rect, pt, disp);
         buffer = sourceBmp;
         sourceBmp = paintBmpData.clone();
      }
      public function downEvent(e:Event)
      {      
         if(e.stageX == 0 && e.stageY == 0)
            return;
         var curPt:Point = parent.globalToLocal(new Point(e.stageX, e.stageY));
         e.stopPropagation();
      }
      public function upEvent(e:Event)
      {
         e.stopPropagation();            
      }
   }
}


Code itself is in a mess right now as I tryed every single combination, without any success.. so plz help

How To Apply Blur Filter On Image In Different Layer?
I have one load which loads image randomly from external folder.

and another layer which has 5 columns. I wish to do a mouse over thing and one of the column will become blur.


I tried to use the blur filter, but can't seem to get it work on image that loads randomly from external folder.

this is the action script code I used for loading external images:

Quote: pic_arr = ["images/1", "images/2", "images/3", "images/4", "images/5"];
onLoad = function() {
ranNum = Math.floor(Math.random()*pic_arr.length);
holder_mc.loadMovie(pic_arr[ranNum]+".jpg");
};



any help?

Unable To Apply Blur Filter On Mouse Down Event
The code below fades three mc instances into each other. The movieclip instances are called, picture1_mc, picture2_mc, picture3_mc. They are based on three bitmap images that also sit in the library. I manually converted the original bitmaps into movieclips on the stage area. The fade code works fine, but what I would like to do is allow the user to
mouse click and cause a blur effect whilst the images are cycling along. My problem is that Im not sure how to apply this within my mousedown function. The applyFilter method seems to call for bitmaps but I'm dealing with movieclips. Thanks for any guidance

import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.filters.BlurFilter;
var filter2:BlurFilter = new BlurFilter(Math.ceil(Math.random()*5), Math.ceil(Math.random()*5), 3);

init = function () {
currentIndex = 1;
currentLayer = 1;
howLongToWait = 0;
_root.attachMovie("picture1_mc", "pic1", 0);
addNewPic();
};
addNewPic = function () {
clearInterval(myInterval);
if (currentIndex%3 != 0) {
currentIndex++;
} else {
currentIndex = 1;
}
newlyAdded_mc = _root.attachMovie("picture"+currentIndex+"_mc", "pic"+currentIndex, currentLayer++);
newlyAdded_mc._alpha = 0;
newlyAdded_mc.onEnterFrame = function() {
this._alpha += 2;
if (this._alpha>=100) {
this.onEnterFrame = null;
myInterval = setInterval(addNewPic, howLongToWait*100);
}
};
};
// run init()
init();
onMouseDown = function ()
{
//problems here!!!!!!!!!
var point:Point = new Point(_root._xmouse, _root._ymouse);
var rec:Rectange = new Rectangle(100,100,6,6);
//problem applying filter
//????.applyFilter(?????,rect,point,filter2)
};
myListener = new Object();
Mouse.addListener(myListener);

Apply Glow Filter On Target MC While Dragging An Object And Rolling Over The Target
I can get my filter to apply to a movie clip if i simply rollover or roll out of it. When the mouse rolls out, the filter is set to undefined. The problem I am having is that I want the object that is in effect the hit area to glow (have a filter applied) when the draggable object is being dragged over it.

This would make is easier for the user to visually identify that where they are currently hovering over, whilst dragging, is the area that they should drop the object.

Part of my code looks like this


Code:
this.onRollOver = function () {
if(_global.isDragging == 1){
this.filters = glowFilterArray;
}
}



this.onRollOut = function () {
_global.isDragging = 0;
this.filters = undefined;
}
_global.isDragging is set to 1 at the onPress stage, when startDrag occurs.
_global.isDraggin is set to 0 onRelease of the draggable object.

Are there any ideas for a solution?

Colormatrix Filter And Blur Filter Tween
Last edited by sks447 : 2006-10-17 at 15:11.
























I want to have a picture fade from blurry and grayscale to sharp and colorized. I have the blur to sharp part working ok. I have the grayscale to color to working ok. The only thing is the filters dont work together. Ive tried to push one into another with no luck yet. You can see the comments in the code below. Thanks.

ActionScript Code:
function blurFunction(myVar) {
    // init what movieclip to blur
    if (myVar == undefined) {
        myVar = promoContainer.p1;
    }
    // BLUR FILTER     
    import flash.filters.BlurFilter;
    import flash.filters.BitmapFilter;
    import flash.filters.ColorMatrixFilter;
    var blurFilter:BlurFilter = new BlurFilter(0, 0, 3);
    desaturation = 1;
    var filterArray:Array = new Array();
    filterArray.push(blurFilter);
    var blurX:Number = 100;
    var blurY:Number = 100;
    onEnterFrame = function () {
        prevPromo._visible = false;
        nextPromo._visible = true;
        if (desaturation>=1) {
            des = -0.03;
        } else if (desaturation<=0) {
            des = 0;
            delete (onEnterFrame);
        }
        desaturation += des;
        // color matrix 
        //myVar.filters = new Array(getDesaturationFilter(desaturation)); <---- I can have this....
        blurX -= 10;
        blurY -= 10;
        blurFilter.blurX = blurX;
        blurFilter.blurY = blurY;
        // blur filter 
        //myVar.filters = filterArray; <---- Or I can have this but not both.......
        if (blurY<=0) {
            blurY=0;
            blurX=0;
            //delete (onEnterFrame);
        }
    };
}
function getDesaturationFilter(t:Number):BitmapFilter {
    t = t != undefined ? t : 1;
    var r = 0.212671;
    var g = 0.715160;
    var b = 0.072169;
    trace("colormatrixfilter called");
    return new ColorMatrixFilter([t*r+1-t, t*g, t*b, 0, 0, t*r, t*g+1-t, t*b, 0, 0, t*r, t*g, t*b+1-t, 0, 0, 0, 0, 0, 1, 0]);
}

Attaching Dynamically Drawn MC To Another Dynamically Drawn MC
I'm trying to attach dynamically drawn buttons to a dynamically drawn MC, but am having no luck
What am I doing wrong?

In the code, box is a frame that will fall in to the screen, and btn is the first btn I'm going to attach. I want it to be dynamically created so I can read in button names from a server.

ActionScript Code:
// create a rectangle at depth 1
var box:MovieClip = createEmptyMovieClip("rectangle", 1);
//Draw the rectangle  (registration is at 0,0)
box.beginFill(0x000000, 100);
box.moveTo(0, 0);
box.lineTo(-200, 0);
box.lineTo(-200, -100);
box.lineTo(0, -100);
box.endFill();
//Left align box
box._x =200 ;

//Attach buttons to box
    var btn:MovieClip = createEmptyMovieClip ("b"+1,2);
    btn.beginFill(0x123456, 100);
    btn.moveTo(0, 0);
    btn.lineTo(0, -30);
    btn.lineTo(50, -30);
    btn.lineTo(50, 0);
    btn.endFill();
//I've tried using btn and b1 and neither work
box.attachMovie("btn","b",3);
trace(b);

Any help is, as always, greatly appreciated!

How Are HTF Drawn?
Does anyone know how " Happy Tree Friends " are drawn?

How To Get Lines BEING DRAWN ?
I want a rectangular being drawn at my site, I mean the visitor should see that the lines are drawn (becoming longer, takuing a corner of 90 degrees etc.). I'm completely new to SWish. Is there anyone who could give me a hand ?
Kippie

Drawn Out Effect
can someone please tell me how this is done? i am trying to achieve an effect where it looks like something is being drawn out. for example when you have an curved object, how do you reveal parts of it at a time. and example can be found here

like when the "power symbols" are revealed after you hit enter site.
does anyone know what i mean. thanks.

Drawn With Flash
does anyone here have a brush or pencil outline drawn with flash mx?

can i have a copy? i swear, i'll change it so that i won't look like i'm ripping you off..

i just want to learn how its done, via example...

i can't seem to draw properly with my poor skills..

thanks!

Drawn By Hand
ive decided to create my game all by hand. any suggestions on how to get nice clean motion?

How Would I Make It Look As If It Was Being Drawn?
Ok I want to know how to mkae it look as if words/cartoons that i draw in brush can look as if they are being written.

I am no good at explaning this is the best example I can show you.
http://killboredom.com/ia_animation_show.php?aid=2

Drawn In Effect
Hello.

I want to make an outline path of an animal that draws itself in as if someone
had a pencil to paper and was drawing the object. No interactivity
required. Is there some way to do this without using a mask?

Any ideas?

Greg

Clear What I Have Drawn
Hello,

I 've drawn something
writing code like this:

Code:
createEmptyMovieClip("pen_mc",this.getNextHighestDepth());

pen_mc.lineStyle(0,0xcccccc,100);

pen_mc.moveTo(20,20);
pen_mc.lineTo(20,20);
pen_mc.lineTo(60,60);
How can I clear all the things I have drawn?

Thanks
Cant.

How Do I Name A MovieClip Drawn With As3?
I am trying to draw a set number of squares in a grid type layout and have pretty much gotten it to do what I want. The problems is that I want to be able to manipulate each square individually later on and I'm pretty sure I need to assign each one a unique instance name... something like "square_0_0" all the way down to "square_10_10" (it's a 10x10 table of squares).

Anyway... how do assign a unique instance name to each square as it's added to the stage? I attached the code I currently have running. Thanks in advance for any help you can offer.









Attach Code

for(var c:Number = 0; c < 10; c++)
{
for(var r:Number = 0; r < 10; r++)
{
var w:Number = c * 21;
var h:Number = r * 21;

var shape:MovieClip = new MovieClip.name();

shape.graphics.beginFill(0x000000);
shape.graphics.drawRect(w,h,20,20);
shape.graphics.endFill();

addChild(shape);
}
}

As Drawn Oval
is it possiable to draw an oval with as

Animating A Circle Being Drawn
Hi everybody -

I am trying to animate a circle being drawn ( so that my movie will show the circular line bewing created from start to finish)

Any ideas how to do this ?

Thanks

Mark P

Help Please..How To Show A Design Being Drawn?
Hi anyone, I know this may be a simple thing to do but how does one show a vector design being drawn in Flash? Imagine someone is drawing a picture from scratch till a complete pic or writing some text without seeing the hand. Thanks for helping out!!

Lines Being Drawn In Movie..
Hi all. I'm running flash mx btw.

I was wondering how to produce the effect of a line being drawn....


originally i tried using shape tween, but that just gets serious screwed up...

the line isn't straight, it has a fair few bends in it.. and i want it to appear as if it's being drawn.

any ideas plz?

Problem With Dynamically Drawn MC's
Flash MX

I'm dynamically drawing an object(MC) according to user input variables, using the createEmptyMovieClip() functionality. The input by the user determines the geometry of the object.

One of the variables is a rotation value.

Once the geometry of the object has been drawn, I want rotate it, but around a specific axis. This is because their are other objects (MC's)that appear at a specific position relative to the dynamically drawn geometrical object.

How can I rotate around a specific point? At the moment when I rotate the MC teh object moves in an arc way off teh point where I want it to be.

T
Any help greatly appreciated

Lines Being Drawn On Screen
I need to know how to make a line goes across the screen ... i have an example

http://www.code-media.com/home.htm

see how after it loads, it draws the squares? How do i do that? THANKS!!!!!!

Save Picture Drawn In A Swf
I have created a swf file that has a drawing pallette on it, now I need the end user to email the drawing they created to me. Any help would be appreiciated...

thanks

Area Drawn On A Movieclip
Hi

I've written some code which allows a user to draw on a mask, so you can progressively see what is behind it (it's a cleaning game - you clean the dust off and see a clearer picture behind)

I want to give them a score depending on how much they've cleaned, and I can't seem to find a way to do this.

Basically, I'd like to be able to determine over how much of the movieclip they've drawn.

Does anyone know of any way to do this, or have anything along these lines that I could adapt?

Thanks in advance for your help!
Christine

Modifying A Drawn Line
Hey all,

In my flash application, the user can draw simple line by clicking and dragging the mouse (like Paint). I want to make it so that it's possible for the user to select his line, and, by clicking and dragging, be able to resize it as he wants. How can I do that?

Creating A Line Being Drawn
Hi
I'm sure this is really very easy, but I'm having problems.
What I am doing is trying to create a an effect where it looks like somthing is being drawn, in this case a scribble, I did the illustration in illustrator, and imported it, then tried to get the mask, so that it would just follow the line of the scibble revealing it slowly, but all it does is go in a line, without extending, does anyone have any ideas, or know of any tutorials, on how to get round this, it would be really appriciated

Many thanks

Ru

Make A Line Look Like It's Drawn
Hey,

Whats the best way to make aline look like it's getting drawn in?

Pretty much I want to have it look like it's drawing a boarder around things... Whats the best method, by hand or shape tweens?
If shape, can ya help me out on how to do it, I haven't used them in a long time and forgot how...

Would it be best to use a mask, have the area I want to come in already drawn, then use a mask to slowly make it apear in?
If so, can you also point me to some help for those, I never used masks before, but know what they can do.

Thanks,
Ian

Drawn Pie By Action Script
i tryed to draw pie wich will drawing degre by degre. Anyway i have problem because i can't do it anyone can help me?

Getting Values From A Pre-drawn Curve
If I draw a curve:

curve.moveTo(0,200);
curve.curveTo(5,20,10,200);

Is there any way of obtaining the y value i.e. height of the curve relative to the y = 200 baseline - at (say) x = 7?

Thanks,

Dave

Getting Values From A Pre-drawn Curve
If I draw a curve:

curve.moveTo(0,200);
curve.curveTo(5,20,10,200);

Is there any way of obtaining the y value i.e. height of the curve relative to the y = 200 baseline - at (say) x = 7?

Thanks,

Dave

BTW I already posted this in Flash MX forum, apologies if I'm doubling up.

Fade Drawn Lines
I was wondering if there is a way to fade lines that you make with the drawing api. Like if i wanted the line to fade out after a given time of it's creation?

Set A Drawn Line As A Mask.
I'm drawing a random line that I want to be a mask over an image. The effect that I'm going for is a random scratching off of a top layer - like a lottery ticket. Do I have to have a fill for a shape to be set as a mask? (using MX2004).

Here is the code I have so far. Thanks in advance for your help.



_root.createEmptyMovieClip("line_mc", 2); //this is the mc that will be the mask

_root.createEmptyMovieClip("image_mc", 1); //image underneath
_root.image_mc.createEmptyMovieClip("image_holder_ mc", 1);
image_mc.image_holder_mc.loadMovie("reallyneatimag e.jpg");

//image_mc.setMask(line_mc);

image_mc._x = 0;
image_mc._y = 0;

//set dimensions of stage
xbound = 400;
ybound = 225;

line_mc.lineStyle(2, 0xFFFFFF, 100);
line_mc.goingRight = true;
line_mc.xpos = -5;
line_mc.ypos = (ybound/2);
line_mc.moveTo(line_mc.xpos,line_mc.ypos);

line_mc.onEnterFrame = function() {
//if line hits outer wall (on left or right) - turn around
if (this.goingRight) {
//going right
this.xpos += (Math.random() * 5);

if (this.xpos > xbound){
//change direction to left
this.goingRight = false;

}
}else{
//going left
this.xpos -= (Math.random() * 5);

if (this.xpos < 0){
//change direction to right
this.goingRight = true;

}
}

this.ypos = (Math.random() * ybound);

line_mc.curveTo((this.xpos+(Math.random()*10)), (this.ypos+(Math.random()*30)),(this.xpos), (this.ypos));
image_mc.setMask(null);
image_mc.setMask(this);
}


//---

That's it. Thanks for your help.

How Do I Make A Line Appear Like It Is Being Drawn
I just would like to ask how i make it look like a line is being drawn so the line just smoothly, I would really like help with this tanks.

Dynamicly Drawn Text.
I have a couple of centances that I want to be drawn in, ie, they appear as if someone was writing it. Unfortunately the font I am using is rather complecated. Does anyone have an Idea how I could achieve this? - Side from hundreds of shape tweens. I also want to be able to easily change the text easily.

Thankyou for your time.

MC Follow Line Drawn
I was curious if this is possible(as i've been trying to figure this out all day, but without any luck).

I'll try and be as detailed as possible. There is an mc off to one side of the stage, not being used yet. Once the user presses and drags, a line begins to form, simply using the drawing api. Here comes the tricky part, once the mouse is released, that mc off to one side of the stage will follow the line just drawn as if it were a track for a racecar.

Is this possible?
I'm not looking for a bunch of code that i copy and paste, though. I'm looking for some insight as to whether or not it's possible, and how i should get started on it.

Takecare,
Victor

Saving Something Drawn In Flash
Alright, I have a flash file on the internet that allows the user to draw using the lineTo() function and what not. What i want to do is be able to save this drawing that the user does somewhere where i can access it later. Any ideas?

I Have Drawn A Boy, And I Want His Head To Turn/3D...
I am making a flash presentation and to add effect, I want to make a person's head I drew turn towards a specific viewpoint, but I am having trouble drawing each part of the face for each keyframe (to make the head appear turning). I want to make it look like the head is turning instead of a simple fade in/out with two different drawings.

I have attached the .fla file for the flash so far (I haven't done much yet)...You'll notice the drawing of the boy, and when the wolf wizzes past, I want his head to turn towards the left of the screen. I hope someone can help, because this would really add some effect to my movie.

I originally posted this in the Flash MX board, but I think it belongs here

How To Animate A Shape Being Drawn?
i was wondering if there was a way to animate the gradient shape i have in this picture being drawn?.

Even if it cannot be done with a gradient, i would still like to know how to do it with just a plain color...

I want it to look like it is filling in from right to left. Just as if you were using a big marker to draw the shape

A Face Appear If It Is Being Hand Drawn.....
I want to have a face appear as if it is being hand drawn. Does this require script or could it be done with a mask and motion path. Can a graphic of a pencil be used to give the illusion that it is drawing the lines. Any help would be greatly appreciated.

Need Pen-drawn Text Effect
I need to find a text effect that shows a pen writing in the text on a scroll parchment, as it goes along.
I have seen this type of effect several years ago but I can't find it now.
I need to have it write out a "10 Commandments" type of list.
And preferably have it easily adjustable with a .txt file for input.

Forum Searches haven't or can't differentiate what I am looking for.

Thanks

AttachMovie Within Drawn Object
Hi,

Can anyone tell me how I could attach an object within the bounds/area of a circle, ellipse or irregular polygon ?

For a square or rectangle it is possible, but when the shape becomes irregular it attaches in the dead zone (invisible rectangular) area outside the bounds of the object at times.

I need it attach within the boundaries.

Thanks.

- Rick

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