How to create a line in flash action script 3.0

i am trying to create a line that can be draggable and  extedable from start and end points of line. some one help plzz

what problem are you having?

Similar Messages

  • How to create an auction website using Action Script 3

    I want to develop an auction website for a flash assignment but I don't know how to go about doing it. Can I get some suggestions?

    If you don't know what you need to create for such a site, then you should try to think of something else that you might have some idea of how to go about doing.  Maybe you should talk to other students or your instructor to get some ideas and to figure out what kinds of things you need to be able to demonstrate with your assignment.

  • How to create a Image object from action script

    I need to set the back ground of charting dynamically, thus I need to create Image from a png/gif files. I have wrritten following code, but doesn't work.
    public function addBackground():void
        var cbg:ChartBackground=new ChartBackground();
        var bgs:Array=new Array();
        bgs.push(cbg);
        lineChart.backgroundElements=bgs;     
    package arubaUI
        import mx.controls.Image;
        [Embed(source="../assets/chart_16.png")]   
        public class ChartBackground extends Image
    Does any one knows how to do that?
    Thanks!

    I put the code like and got compile error:
    public class ArubaLinePanel extends Panel
      private var lineChart:LineChart;
      private var lineData:ArrayCollection=new ArrayCollection( [
                { Month: "Jan", Profit: 2000, Expenses: 1500, Amount: 450 },
                { Month: "Feb", Profit: 1000, Expenses: 200, Amount: 600 },
                { Month: "Mar", Profit: 1500, Expenses: 500, Amount: 300 },
                { Month: "Apr", Profit: 1800, Expenses: 1200, Amount: 900 },
                { Month: "May", Profit: 2400, Expenses: 575, Amount: 500 } ]);
      public function ArubaLinePanel()
            super();           
            lineChart=new LineChart();
            lineChart.dataProvider=lineData;
            lineChart.showDataTips=true;
            var axisX:CategoryAxis=new CategoryAxis()
            axisX.categoryField="Month";
            lineChart.horizontalAxis=axisX;
            var seriesArray:Array = new Array();
            var ls:LineSeries=new LineSeries();
            ls.yField="Profit";
            ls.displayName="Profit";
            seriesArray.push(ls);
            lineChart.series=seriesArray;
            this.addChild(lineChart);
            var legend:Legend=new Legend();
            legend.dataProvider=lineChart;
            this.addChild(legend);       
            addBackground();
    public function addBackground():void
        var cbg:ChartBackground=new ChartBackground();
        var bgs:Array=new Array();
        bgs.push(cbg);
        lineChart.backgroundElements=bgs;     
    Another method I tried:
    package arubaUI
        import mx.controls.Image;
        [Embed(source="../assets/chart_16.png")]   
        public class ChartBackground extends Image
    There is no compile error, but image is not show on screen,
    Thanks!
    April

  • How to create volume slider for flash cs 5 using action script 2.0?

    how to create volume slider for flash cs 5 using action script 2.0?the output should like if user want to hear sound in slow pitch,medium pitch or high pitch(slow to high pitch anything).i have attach this sound to button with using this code:
    stop();
    mySoundBtn.onRelease = function () {
              mySoundC = new Sound(this);
              mySoundC.attachSound("mySoundClip");
              mySoundC.start(0, 10);  //10 represents the number of loops
              gotoAndPlay(2);
    This sound plays till 3-4 scene ahead.
    Can anyone help me?

    Hey thnx Ned.
    this sites are really helpful.but,i have used sound through button.so how it is possible to attavh the link with slider.i have created slider also.
    Below is my slider code for sound.
    onClipEvent (load) {
        mySound1 = new Sound();
        mySound1.loadSound((myScale)+"/"+(myTanpura)+"/"+(myTanpuraSwar)+"/"+(myTanpuraTempo)+".w av", true);
        mySound1.onSoundComplete = function() {
        mySound1.start();
        mySound1.start(0.058,999);
    onClipEvent (enterFrame) {
        downloaded = mySound1.getBytesLoaded();
        total = mySound1.getBytesTotal();
        if (downloaded != total) {
            _root.dl = "You have to buy this software...";
        } else {
            complete = 1;
            _root.dl = "";
        mySound1.setVolume(ratio * 2);
    This code is working for slider.I mean it scrolls the slider.but it dosent make any effect to sound.
    Below is my button code.
    stop();
    mySoundBtn4.onRelease = function () {
              mySoundC = new Sound(this);
              mySoundC.attachSound("mySoundClip4");
              mySoundC.start(0, 300);  //10 represents the number of loops
              gotoAndPlay("play1");
    this is on button's frame.not exactly on button.
    Button and Slider both are on diffrent scene.
    Can you plese help me out?

  • Need to learn how to create a slideshow in Flash

    Hello All,
    I'm new to Flash and I need to learn how to do a slideshow with exactly the same features as can be found in this link:
    http://www.esppromo.com/index.asp
    Just like at the link above, it needs to play through the slides automatically once the page is loaded, each slide needs to link to a specific URL, and I need controls similar to the boxes at the bottom so the viewer can click on any specific slide they wish to view (I'd like to have numbers in the boxes though). The transitions don't have to slide across like this. If a fade is easier, that would be fine.
    Since I've looked online, but can't find any tutorials for doing this in Flash Professional, I think I'll pick up a book on Flash. There are some online tutorials that are close but nothing that is exactly what I'm looking for.
    I'm just wondering if anyone can recommend a particular book that covers creating this type of slide show with the links and controls exactly as I need it to be. I see these types of slide shows on a lot of sites now, so I'm hoping that maybe someone else on this forum has had to learn how to do this and can recommend a book they used?
    I was looking at Adobe Flash Professional CS5 Classroom in a Book and it looked like it may be what I'm after, but I am rather cautious, as I don't want to end up with instructions that are close to what I am looking for, but not quite right.
    Actually, I thought I'd be able to do this fairly easily with Flash Catalyst, so I updated to Adobe CS5 Design Premium. I found that Flash Catalyst can be used to create a slide show like this, but unfortunately it won't play automatically when the page loads and the viewer has to manually click through the slides, which is not what I need. I could be wrong, but from what I've read, I need Flash Builder to add code so the slide show will play automatically if I create it in Flash Catalyst. Since it's not an option for me to buy more software at this time, I've decided to learn how to do this in Flash Professional.
    I really want to learn how to do this. I expect to go on and create more using Flash, but for now I just REALLY need to figure this slide show out.
    If anyone can help out, I'd really appreciate it!
    Thanks,
    William

    Edit:
    i'm sorry. it is a huge work to type this and will be confusing as hell. i'm already up to 1 full word page of explanation. Though i am able to do it, explaning it in full lengh is ... well.. very hard. Way harder than it is to make your flash itself.
    I can however point you to some element you should read about how to make them:
    - How to use timeline in flash cs4
    - how to create a button in flash cs4
    - How to make "CLASSIC TWEEN" in flash cs4
    - How to use ActionScript 2 ( AS2) basic command like : GetUrl, Gotoandplay, Stop and how to put those script in the right location. ( AS2 allow you to put script directly on the button itself. however it is best to put it in the Action Layer that you will have to build in the timeline.
    - How to import thing in library.
    keep in mind that what you want to make is mostly a Logic probleme...
    - Image 1 click = GetURL X,
    - After Y time, Switch image 1 to image 2 with animation. Do the same for the button.
    - If you click on button 1 while being on image 3, you have to set all the reverse animation in the timeline, and use a lot of Gotoandplay.
    Hope this help you a little.
    I'm sorry. i really wanted to help you do it, but it is just a monstruous job to write all this.

  • How to create a line type in data dictionary

    How to create a line type in data dictionary?Please explain step by step?
    Thanks & Regads,
    Sairam

    Hi,
    the details abbout the line type.
    The line type of a table type can be defined by:
    o Specification of a type that already exists (data element,
    structure, table type, table, view) whose properties are then copie
    as properties of the defined table line.
    o Direct type input, where data type, number of positions, and, if
    required, decimal places, are entered directly.
    o Specification of a reference type.
    and SE11 and click on datatype and click on table type and enter the line type.
    Thanks
    Shiva

  • How do you auto reconnect a live video stream broadcast in flash action script 3?

    how do you auto reconnect a live video stream broadcast in flash action script 3?
    so i don't have to ask people to refresh the page if the connection drops
    i copy pasted the live video stream broadcast files and script from here;
    http://www.adobe.com/devnet/adobe-media-server/articles/beginner_live_fms3.html
    http://www.adobe.com/content/dotcom/en/devnet/adobe-media-
    server/articles/beginner_live_fms3/_jcr_content/articlePrerequistes/multiplefiles
    /node_1278314297096/file.res/beginner_live_fms3.zip
    i don't know what i'm doing

    Why don't you use several layers with appropriate alpha properties, and move these layers according to the mouse events?

  • How to create a Macromedia's Flash Java Player with JMF?

    How to create a Macromedia's Flash Java Player with JMF? Can you give me an example? My email:[email protected] [email protected]

    Yes, there is a way. Look up JTree in the API.-can you post some code.... i cant figure out on how to use JTree...
    i'm still confused on where will i get the entire directories of my drives...
    thanks

  • Can access c++ library from flash action script by using SWC lib?

    We want to develope a Flash application based on Windows CE 6.0 R3. The application aims to communicate with middleware libraries written in C/C++. Is it possible to create SWC file using the c++ library file so that we can load this as a component in fla project for accessing the library functions from flash action script 3.0? OR Is there any simple way to access c++ library from action script?
    Thanks,
    Saumini

    I don't think Alchemy will help you.  The reason is Alchemy does not give socket capabilities beyond what Flash provides.

  • Help... link URL from XML to Flash Action Script 2

    I am trying to link a different URL to each of my files in XML and use this XML in Flash were I created a carousel. In the carousel, when you click on a picture I would like to insert a specific URL. Each picture will have a different URL (http://------------).
    Here are my codes:
    XML:
    <icons>
    <icon image="icon1.png" tooltip="Planning" />
    <icon image="icon2.png" tooltip="Investments" />
    <icon image="icon3.png" tooltip="Education" />
    <icon image="icon4.png" tooltip="Insurances" />
    <icon image="icon5.png" tooltip="Mortgages" />
    <icon image="icon6.png" tooltip="Retirement" />
    <icon image="icon7.png" tooltip="Business Owner" />
    <icon image="icon8.png" tooltip="Banking" />
    </icons>
    Flash Action Script 2:
    import mx.utils.Delegate;
    var numOfItems:Number;
    var radiusX:Number = 250;
    var radiusY:Number = 75;
    var centerX:Number = Stage.width/2;
    var centerY:Number = Stage.height/2;
    var speed:Number = 0.01;
    var perspective:Number = 60;
    var home:MovieClip = this;
    var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
    tooltip._alpha = 0;
    var xml:XML = new XML();
    xml.ignoreWhite = true;
    xml.onLoad = function()
    var nodes = this.firstChild.childNodes;
    numOfItems = nodes.length;
    for(var i=0;i<numOfItems;i++)
      var t = home.attachMovie("item","item"+i,i+1);
      t.angle = i * ((Math.PI*2)/numOfItems);
      t.onEnterFrame = mover;
      t.toolText = nodes[i].attributes.tooltip;
      t.icon.inner.loadMovie(nodes[i].attributes.image);
      t.ref.inner.loadMovie(nodes[i].attributes.image);
      t.icon.onRollOver = over;
      t.icon.onRollOut = out;
      t.icon.onRelease = released;
    function over()
    home.tooltip.tipText.text = this._parent.toolText;
    home.tooltip._x = this._parent._x;
    home.tooltip._y = this._parent._y - this._parent._height/2;
    home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
    home.tooltip._alpha = 100;
    function out()
    delete home.tooltip.onEnterFrame;
    home.tooltip._alpha = 0;
    function released()
    function moveTip()
    home.tooltip._x = this._parent._x;
    home.tooltip._y = this._parent._y - this._parent._height/2;
    xml.load("icons.xml");
    function mover ()
    this._x = Math.cos(this.angle) * radiusX + centerX;
    this._y = Math.sin(this.angle) * radiusY + centerY;
    var s = (this._y - perspective) / (centerY+radiusY-perspective);
    this._xscale = this._yscale = s * 100
    this.angle += this._parent.speed;
    this.swapDepths(Math.round(this._xscale) + 100);
    this.onMouseMove = function()
    speed = (this._xmouse-centerX)/10000;
    Thanks so much for the help.

    You should be able to add that data into your xml tags and then extract it in the AS2 onLoad function...
    XML:
    <icons>
    <icon image="icon1.png" tooltip="Planning" linkURL="http://www.someURL.com/somePage.html" />
    AS2:
    xml.onLoad = function()
    etc....
    t.onEnterFrame = mover;
    t.toolText = nodes[i].attributes.tooltip;
    t.urlLink = nodes[i].attributes.linkURL;
    etc...

  • Video bookmark (videomark) using flash/action script?

    Video bookmark is called videomark.
    Anybody did videomark using flash?.
    Is there any good place, i can learn more about videomark in
    flash?.

    yeah..........
    Can I have a small example on this ... so that it would be very easy for me to understand....
    I am a new bee in flash action scripting......
    Thanks & Regards

  • How to create a follow up page in scripts using Duplex and Tumble Duplex

    How to create a follow up page in scripts using Duplex and Tumble Duplex in print mode of scripts ?

    Hi ,
    Set the next page property as duplex , and change the print property back to back

  • How to create a server through WLST  ( Weblogic Scripting Tool ) ?

    How to create a server through WLST ( Weblogic Scripting Tool ) ?
    Thanks in advance...
    Sanjay

    Hi Murugesh,
    Thanks a lot for you reply..
    I was able to create a server using create(). Is it possible to clone a server ?
    When i create a server following tags is added to config.xml
    <server>
    <name>testServer_lab1</name>
    <listen-port>43000</listen-port>
    </server>
    And if i do a clone through admin console, following is added to config.xml
    <server>
    <name>testServer2_lab1</name>
    <machine xsi:nil="true"></machine>
    <listen-port>7001</listen-port>
    <cluster xsi:nil="true"></cluster>
    <listen-address></listen-address>
    <graceful-shutdown-timeout>120</graceful-shutdown-timeout>
    </server>
    If incase, cloning is not possible through WLST, can i add following
    <machine xsi:nil="true"></machine>
    <listen-port>7001</listen-port>
    <cluster xsi:nil="true"></cluster>
    <listen-address></listen-address>
    <graceful-shutdown-timeout>120</graceful-shutdown-timeout>
    under <server> tag which is created through WLST ?
    I am using 9.2 version.
    Regards
    Sanjay

  • How to create a line without using execute action method.

    Hi All,
    I want to create a line whose weight and co-ordinate are given to me. I am using ActionDescriptor and execute action method to do this.
    Here is my code:
        var idcontentLayer = stringIDToTypeID( "contentLayer" );
        var idStrt = charIDToTypeID( "Strt" );
        var idHrzn = charIDToTypeID( "Hrzn" );
        var idPxl = charIDToTypeID( "#Pxl" );
        var idVrtc = charIDToTypeID( "Vrtc" );
        var idPnt = charIDToTypeID( "Pnt " );
        var actRef = new ActionReference();
        actRef.putClass( idcontentLayer );
        var layerDesc = new ActionDescriptor();
        layerDesc.putReference( charIDToTypeID( "null" ), actRef );
        var lineDesc = new ActionDescriptor();
        lineDesc.putClass( charIDToTypeID( "Type" ), stringIDToTypeID( "solidColorLayer" ) );
        var propertyDesc = new ActionDescriptor();
        var strtPointDesc = new ActionDescriptor();
        strtPointDesc.putUnitDouble( idHrzn, idPxl,  startX);                         //startX, startY, endX, endY are given..
        strtPointDesc.putUnitDouble( idVrtc, idPxl, startY);
        var endPointDesc = new ActionDescriptor();
        endPointDesc.putUnitDouble( idHrzn, idPxl, endX );
        endPointDesc.putUnitDouble( idVrtc, idPxl, endY );
        propertyDesc.putObject(  charIDToTypeID( "Strt" ), idPnt, strtPointDesc );
        propertyDesc.putObject( charIDToTypeID( "End " ), idPnt, endPointDesc);
        propertyDesc.putUnitDouble( charIDToTypeID( "Wdth" ), idPxl, weight );               // weight is given.
        lineDesc.putObject( charIDToTypeID( "Shp " ), charIDToTypeID( "Ln  " ), propertyDesc );
        layerDesc.putObject( charIDToTypeID( "Usng" ), idcontentLayer, lineDesc );
        executeAction( charIDToTypeID( "Mk  " ), layerDesc, DialogModes.NO );
    Is there any other way to do the above (using photoshop scripting method)?
    Thanks,
    AI

    You can only create normal and text layers using the Object Model. For other layer types you have to use Action Manager.

  • Adobe Photoshop: how to create cut lines on landscape letter for two 5 by 7 in images?

    adobe photoshop: how do i create cutting lines in adobe photoshop if my document is landscape 8.5 by 11 inches and the image are two side by side 5 by 7 in (so appearing 10 inches wides, 7 inch height)... so basically this leaves a 0.5 border top/bottom/left right....i need corner crop marks and a little line in the middle top and bottom (in the crop area) to designate where to cut the 10 inches into 2, creating my two 5 by 7 inches for each image... my guidlines are perfectly aligned, i just need to know how to make cut lines out of my guidelines except in the middle

    What I use to do years ago, before most apps had auto crop marks. Was create the guidelines for the margin. Use a line tool, pen tool, etc. and create a line that goes from the guidelines where they meet each other and draw outwards to the edge of the page. Because the line is on the guideline, it snapped to it, making it a straight line. Repeated for the same corner drawing the other direction. (In other words, if I was doing the top left corner, I would draw out to the left, then repeat to draw out to the top of the page).
    Group the two line, copy and flip to snap it to the next corner and repeat until all four corners of the page are done.
    But if you have a postscript printer, acrobat pro, adober illustrator or adobe indesign, they will generate the crop marks for you.
    tip: Do the above while creating an action and your done for the next time. Just run the action. But I reccomend that you set the rules to percentages when creating the guidelines, that way, it can work on more than one image size.

Maybe you are looking for

  • IPad2 Mirroring via VGA Connector?

    I"ve got a coworker who is trying to mirror his new iPad2 display to an LCD projector using Apple's VGA connector accessory. We've been unable to get the projector to see anything from the iPad2, and I'm wondering if mirroring is only supported when

  • Opening a web page in an applet

    Some may recognize this as I have posted it before and got nowhere. So I decided to post it again to see if anybody could help me. I have made a few changes to my code, but no guarantees it's better. public class FinalWindow extends Applet      priva

  • Connecting to AT&T DSL gateway wirelessly

    I'm anxiously awaiting the arrival of my new MacBook Pro. Can't wait to trash my Dell! I have ordered AT&T DSL with a gateway. Is there any adapter or other equipment that I will need to purchase to connect My laptop to the internet wirelessly in my

  • Isight camera for mac mini

    Looking to purchase a camera for my mac mini something along the lines of isight My current setup is mac mini to hdtv Camera is going to be mainly for FaceTime & Skype Looking for a camera that is compatible with mac mini and the OS X 10.8

  • Text Tone issues - iPhone 5

    Hello, All my contacts have a custom Ringtone and Text Tone set to "Noir". The default Ringtone is set to "Old Phone" and the default Text Tone is set to "Tri-Tone". It happens that when I receive a text message from one of my contacts the sound that