Dynamic ActionScript

Can anyone tell me how you edit a frames actions using
actions.
This is suppose to assign stop() to first frame top layer
action:
fl.getDocumentDOM().getTimeline().layers[0].frames[0].actionScript
= 'stop();';
Can't quite get that to work though!

Is there a way to edit the actions with the fla file?

Similar Messages

  • Is it possible to remove properties from a dynamic class?

    I have a dynamic ActionScript Class that is used to send
    parameters to a WebService. Some of these parameters are always
    present, so they are public properties of the Class:
    package
    [Bindable]
    public dynamic class WebServiceCriteria
    public var property1:int;
    public var property2:String;
    public var property3:String;
    public var property4:String;
    But, I am also adding properties at runtime that can change
    over time:
    criteria.runTimeProperty = "1";
    I'm not very familiar with using dynamic classes, so I was
    wondering if it is possible to "remove" the new property. Let's say
    the next time I call the WebService I don't want that property sent
    - not even as a null. How can I remove it from the Class instance
    without creating a new instance each time?

    Hi,
    Please try delete criteria.runTimeProperty. Please find more
    details on the delete operator at the URL below.
    http://livedocs.adobe.com/flex/3/langref/operators.html#delete
    Hope this helps.

  • Dropping frames in QT export from CS3

    I just got CS3 for my PC and I was all excited about the new
    feature that lets you export dynamic/actionscripted/MovieClip
    content. I do animation targetted at TV, so everything needs to be
    rendered to AVI or Quicktime, so I figured that this new feature
    would let me use a dynamic camera symbol as I've always wanted to.
    I've run into a problem, though: the export process seems to
    drop frames! As far as I can tell, Flash is rendering and recording
    the frames of the animation in real time (or perhaps just close to
    real time). If the computer has any hiccups because of another
    process demanding some processor time then the resulting quicktime
    will have frozen bits where the renderer couldn't keep up.
    You can see what I'm talking about by looking at the
    quicktime and an AVI of the same scene here:
    http://www.pinkandaint.com/flasherror/bad.mov
    http://www.pinkandaint.com/flasherror/good.avi
    To test this theory, I tried witching applications a bunch
    during a render. Sure enough, there were long sections in the
    resulting quicktime where the renderer missed frames. The quicktime
    is the right length and number of frames -- it just repeated the
    same frame over and over where it couldn't keep up.
    That's not the only problem, though. When I look at the
    exported quicktime file in either Quicktime Player or Premiere pro
    (version 1.5) it reports a framerate significantly lower than in
    the original FLA. In the file I'm looking at right now, the FLA's
    framerate is listed as 29.97 but the MOV file reports a rate of
    19.29 (which is, incidentally, different than the framerate I got
    any other time I exported the same scene). In premiere, when I tell
    it to interpret the footage as having 29.97 fps the clip gets
    significantly shorter than it should be -- in this case 161 frames
    rather than the 208 frames that it is in the FLA.
    I'm pretty sure this is the same way that the various
    SWF-to-video programs do things. I thought it was an interesting
    kludge to use those external programs but I was sure Adobe would be
    able to do something more elegant and sure-footed with this new
    export feature. Couldn't they have somehow guaranteed that each
    frame would get captured? It seems like they could have just
    modified the Flash player to play with artificial time, where the
    time to render each frame was always reported as 1/framerate.
    Oh, and there's one more problem. The Quicktime renderer
    seems to do something different about the order of execution of
    actionscript or something. In the rendered quicktime movie the
    first frame displays my camera symbol even though I explicitly made
    it invisible with actionscript on the first frame of its timeline.
    When displaying in the Flash player the first frame does _not_
    display the camera symbol....
    Has anyone else encountered these problems? If so, have you
    figured out a workaround? I tried setting the framerate really low
    (I was at 29.97, so I set it down to 10) but it still seemed to
    miss frames.
    -David

    I can understand your frustration with this feature as it
    tries to capture in real time what's being
    compiled in the player - but your last line is a bit unfair:
    "...it
    > exemplifies the Flash team's disregard for animators in
    favor of web developers."
    Copy Motion and Copy Motion as AS3 are useful new additions
    for animators. I will add however that I
    myself have a list of animation oriented features I would
    love to see added in flash but for now
    have you checked out www.flashants.com and their SWF2Video
    tool? It exports an SWF to AVI with
    flawless results. Worth looking into if you have the need to
    output any kind of flash content to video.
    Chris Georgenes
    Animator
    http://www.mudbubble.com
    http://www.keyframer.com
    Adobe Community Expert
    *\^^/*
    (OO)
    <---->
    animator_geek wrote:
    >
    quote:
    Originally posted by:
    Newsgroup User
    > [...]
    > Turn off other applications. When recording, Flash uses
    all of your system's
    > available resources as much as possible, so any
    interference of the system
    > performance affects the result of the recording. We
    recommend you exit other
    > applications while exporting to a video.
    >
    >
    > So you're telling me that Flash makes my computer
    completely unusable while
    > it's rendering? Sorry, I thought we left that kind of
    limitation behind with
    > DOS. Particularly for something like this, where the
    rendering process should
    > be
    completely independent of real-time. The renderer should go
    exactly
    > as fast as it needs to in order to capture every frame.
    Whether I set the
    > frame rate to 1 or 1000 should make no difference in how
    many frames are
    > dropped in the rendering process.
    No frames should ever be dropped I
    > mean, what's going on here? You guys have access to the
    actual source code of
    > the renderer. Can't you adapt it so that it when it's
    rendering non-real-time
    > the SWF thinks that it's executing at exactly the frame
    rate it desires? You
    > could just set the renderer's "clock" to whenever the
    render was started, then
    > increment it 1/fps seconds every frame. The program
    would never be the wiser.
    > You could even let the timer run (or simulate it
    somehow) for 1/fps seconds
    > between rendering each frame, thereby handling any timer
    events that need to be
    > sent while the SWF is running.
    >
    > Clearly I'm not privy to the inner workings of the Flash
    player but as a user
    > there's a certain standard I expect, particularly when a
    company touts this
    > great new feature. It's supposed to work as advertised.
    This feature clearly
    > does not.
    >
    > Now I've been a software engineer in the past and I know
    that sometimes
    > workarounds have to be made but this is just too much.
    To me as a user, it
    > exemplifies the Flash team's disregard for animators in
    favor of web developers.
    >
    > -David
    >
    >
    quote:
    Turn off audio. The audio in a Flash movie may also slow the
    performance
    > possibly causing dropped frames. Turn off the audio, if
    you have many
    > dropped frames in the first attempt. Other video editing
    tools can be used
    > to add the audio to the video after export.
    >
    > Reduce frame rate. If the movie dimension is a full size
    NTSC video, 740 x
    > 480, and frame rate is 30 fps, you are more likely to
    have dropped frames.
    > Reduce the fps of Flash movie increase the chance of
    grabbing all the
    > frames. Other video editing tools can be used to adjust
    the frame rate of
    > the video after export.
    >
    > Optimize your animation. Try to avoid a lot of screen
    motion. The greater
    > the area of change on the screen, the more likely
    slowdown will occur. Also,
    > if possible, restrict your use of transparency and alpha
    channels as they
    > too can cause poor performance.
    >
    > Use ActionScript 3. Animation created by ActionScript 2
    and ActionScript 3
    > are different in play back performance. Convert the
    ActionScript in your
    > animation to ActionScript 3 for optimized performance.
    >
    > Dimension settings in 2 places. The dimension settings
    in Export Settings
    > dialog sets the dimension of the SWF movie to be
    captured. The Size settings
    > in QuickTime Settings dialog sets the dimension of the
    exported MOV files.
    > If the SWF size is smaller than the exported MOV size,
    the picture quality
    > will be degraded; if it is larger than the exported MOV
    file, you may have
    > better picture quality. For best quality (and often
    performance) these
    > settings should match.
    >
    >
    >
    > "animator_geek" <[email protected]>
    wrote in message
    > news:[email protected]...
    > >I just got CS3 for my PC and I was all excited about
    the new feature that
    > >lets
    > > you export dynamic/actionscripted/MovieClip
    content. I do animation
    > > targetted
    > > at TV, so everything needs to be rendered to AVI or
    Quicktime, so I
    > > figured
    > > that this new feature would let me use a dynamic
    camera symbol as I've
    > > always
    > > wanted to.
    > >
    > > I've run into a problem, though: the export process
    seems to drop frames!
    > > As
    > > far as I can tell, Flash is rendering and recording
    the frames of the
    > > animation
    > > in real time (or perhaps just close to real time).
    If the computer has
    > > any
    > > hiccups because of another process demanding some
    processor time then the
    > > resulting quicktime will have frozen bits where the
    renderer couldn't keep
    > > up.
    > >
    > > You can see what I'm talking about by looking at
    the quicktime and an AVI
    > > of
    > > the same scene here:
    > >
    http://www.pinkandaint.com/flasherror/bad.mov
    > >
    http://www.pinkandaint.com/flasherror/good.avi
    > >
    > > To test this theory, I tried witching applications
    a bunch during a
    > > render.
    > > Sure enough, there were long sections in the
    resulting quicktime where the
    > > renderer missed frames. The quicktime is the right
    length and number of
    > > frames
    > > -- it just repeated the same frame over and over
    where it couldn't keep
    > > up.
    > >
    > > That's not the only problem, though. When I look at
    the exported
    > > quicktime
    > > file in either Quicktime Player or Premiere pro
    (version 1.5) it reports a
    > > framerate significantly lower than in the original
    FLA. In the file I'm
    > > looking at right now, the FLA's framerate is listed
    as 29.97 but the MOV
    > > file
    > > reports a rate of 19.29 (which is, incidentally,
    different than the
    > > framerate I
    > > got any other time I exported the same scene). In
    premiere, when I tell
    > > it to
    > > interpret the footage as having 29.97 fps the clip
    gets significantly
    > > shorter
    > > than it should be -- in this case 161 frames rather
    than the 208 frames
    > > that it
    > > is in the FLA.
    > >
    > > I'm pretty sure this is the same way that the
    various SWF-to-video
    > > programs do
    > > things. I thought it was an interesting kludge to
    use those external
    > > programs
    > > but I was sure Adobe would be able to do something
    more elegant and
    > > sure-footed
    > > with this new export feature. Couldn't they have
    somehow guaranteed that
    > > each
    > > frame would get captured? It seems like they could
    have just modified the
    > > Flash player to play with artificial time, where
    the time to render each
    > > frame
    > > was always reported as 1/framerate.
    > >
    > > Oh, and there's one more problem. The Quicktime
    renderer seems to do
    > > something different about the order of execution of
    actionscript or
    > > something.
    > > In the rendered quicktime movie the first frame
    displays my camera symbol
    > > even
    > > though I explicitly made it invisible with
    actionscript on the first frame
    > > of
    > > its timeline. When displaying in the Flash player
    the first frame does
    > > _not_
    > > display the camera symbol....
    > >
    > > Has anyone else encountered these problems? If so,
    have you figured out a
    > > workaround? I tried setting the framerate really
    low (I was at 29.97, so
    > > I set
    > > it down to 10) but it still seemed to miss frames.
    > >
    > > -David
    > >
    >
    >
    >
    >
    >
    >

  • [Ann] D.eval() API brings eval() to Flex 2

    The D.eval() (read DEE-val) API is a SWC library for Flex 2
    applications to execute text strings of dynamic ActionScript
    expressions and programs.
    The language used in D.eval() is called Deval, a subset of
    ActionScript 3 (AS3). It supports all the AS3 expressions
    (including E4X) and most flow control statements; it can access any
    AS3 classes and functions; it does not define functions and
    classes. D.eval() opens a whole new world to Flex 2 applications
    and development.
    The current version is 1.0-Beta, which is fully functional.
    Check it out at [Adobe | Exchange | Flex | Libraries], or visit the
    web site at
    http://www.riaone.com/daseval/
    Have lots of fun with the D.eval() API!
    P.S. D.eval() was released under a different name about a
    month ago. It is renamed to D.eval() and the content is the
    same.

    I've been hit by the wmode issue with IFrames, when tested an
    application on Linux which floats a PDF over my Flex.
    The main reason that it work in Firefox on Linux was that
    there wasn't any support at the Firefox end, so there was no point
    in adding the feature... but it looks like Firefox contributors
    have finished the work needed in the last couple of weeks!:
    https://bugzilla.mozilla.org/show_bug.cgi?id=137189
    So hopefully we'll be seeing from platform floating IFrame
    support.
    There was also a pretty hardcore hack someone noticed Google
    were using which lets you float HTML content over Flash even on
    Linux, did you ever come across that? If not and you can't find it,
    I'll try and dig out a link.
    Floating IFrames floats my boat, provided it can produce
    consistant results across all platforms.
    There is an issue with dot pitch on windows though... try
    changing the DPI and see where the lovingly position frame ends
    up!

  • [Ann] DAS.eval() Library brings eval() to Flex 2

    The DAS.eval() (read DAS-eval) Library is a SWC library for
    Flex 2 applications to execute text strings of dynamic ActionScript
    expressions and programs.
    The language used in DAS.eval() is DAS — Dynamic
    ActionScript — a subset of ActionScript 3 (AS3). It supports
    all the AS3 expressions (including E4X) and most flow control
    statements; it can access any AS3 classes and functions; it does
    not define functions and classes. DAS.eval() opens a whole new
    world to Flex 2 application development.
    The current version is 1.0-Beta, which is fully functional.
    Check it out at
    Adobe | Exchange | Flex | Libraries
    or visit the web site
    http://www.flexisco.com/daseval/
    Have lots of fun with Dynamic ActionScripting (DASing)!
    -Ann

    The DAS.eval() (read DAS-eval) Library is a SWC library for
    Flex 2 applications to execute text strings of dynamic ActionScript
    expressions and programs.
    The language used in DAS.eval() is DAS — Dynamic
    ActionScript — a subset of ActionScript 3 (AS3). It supports
    all the AS3 expressions (including E4X) and most flow control
    statements; it can access any AS3 classes and functions; it does
    not define functions and classes. DAS.eval() opens a whole new
    world to Flex 2 application development.
    The current version is 1.0-Beta, which is fully functional.
    Check it out at
    Adobe | Exchange | Flex | Libraries
    or visit the web site
    http://www.flexisco.com/daseval/
    Have lots of fun with Dynamic ActionScripting (DASing)!
    -Ann

  • DYNAMIC CREATION OF LINE SERIES USING ACTIONSCRIPT

    There's something wierd about flex or im doing something
    wrong?
    - when i create a line series manually using mxml and specify
    a id for the series, it works.
    - similarly when i try to dynamically create a line series
    using actionscript & define an "id" property, flex does not
    understand! what am i doing wrong?
    code for reference:
    private function addSeries(series:Array,
    yField:String,id:String) // addseries(series,"date","1000")
    var ls:LineSeries= new LineSeries();
    var stroke:Stroke = new Stroke()
    ls.yField = yField;
    ls.xField="ts"
    ls.dataProvider=dp
    ls.id=id // tried defining it dynamically, but flex does not
    find
    this.mychart.series.push(ls)
    THIS IS THE ERROR I GET : "TypeError: Error #1010: A term is
    undefined and has no properties."

    I see... I played around with the line chart ...
    Hopefully this helps... if not forgive me...
    I know why you are trying to use the id property which i
    agree doesn't work.
    since the series is an array in your lineChart use the index
    to set the visible property false/true.
    lineChart.series[0].visible = true/false;
    <mx:Lineseries id="a1" visible="true"
    dataProvider="{whatever}" />
    <mx:Lineseries id="a2" visible="false"
    dataProvider="{whatever}"/>
    create a function called init();
    public function init():void
    var lineS1:LineSeries = new LineSeries();
    lineS1.visible = true/false;
    lineChart.series.push(lineS1);
    var lineS2:LineSeries = new LineSeries();
    lineS2.visible = true/false;
    lineChart.series.push(lineS2);
    ... and the key is to call this init function on initialize
    event...NOT on createComplete event
    <mx:LineChart.... initialize="init()" .... />
    and to show both lines... call this function...
    public function showLines():void
    lineChart.series[0].visible = true;
    lineChart.series[1].visible = true;
    Hope this helps....

  • Flash CS5 Greeter.cs HelloWorld.fla text type Dynamic not an option? ActionScript 3

    Learning to program in ActionScript 3 for Flash CS5 Pro,
    http://help.adobe.com/en_US/as3/learn/WS5b3ccc516d4fbf351e63e3d118a9b90204-7fdf.html
    The tutorial says that the text box, should be text type Dynamic, but the only choices are TLF and Classic
    Since the Classic closed the Instance name box, I chose TLF text.
    When I test the scene, I get a blank screen, instead of a "Hello World" greeting.  Is there a way around this?

    I had the class file in the wrong directory, and so now it works!  Thank you for looking.

  • Dynamically Create Repeater Element in ActionScript

    Hi,
    I'm trying to dynamically create a repeater control with an
    image and a label control. I can do it directly in the MXML file
    but when I try and covert it into ActionScript it's not working.
    Can anyone see what the problem is with my code?
    public function GetPalettes():void{
    removeChild(document.FrontPage);
    Palettes.method = "GET";
    params = {"method": "GetPalettes", "BodyPartNo":
    document.PalettesMenu.selectedItem.@partNo};
    Palettes.cancel();
    Palettes.send(params);
    var VerticalBox:VBox = new VBox();
    VerticalBox.x = 10;
    VerticalBox.y = 10;
    VerticalBox.id = "VerticalBox";
    var PaletteRepeater:Repeater = new Repeater();
    PaletteRepeater.dataProvider =
    "{Palettes.lastResult.Palette}";
    PaletteRepeater.startingIndex = 0;
    PaletteRepeater.id = "PaletteRepeater";
    var PaletteImage:Image = new Image();
    PaletteImage.setStyle("HorizontalAlign", "left");
    PaletteImage.source = "
    http://localhost/Flex/Personalised%20Palettes-debug/{PaletteRepeater.currentItem.@PictureS rc}Med.png";
    PaletteImage.useHandCursor = true;
    PaletteImage.buttonMode = true;
    PaletteImage.mouseChildren = false;
    PaletteImage.id = "PaletteImage";
    var PaletteDescription:Label = new Label();
    PaletteDescription.text =
    "{PaletteRepeater.currentItem.@Description}";
    PaletteDescription.id = "PaletteDescription";
    document.MainPage.addChild(VerticalBox);
    VerticalBox.addChild(PaletteRepeater);
    PaletteRepeater.addChild(PaletteImage);
    PaletteRepeater.addChild(PaletteDescription);
    Thanks

    "katychapman85" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hey Amy,
    >
    > I've put a thread up about this but thought I'd ask you
    as well as you've
    > been
    > a great help to me so far.
    >
    > I have this function:
    > public function GetOptions(Menu:int):void{
    > document.MenuOptions.url =
    > "
    http://localhost/Flex/Personalised%20Palettes-debug/MenuOptions.php?Menu=";
    > document.MenuOptions.url += Menu;
    > document.MenuOptions.send();
    > }
    >
    > What I'm trying to do is when a user clicks on a Radio
    button this
    > function is
    > called and the number of the Menu required is sent to
    the function.
    >
    > I've added this Event Listener to my Radio Button:
    >
    >
    document.RadioButtons2.addEventListener(MouseEvent.CLICK,
    > function():void{GetOptions(2);});
    >
    > However, it's not working. Everything I've read suggests
    using an
    > anonymous
    > function in the Event Listener to pass the menu
    parameter but for some
    > reason
    > it's not working.
    What version of Flex are you using? The Help for Flex 3 has
    this to say:
    http://www.adobe.com/livedocs/flex/3/html/help.html?content=events_05.html
    Defining event listeners inline
    The simplest method of defining event handlers in Flex
    applications is to
    point to a handler function in the component's MXML tag. To
    do this, you add
    any of the component's events as a tag attribute followed by
    an ActionScript
    statement or function call.
    You add an event handler inline using the following syntax:
    <mx:tag_name event_name="handler_function"/>
    For example, to listen for a Button control's click event,
    you add a
    statement in the <mx:Button> tag's click attribute. If
    you add a function,
    you define that function in an ActionScript block. The
    following example
    defines the submitForm() function as the handler for the
    Button control's
    click event:
    <mx:Script><![CDATA[
    function submitForm():void {
    // Do something.
    ]]></mx:Script>
    <mx:Button label="Submit" click="submitForm();"/>
    Event handlers can include any valid ActionScript code,
    including code that
    calls global functions or sets a component property to the
    return value. The
    following example calls the trace() global function:
    <mx:Button label="Get Ver" click="trace('The button was
    clicked');"/>
    There is one special parameter that you can pass in an inline
    event handler
    definition: the event parameter. If you add the event keyword
    as a
    parameter, Flex passes the Event object and inside the
    handler function, you
    can then access all the properties of the Event object.
    The following example passes the Event object to the
    submitForm() handler
    function and specifies it as type MouseEvent:
    <?xml version="1.0"?>
    <!-- events/MouseEventHandler.mxml -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script><![CDATA[
    import mx.controls.Alert;
    private function myEventHandler(event:MouseEvent):void {
    // Do something with the MouseEvent object.
    Alert.show("An event of type '" + event.type + "'
    occurred.");
    ]]></mx:Script>
    <mx:Button id="b1" label="Click Me"
    click="myEventHandler(event)"/>
    </mx:Application>
    It is best practice to include the event keyword when you
    define all inline
    event listeners and to specify the most stringent Event
    object type in the
    resulting listener function (for example, specify MouseEvent
    instead of
    Event).
    You can use the Event object to access a reference to the
    target object (the
    object that dispatched the event), the type of event (for
    example, click),
    or other relevant properties, such as the row number and
    value in a
    list-based control. You can also use the Event object to
    access methods and
    properties of the target component, or the component that
    dispatched the
    event.
    Although you will most often pass the entire Event object to
    an event
    listener, you can just pass individual properties, as the
    following example
    shows:
    <?xml version="1.0"?>
    <!-- events/PropertyHandler.mxml -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script><![CDATA[
    import mx.controls.Alert;
    private function myEventHandler(s:String):void {
    Alert.show("Current Target: " + s);
    ]]></mx:Script>
    <mx:Button id="b1" label="Click Me"
    click="myEventHandler(event.currentTarget.id)"/>
    </mx:Application>
    Registering an event listener inline provides less
    flexibility than using
    the addEventListener() method to register event listeners.
    The drawbacks are
    that you cannot set the useCapture or priority properties on
    the Event
    object and that you cannot remove the listener once you add
    it.
    don't see anything in there about anonymous functions...?

  • Dynamically add custom MXML components in Actionscript

    As there's no constructor for custom MXML components, how to
    dynamically add it as a child using ActionScript?
    I'm looking for some alternative to avoid the need to rewrite
    the entire existent component in ActionScript just to add it this
    feature (a constructor). PopManager is not an alternative...
    Is there any way?
    The case/situation:
    I have a custom MXML component that needs to be dinamically
    added to a NativeWindow created using ActionScript.
    Thanks a lot!
    Vicente Junior
    Independent Web Developer
    http://teclandoalto.blogspot.com

    mxml classes get generated into AS classes with a default
    constructor.
    In fact, there is essentially no difference between an AS
    component and an mxml component, they can be used exactly the same
    way.
    Tracy

  • Actionscript for Dynamic Text

    I am designing my first flash site, and created a Dynamic
    text field called header_txt. I want the content inside this field
    changed based on which page the user navigates to. I have used an
    "IF" statement inside a Declared Function , but wonder if that is
    the best option, also, my IF statement is no working. Here it is:
    function headingChange() {
    if (_root._currentframe == "contact") {
    header_txt.text = "Contact Us";
    } else if (_root._currentframe == "about") {
    header_txt.text = "About Us";
    headingChange();
    var header_txt:String = "";
    Why is this not working, and what would be a better way of
    changing this field?
    Thanks for the help!
    Chuck

    _currentframe only returns a number. You can't access the
    frame's label with actionscript, except to specify it as a
    parameter in the gotoAndPlay() method.
    I would assume that you are calling the headingChange()
    function at each labeled frame. If you are, then just change the
    function call to this:
    At frame labeled "contact": headingChange("contact");
    At frame laveled "about": headingChange("about");
    Change your function to read as follows:
    function headingChange(s:String) {
    if (s== "contact") {
    header_txt.text = "Contact Us";
    } else if (s== "about") {
    header_txt.text = "About Us";
    Or, you could just access your dynamic textfield directly
    everytime you get to a new frame with a label by executing the
    following code in a frame:
    At the frame labeled "about": header_txt.text = "About Us";
    Either way would work. Though I like keeping stuff like this
    in a function. It makes it easier to update so that it does more in
    the future.
    Tim

  • Creating a dynamic grid using actionscript

    Hello all:
    I am working on a Flash project which requires that the user
    input 2 values. These two values will be used as height and width
    to generate a dynamic grid. I am new to actionscript and am
    struggling with how to create the 2 input fields and pass the
    values to actionscript by an event such as the user pressing
    return. The code below will create the grid correctly based upon
    the hardcoded variable values hightlighted, but I need the user to
    enter the values and press return to generate the grid.
    Can anyone suggest the actionscript required to capture the 2
    values, send them to actionscript with an event such as pressing
    return and then have AS generate the grid width and height based
    upon the user input. The i (10) and j (10) values in line 4 and 5
    are the values that I need to have the user input to generate the
    grid.
    Any help will be most appreciated!
    initX = 0;
    initY = 0;
    counter = 0;
    for (var i = 1; i<=10; i++) {
    for (var j = 1; j<=10; j++) {
    counter++;
    grid_container.attachMovie("cellMC", "cell"+counter,
    counter);
    grid_container["cell"+counter]._x = initX;
    grid_container["cell"+counter]._y = initY;
    grid_container["cell"+counter].onRelease = function() {
    cellName.text = this._name;
    initX += 30;
    initY += 30;
    initX = 0;

    Thanks for the quick reponse kglad. I will give it a
    go.

  • Control xml data dynamically suing actionscript

    i want to load a xml file very dynamically in flash. i have a
    xml file as blow:
    <?xml version="1.0"?>
    <cbs>
    <employee>
    <number>1</number>
    <name>Shi Chuan</name>
    <comment>intern</comment>
    </employee>
    <employee>
    <number>1</number>
    <name>Shang</name>
    <comment>flasher</comment>
    </employee>
    <employee>
    <number>2</number>
    <name>Jakson</name>
    <comment>rapist</comment>
    </employee>
    <employee>
    <number>2</number>
    <name>Charles</name>
    <comment>director</comment>
    </employee>
    </cbs>
    when i load it in flash, i hope flash can recognize the value
    between the <number> tag. and put them into two groups(number
    1 one group, number 2 another group) according to their number. in
    this case, it should display:
    1st group:
    Shi Chuan
    intern;
    Shang
    flasher
    2nd group:
    Jakson
    rapist;
    Charles
    director
    if i add one more node in xml like below:
    <employee>
    <number>1</number>
    <name>John</name>
    <comment>healer</comment>
    </employee>
    i hope flash can auto-update the info and display:
    1st group:
    Shi Chuan
    intern;
    Shang
    flasher;
    john
    healer
    2nd group:
    Jakson
    rapist;
    Charles
    director;
    john
    healer
    don't know if you guys have any idea how to make it.
    pls help me! thank you.

    hi,
    yes it can be done in flash through actionscripting. what i
    would suggest to you is that go through some tutorial on it at
    www.kirupa.com or www.gotoandlearn.com.
    gaurav

  • Dynamically set checkbox with actionscript

    I'm trying to set checkboxes to selected/unselected based on
    variables pulled from a database.
    Problem is when the script is run is stops at this code
    (where cb is the id of a checkbox):
    cb.selected = true;
    The code compiles fine with no errors or warnings.
    Why isn't it possible to set the selected value of checkboxes
    through actionscript? Anyone have any ideas or workarounds?
    Thanks in advance

    Found a solution - here for anyone else who needs it:
    http://www.brucephillips.name/blog/index.cfm/2006/11/16/Dynamically-Create-CheckBoxes-Thei r-Labels-And-Their-Select-Values-In-Flex

  • Dynamic Smooth Curve using ActionScript

    Hi,
    Can anyone help me to solve my problem?
    I want to draw a smoth Ogive curve using ActionScript. The
    shape of the curve can be changed by setting the new values in the
    FLA file.
    Thanks in advance.
    Thanks
    Razzak

    I'd suggest you have a look at the MovieClip.curveTo() method
    in the Help.
    It gives a good example of drawing a circle.
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Kerning Dynamic Text through actionscript

    Hey,
    i know there is a way to assign a numeric leading property to
    dynamic text through the AS TextFormat class, and there is a
    boolean value to determine if text is kerned or not through
    TextFormat.
    What I want ot do is assign a kerning number to the text like
    you can using the property inspector when you drop a dynamic text
    instance on the Stage. Is this possible?
    I am creating a text field using AS and then manipulation it
    as such:

    I think the property you are looking for is called
    "letterSpacing". Using your example:
    txtFmt.letterSpacing = 10; // put 10 pixels before each
    character
    Tim

Maybe you are looking for

  • I tried to update itunes and now my ipod won't work. What's wrong?

    I tried to update itunes and now my ipod is not recognized in itunes or on my computer. It will only show a picture of the usb cord going into itunes and it won't do anything else. How do I make it work and what happened?

  • I want to produce my DVD selection page ???

    I want to master my DVD's inside FCP but unable to.  I want a selection page so that my clients can go to whichever chapter they choose.  This should be done by selecting the photo related to it. I have been advised to use a product like NERO but i f

  • Displaying an object!!

    Hi all..... In the following code I'm trying to draw a square and display it on the 3d scene/canvas. I plan to texture that square into a particle but at the moment my main concern is to see it on the canvas, could anyone help me do this, I can't see

  • MiniDV Camera with Video-In

    I'm in the market for a new digital video camera. In addition to the normal chores of recording new video, I'd like this to be able to do the double-duty of assisting me in importing to digital format my VHS collection. I've often read that many digi

  • Order Process Best Practice Suggestions?

    Hey CF World, I have to revamp an online order process. The process is broken into 4 steps. The app as it exists today was built by a different developer and for the life of me, I have wasted about 5 hours trying to figure out exactly what the person