Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8166087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:44:24+00:00 2026-06-06T19:44:24+00:00

How to make effect like drawing diagonal line in Flash using Action Script? I

  • 0

How to make effect like drawing diagonal line in Flash using Action Script? I made animation using motion tween, and then I tried to generate action script from that motion tween, but animation starts from the middle of screen, and then it draw it. It should start from left corner, as it is in made in regular animation. This is action script it generates:

import fl.motion.Animator;
var laser_xml:XML = <Motion duration="75" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
    <source>
        <Source frameRate="25" x="13.6" y="13.25" scaleX="1" scaleY="1" rotation="0" elementType="drawing object">
            <dimensions>
                <geom:Rectangle left="10" top="10" width="7.25" height="6.5"/>
            </dimensions>
            <transformationPoint>
                <geom:Point x="-1.3793103448275863" y="-1.5384615384615385"/>
            </transformationPoint>
        </Source>
    </source>

    <Keyframe index="0"/>

    <Keyframe index="74" x="188.70000000000002" y="189.05"/>
</Motion>;

var laser_animator:Animator = new Animator(laser_xml, laser);
laser_animator.play();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:44:26+00:00Added an answer on June 6, 2026 at 7:44 pm

    Not sure if you’re asking how to modify the generated code, or do it solely with AS3. If the latter, this would give you the desired effect. Note though that using a Tweening library (such as TweenLite or GTween) would be cleaner:

    var s:Shape = new Shape();
    addChild(s); 
    
    var startPoint:Point = new Point();
    var endPoint:Point = new Point();
    var prog:Number = 0;
    var frames:int = 200;
    
    animateLine(100,100,50,50);
    
    function animateLine(startX:Number, startY:Number, endX:Number, endY:Number, time:Number = 120):void {
        startPoint.x = startX;
        startPoint.y = startY;
        endPoint.x = endX;
        endPoint.y = endY;
    
        frames = time;
        prog = 0;
        this.addEventListener(Event.ENTER_FRAME, tick);
    }
    
    function drawLineTick(progress:Number):void{
        s.graphics.clear();
        s.graphics.lineStyle(3,0xFF0000);
        s.graphics.moveTo(startPoint.x,startPoint.y);
        s.graphics.lineTo(startPoint.x + ((endPoint.x - startPoint.x) * progress), startPoint.y + ((endPoint.y - startPoint.y) * progress));
    }
    
    function tick(e:Event):void {
        trace("tick",prog);
        if(prog >= frames){
            this.removeEventListener(Event.ENTER_FRAME, tick);
        }
    
        drawLineTick(prog / frames);
        prog += 1;
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'd like to make an effect with alpha, but when i'm using a particular
I would like to make an effect of swiping images using jQuery. When I
i want to make typewriter effect like: http://img139.imageshack.us/img139/9775/screenshot0002mm2.gif dim s as string = 123
How to make an onhover popup box effect like on facebook, i don't know
does any one know how to make the slide to left effect like in
I'd like to make a function to the effect of: function supportsElem(tagName) { //
anyone have an idea to make a marquee effect just like twitter ? its
I want to make an effect like what you see on the right side
Does anyone knows how can i make an effect like this in my search
I want to make a book page scrolling effect like the picture below. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.