Item renderer using action script

Hi,
Can anybody tell me how to use item renderers using actions script,
I have a data grid and iam using item renderer in mxml works fine but it is causing memory issues >
So i want to know to use item renderers in action script to avoid memory issue.
Thank You,
Anu

use the ClassFactory
example:
<!-- MyCombo.mxml -->
<?xml version="1.0" encoding="utf-8"?>
<mx:ComboBox xmlns:mx="http://www.adobe.com/2006/mxml" >
</mx:ComboBox >
and in ActionScript
private var myComboFac:ClassFactory = new ClassFactory(MyCombo);
private function myFunction():void
    colCombo.itemRenderer = myComboFac;  
and in DataGrid
<mx:DataGrid xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:columns>
        <mx:DataGridColumn id="colCombo" />
    </mx:columns>
</mx:DataGrid>
regards
Leonardo França
Adobe Certified Expert Flex 3 with AIR
Adobe Certified Expert Rich Internet Application Specialist v1.0
Adobe Certified Expert Flash CS3 Professional
Certified Professional Adobe Flex 2 Developer
Adobe Certified Professional Flash MX 2004 Developer
http://www.leonardofranca.com
http://twitter/leofederal
Manager AUGDF - Adobe User Group do Distrito Federal
http://www.augdf.com.br
http://twitter/augdf
anu3000 escreveu:
Hi,
Can anybody tell me how to use item renderers using actions script,
I have a data grid and iam using item renderer in mxml works fine but it is causing memory issues >
So i want to know to use item renderers in action script to avoid memory issue.
Thank You,
Anu
>

Similar Messages

  • Using action script 2 how can i send a variable value to a dynamic textbox on a different keyframe?

    using action script 2 how can i send a variable value to a dynamic textbox on a different keyframe?

    Thanks for your swift response.
    That sounds like a good solution, but the code I have on frame 2 is this
    timer = 0;
    countup = function(){
    timer++;
    countupInterval = setInterval(countup,100);
    If I added the same actionscript to frame 3 which has a dynamic textbox with a variable timer attached wouldn't it just put the timer back to 0? What I want is the last known value that was given when it was in frame 2.
    I am thinking of temple run here, I am trying to caculate the total distance(set in the timer variable) from the previous try.
    Hope this makes sense.
    Chazwick

  • Increasing the speed for a certian frames in Flash Cs5 using Action Script 3

    I have 60 frames I want to increase the fps value for frames from 20 to 30, and the remaining frames fps value should remain the same
    Using Action Script 3 or Action Script 2
    Thank you and regards

    I have found a script online
    Q: How can I speed the frame rate or slow it down when the movie is playing? For example, I would like to slow the frame rate from the default of 20 fps to 15 fps from frame #80 to frame #150. Then frame rate should speed back up to 20 fps after frame #151, (fps = frames per second).
    A: One way is to use “interval”. An example of changing the speed of the movie from frame #80 to frame #150 is shown below.
    Create a key frame at frame #80 and place this script:
    var fps:Number = 80;
    var intervalID:Number = setInterval(this, “advanceFrame”, 1000/fps);
    stop();
    function advanceFrame() {
    clearInterval(intervalID);
    gotoAndStop(_currentframe+1);
    if (_currentframe<151) {
    intervalID = setInterval(this, “advanceFrame”, 1000/fps);
    } else {
    play();
    I have changed the values from 80 to 20 and currentframe value to 30
    I get syntax error
    at :
    intervalID = setInterval(this, “advanceFrame”, 1000/fps);
    and
    var intervalID:Number = setInterval(this, “advanceFrame”, 1000/fps);
    In flash cs5

  • How t o create breadcrumbs in flash cs 5 using action script 2.0?

    how t o create breadcrumbs in flash cs 5 using action script 2.0?
    If the user is going throungh some buttons then at last there is breadcrumb on last scene (like it is selected 1,2 or 3 button etc..)then final display should show last used button.
    Am besically looking for breadcrumb.Can anyone know how to create breadcrumb with using movie clip?or any other code?
    Can any one help me?

    My problem is when i cross first,second and then third scene then on third scene if there is any crieteria like to show the value which user have used like if user have selected "a" on first scene and "b" on second scene.then on third scene if there is criteria-
    first scene-
    second scene-
    then it should show value like-
    first scene-"a"
    second scene-"b"
    This "a","b", have separet sound file.It should show "a","b" text and also sound should play after click on button.
    Can any on help?

  • 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?

  • Help with Nav Bar using Action Script 3

    I am a flash NOOB to say the least.  Trying to teach myself.  Thank God for YouTube! LOL!  Anyway, I have build a Nav Bar for a site that has a sliding bar on the bottom of it that follows the mouse.  The problem with this nav bar is that when you change pages inside the site, the slider resets back to position X/Y = 0 and you really don't know what page you are on for sure without me having to identify each page in the page body itself.
    Does anyone know of a way using action script to have the URL of the page sent to flash and in turn use that URL to set the X and Y position of the slider to the appropriate X and Y of the button on the Nav Bar for the page the user is on?
    I have heard of using flash.external.ExternalInterface but now for sure how this really works nor if I can assign it to a variable for reference inside the action script.
    Any help would be appreciated greatly!!

    The Flash Nav Bar is at the top of each page.  But yes, when you click a button inside the flash nav bar it takes you away from your current page and loads a new one.  I am trying to tell the swf file which page it is on so I can set the X and Y position of the slider.
    You will have to excuse me if I am so noob that I loose any of your replies to this as just as Flash is new to me, so is the lingo.
    Thank you for your help.  I will research FlashVar but if you have any other ideas then I am open to them.

  • How to hide layers or movies using Action Script

    Hi All,
    I am using a few layers and would like to hide a specific
    layer using action scripts - I guess I dont mind doing it as a
    movie clip too (hiding the movide clip).
    Also I am interested in controling the final *.swf via an
    external command to hide that layer or movie clip. How do I do
    that?
    Thanks in advance,
    Steven

    rsagi: Layers are only layers while you are editing the fla.
    When compiled, layers are merged. I think the best way would be to
    use movieclips as containers and hide the "container movieclips".
    jlucchesi: from fl8_as2lr.pdf:
    "The alpha transparency value of the movie clip. Valid values
    are 0 (fully transparent) to 100
    (fully opaque). The default value is 100. Objects in a movie
    clip with _alpha set to 0 are
    active, even though they are invisible. For example, you can
    still click a button in a movie clip
    whose _alpha property is set to 0. To disable the button
    completely, you can set the movie
    clip's _visible property to false."

  • How to accessing item renderers in action script??

    Hi
    I am working on itemrenderes in Flex!
    I have link button component as item renderer inside one of the data grid column, please find my piece as below!
    Now how do we make that item render invisible once we click on it!
    We need to make that link button invisible to the user!
    Let me know how to access like this!
    public function onClick():void {
                // we use our custom component as the template for the popup window
                var confirmWindow:TitleWindow = TitleWindow(PopUpManager.createPopUp(this, ConfirmationPopUp, true));
                // you will only need to take care of the yes response since you don't have to do anything
                // if the response was a no
                confirmWindow.addEventListener("selectedYes", function():void {  
                            //Alert.show("Can be Upgraded to an Alarm");
                            upGradeEventToAnAlarm();
                confirmWindow.addEventListener("selectedNo", function():void {         
            public function upGradeEventToAnAlarm():void
                eventRO = new RemoteObject();                  
                      eventRO.destination = "eventBrowser";
                      eventRO.upGradeEventToAlarm.addEventListener("result",getResultHandler);                 
                      eventRO.addEventListener("fault", getFaultHandler);
                      eventRO.upGradeEventToAlarm(eventsDataGrid.selectedItem.id);
            private function getResultHandler(event:ResultEvent):void
                      //eventsDataGrid.dataProvider.removeItemAt(eventsDataGrid.selectedIndex)
                      if(event.result == true)
                       Here I need to access the link button which is clicked and need to make invisible
    Alert.show("Successfully  Upgraded to an alarm");
                      else
                            Alert.show("Cannot be Upgraded to an alarm");  
                //Fault Handler.             
                private function getFaultHandler(event:FaultEvent):void 
                      Alert.show(event.fault.faultString, 'Error');
                ]]>
    </mx:Script>           
          <mx:TabNavigator x="24" y="25" width="95%" height="90%"
                styleName="MyTabNavigator" horizontalGap="-20"  backgroundColor="#e6e4e5">
                <mx:Canvas label="View" width="100%" height="100%" >
                      <mx:DataGrid id="eventsDataGrid" dataProvider="{myModel.eventsList}"
                             height="90%" width="98%" x="10" y="23" >
                      <mx:columns>
                      <!--  <mx:DataGridColumn  id="iconFlagID" headerText="IconFlag"
                                  dataField="iconFlag" visible="false"/>-->
                            <mx:DataGridColumn  headerText="EventID" dataField="id" visible="false"/>
                            <mx:DataGridColumn  headerText="Event Name" dataField="eventName"/>
                            <mx:DataGridColumn  id="catFieldId" headerText="Category"
                                  dataField="category"/>
                            <mx:DataGridColumn  headerText="AlarmName" dataField="alarmName"/>
                            <mx:DataGridColumn  headerText="Severity" dataField="severity"/>
                            <mx:DataGridColumn  headerText="Source" dataField="source"/>
                            <mx:DataGridColumn  headerText="Updated Time" dataField="updateTime"/>
                            <mx:DataGridColumn  headerText="Description" dataField="description"/>
                            <mx:DataGridColumn  id="upgradeLinkButtonId" 
                                  headerText="Upgrade To Alarm" dataField="iconFlag">                          
                            <mx:itemRenderer>
                            <mx:Component>
                    <mx:Box height="100%" width="100%">               
                    <mx:LinkButton id="eventsLinkButtonID" textDecoration="underline"
                                  icon="@Embed(source='assets/eventsBrowser/images[97]1.JPG')"
                                  click="outerDocument.onClick();" visible="{!data.iconFlag}"
                                  textAlign="center" includeInLayout="true">
                    </mx:LinkButton>                                       
                            </mx:Box>
                    </mx:Component>
                    </mx:itemRenderer>
                            </mx:DataGridColumn>
                      </mx:columns>    
                      </mx:DataGrid>
    Thanks in advance
    Aruna.S.N.

    Hi Prashant
    Thanks for your reply!
    But where my viewStack need to be declared??
    Is it inside dataGridColumn if so its giving error as comonent declaration is not allowed here!
    Tell me how to go about!
    Thanks in advance
    Aruna.S.N.

  • Ai file to psd using actions/script

    Hi, Does anyone know a way to turn an illustrator file in to a psd?
    I need to end up with a layered psd with all the layer names taken from the the illustrator layers.
    I also need the paths from those layers to be present as layers in the paths palette in the psd, ideally using the same names.
    I suspect this must be a fairly common problem.
    Any ideas, scripts or plugins?
    I think it's doable with actions and or scripting.
    Cheers,
    Tom B

    Thanks for the responses guys.
    I'm doing character artwork and need to create the separate parts of the character in groups of layers.
    Each of the body part groups contain 5 layers, with names like "outline", "texture",  "shading", etc.
    It's all very consistent and methodical and great if you want change the pose slightly or produce a Flash character from a digital painting.
    The line art that comprises the body parts is kept separate from the shading layers so I can re-stoke the line art in Photoshop when the character needs to be drawn at a different resolution (line-weight is an issue for us).
    Also the brushes available in Illustrator just aren't up to the kind of filter-riddled, messy, highly convincing digital painting I need to supply here.
    Potentially I could create a very efficient workflow, a single drawing being rendered out at a variety of resolutions, in a variety of styles, all utilising my wonderfully natural-media style Photoshop brushes, with the bonus of easy import in to Flash too.
    I tried the Export with layers method- worked for the most part with a few exceptions, thanks for the advice.
    Keeping the AI file layers simple isn't a problem- I'm such a newb they don't get complex!
    I don't believe it'll be a complete nightmare to accomplish as Adobe CS is supposed to lend it'self to just such a workflow.
    I think I'll try exporting the AI file paths to the layers bearing the same names using actions, as there seems no other built-in facility in either app to do this.
    I'd be interested to hear how one might use Smart Objects to the same end- they'd need to be a Smart Object that 's stroked in Photoshop, and editable like a normal Smart Object, am I missing something?
    Will let you know how I get on. If anyone has any brainwaves in the meantime, please don't hesitate to post more here
    Thanks,
    Tom B

  • How to create a COOL entrance page like this using action Script 3

    Hey dudes!
    so i have a project where i will be making a website.
    I will be using flash to make it interactive and visually appealing. I found a website with a really cool entrance page, please view it here:http://www.dvf.com/dvf/
    i don't really know much about the action script language so be as precise and clear please
    anyways whenever the mouse moves, the background looks like its moving.
    can someone please tell me how you could do this in flash???
    PLEEASSEEE i reallly reallly needd this. thanks so muchh

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

  • How to dispatch custom events from an item renderer used for Datagrid Column

    Hi,
    I am using an Item Renderer for a Data Grid Column and in that mxml, I am dispatching a custom event with data.
    But the main mxml which has the DataGrid is not able to resolve the event. How can I solve this?
    Thanks

    Hi,
    This is the constructor for Event.
    public function Event(type:String, bubbles:Boolean  = false, cancelable:Boolean  = false)
    When you created your custom event after extending from Event, for the parent container receives the event, the bubbles property must be set to true.
    Please check if you have done so. That should solve the problem. Let me know if it doesn't.
    Nishad

  • How to capture an image and save it using action script

    Hello,
    I need to know if is posible to capture an image or a screen region and save it using action scrip.
    Somebody know how to do it ??
    Thanks

    you can capture an image using the bitmapdata class and getPixel().  you can then save that to a bitmap using server-side code like php.

  • Adding data to cfgrid using action script

    how can i add data to a grid row called name in action
    script. i have a cfselect control containing name of students and i
    want to add the values of the selected student from the list to
    grid.

    Did you add your instance of SpectrumCanvas to the stage with addChild()?
    If so, you should boil your posted code to a more simple example.
    If this post answered your question or helped, please mark it as such.

  • CS4  Can't Use Actions Scripts

    Win XP Pro SP3.  I run Batch Actions Scripts all the time to (i.e.) resize a group of images foir web, etc.  Suddenly batch actions won't work.  Trying to run the same script I've already run all morning (and in the past) I get a pop-up telling me that "Image Size Command is not available".  None of the commands are available.  Funny thing is I'm getting the same error message whern I try to run the same action in PS6.  I've re-booted, tried creating new actions (in both versions).. nothing works.  I even tried worling thru a new user ID log-in in XP.
    Nothing works.  Adobe won't help unless  I pay the $39.
    Help ???

    There are several reasons that might happen.
    Could you post a screenshot of one of the actions and also of
    the batch dialog?
    MTSTUNER

  • How to stop the animation at a certain frame using action script 3.0 .

    How to stop on a frame to stop the animtion using adobe flash cc.

    Either put a stop(); command in the desired frame of the animation's timeline, or have an ENTER_FRAME event listener working who's event handler function constantly check the currentFrame value of the animation and issues an animation.stop(); command when the desired frame is reached

Maybe you are looking for

  • ABAP Proxy Structure

    Hi, I have SAP server at sender side, XI is my middleware and  two 3rd partyservers on the receiver side. So,from SAP side data  comes through proxy,I would generate a structure which contains the fields required to send the data to both the receiver

  • How to call a form with parameters in PL/SQL

    hi I added a button in my form,now I want to call another form in the button's PL/SQL prucedure. how to do it? thinks Frank

  • Printing of cheque created through FCH5

    Hi I am creating vendor down payment wrt payment request in T code F-48 screen. again i am creating cheque for that payment document in FCH5 screen. How to do cheque printing manually for cheque cerated in FCH5 screen. Please help me in this regard.

  • Difference between Business Analyst SAP SD and SAP SD consultant

    Hi friends I need openion about what is difference between Business Analyst SAP SD and SAP SD consultant. Raj

  • Announcing New! Oracle Policy Automation Connector for Oracle CRM on Demand

    Hi all, We are very pleased to announce the immediate availability of the new OPA connector for Oracle CRM on Demand. You can find more information and the link to download this connector on the OPA pages on OTN here: http://www-content.oracle.com/te