Coloring using AS3 instead of AS2

Hello Adobe,
I'm making my final year project which is education game and one of the game is coloring game, so I've finished it and all works well, then i just found out that the code I was using is AS2, meanwhile all the other game and files is running in AS3, so I've to make this coloring game code into AS3, but just can't fix it how hard I try.
Here is the view of what I made, not done the graphic part yet, looks really bad
http://i51.tinypic.com/t6qeyv.jpg
Here is the code I have and works on AS2
colorvalue="";
RedColourBtn.onRelease=function(){
colorvalue="0xFF0000";
BlueColourBtn.onRelease=function(){
colorvalue="0x0000FF";
area1.onRelease=function(){
colour= new Color(this);
colour.setRGB(color_value);
area2.onRelease=function(){
colour= new Color(this);
colour.setRGB(color_value);
Thanks for your time

Here is the convertion
RedColourBtn.addEventListener(MouseEvent.CLICK, determineColor);
BlueColourBtn.addEventListener(MouseEvent.CLICK, determineColor);
    var colorvalue:uint;
function determineColor(arg:MouseEvent)
    var colorSquareName:String = arg.currentTarget.name;
    if (colorSquareName == "RedColourBtn")
        colorvalue= 0xFF0000;
    else if (colorSquareName == "BlueColourBtn")
        colorvalue= 0x0000FF;
area1.addEventListener(MouseEvent.CLICK, area1fn);
area2.addEventListener(MouseEvent.CLICK, area2fn);
function area1fn(e:MouseEvent):void{
    var colorTransform:ColorTransform = area1.transform.colorTransform;
    colorTransform.color = colorvalue;
     area1.transform.colorTransform = colorTransform;
function area2fn(e:MouseEvent):void{
    var colorTransform:ColorTransform = area2.transform.colorTransform;
    colorTransform.color = colorvalue;
    area2.transform.colorTransform = colorTransform;

Similar Messages

  • Fireflies using AS3, conversion from AS2

    Hey guys. I'm new to AS3. I do know the bare basics. I figure someone on here will know more than my teacher. (I'm paying for a class to learn actionscript, and as it turns out, he does as little of it as possible.) I wanted to have fireflies floating on my project, like particle effects. I have everything working with a tweaked version of an AS2 file I came across. Everything works in AS2, but I have no idea how to convert the syntax to work in my AS3 file. I get that they're different from each other, but can someone help me acheive the same results in AS3?
    http://www.mediafire.com/?o3qcc9bbt8b4p73
    The original is the file I'm trying to modify, and fireflies.fla is my modifications, in case anyone wants to see how poorly coded my translation was. It keeps telling me that it can't set the value for a String, though I'm not sure why.
    There are two basic components. "Pointer" is an invisible instance that the fireflies use as an anchor (so they can't go off the page), and mcObj is called from the library and is the firefly graphic with coding.
    The actionscript for the the parent is:
    Stage.align = "";
    Stage.scaleMode = "noScale";
    Stage.showMenu = false;
    Stage.onResize = false;
    damp = 0.65;
    Fat = 2;
    limx = 1000;
    limy = 100;
    maxScale = 8;
    bugNum = 15;
    startX = pointer._x;
    startY = pointer._y;
    pointer._visible = 0;
    for (i=1; i<=bugNum; i++) {
        attachMovie("bug", "bug"+i, i);
        dot = eval("bug"+i);
        dot._xscale = dot._yscale=maxScale;
        dot.color = new Color(dot);
        dot.color.setRGB("0xFFFF66");
        dot._x = startX+Math.random()*600;
        dot._y = startY+Math.random()*200;
    btn.onRollOver = function() {
        _root.light.gotoAndPlay(2);
    btn.onRollOut = function() {
        _root.light.gotoAndStop(1);
    And the coding for the firefly is:
    this._x = this._x+this.vx;
    this._y = this._y+this.vy;
    this.vx = this.vx+(Math.random()*2-1);
    this.vy = this.vy+(Math.random()*2-1);
    this.vx = this.vx*_parent.damp;
    this.vy = this.vy*_parent.damp;
    this._xscale = this._xscale-_parent.fat;
    this._yscale = this._yscale-_parent.fat;
    if (_parent.startX+_parent.limx<this._x) {
        this.vx = -this.vx;
        this._x = _parent.startX+_parent.limx;
    if (this._x<_parent.startX-_parent.limx) {
        this.vx = -this.vx;
        this._x = _parent.startX-_parent.limx;
    if (_parent.startY+_parent.limy<this._y) {
        this.vy = -this.vy;
        this._y = _parent.startY+_parent.limy;
    if (this._y<startY.startY-_parent.limy) {
        this.vy = -this.vy;
        this._y = _parent.startY-_parent.limy;
    if (_parent.maxScale<this._yscale || this._yscale<_parent.maxScale/25) {
        _parent.fat = -_parent.fat;
    Anyone who can help, please do. I need to have this done by the end of the week :/

    //stage.align = "";
    stage.scaleMode = "noScale";
    stage.showDefaultContextMenu = false;
    var damp:Number = 0.65;
    var Fat:Number = 2;
    var limx:Number = 1000;
    var limy:Number = 100;
    var maxScale:Number = 8;
    var bugNum:int = 15;
    var startX:Number = pointer.x;
    var startY:Number = pointer.y;
    pointer.visible = false;
    for (var i:int=1; i<=bugNum; i++) {
        //attachMovie("bug", "bug"+i, i);
    this["bug"+i]=new but();  // assign class
    addChild(this["bug"+i]);
       var  dot:MovieClip = this["bug"+i];
        dot.scaleX = dot.scaleY=maxScale;
    var ct:ColorTransform=dot.colorTransform;
    ct.color = 0xFFFF66;dot.colorTransform=ct;    dot.x = startX+Math.random()*600;
        dot.y = startY+Math.random()*200;
    btn.addEventListener(MouseEvent.MOUSE_OVER,onRollOverF);
    btn.addEventListener(MouseEvent.MOUSE_OUT,onRollOutF);
    function onRollOverF(e:MouseEvent):void {
        MovieClip(root).light.gotoAndPlay(2);
    function onRollOutF(e:MouseEvent):void {
        MovieClip(root).light.gotoAndStop(1);
    And the coding for the firefly is:
    var initialized:Boolean;
    if(!initialized){
    this.vx=0;
    this.vy=0;
    initialized=true;
    this.x += this.vx;
    this.y += this.vy;
    this.vx = this.vx+(Math.random()*2-1);
    this.vy = this.vy+(Math.random()*2-1);
    this.vx = this.vx*MovieClip(parent).damp;
    this.vy = this.vy*MovieClip(parent).damp;
    this.scaleX -= MovieClip(parent).fat;
    this.scaleY = this.scaleX;
    if (MovieClip(parent).startX+MovieClip(parent).limx<this.x) {
        this.vx = -this.vx;
        this.x = MovieClip(parent).startX+MovieClip(parent).limx;
    if (this.x!=MovieClip(parent).startX-MovieClip(parent).limx) {
        this.vx = -this.vx;
        this.x = MovieClip(parent).startX-MovieClip(parent).limx;
    if (MovieClip(parent).startY+MovieClip(parent).limy<this.y) {
        this.vy = -this.vy;
        this.y = MovieClip(parent).startY+MovieClip(parent).limy;
    if (this.y!=MovieClip(parent).startY-MovieClip(parent).limy) {
        this.vy = -this.vy;
        this.y = MovieClip(parent).startY-MovieClip(parent).limy;
    if (MovieClip(parent).maxScale<this.scaleX || this.scaleY<MovieClip(parent).maxScale/25) {
        MovieClip(parent).fat = -MovieClip(parent).fat;

  • Dynamic Photo Gallery in Flash using AS3.0 and XML, but it doesn't work and missed up my app.

    Hi,
    I am creating an iPad app using AS3. The app contains three sections.
    One of those sections (chocolate sources)contains Dynamic Photo Gallery using XML. The photos, thumbnails, and text in this section are loaded from XML.
    I faced may issue when I tried to run this app:
    The gallery photos didn't show up
    The thumbnails (buttons to navigate the photo gallery) didn't show up at all. (The thumbnails should show up under the photo gallery box.)
    The text doesn't show up (the text should be in every photo as describtion)
    I want to include Swipe in the photo gallery, how can I do that?
    When I click on "Chocolate Sources" button, the photo gallery appears in every section, here are print screens describe what I mean:
    The photo gallery covers the home screen too.
    Here is my XML:
    <?xml version="1.0" encoding="utf-8"?>
    <sources>
              <section>
                        <details>
                                            Cocoa tree exists in the tropics area, such as Central and South America.
                                  </details>
                                            <image>
                                                      <url>coca1.jpg</url>
                                                      </image>
                                                      </section>
              <section>
                        <details>
                        Cocoa is supplied in many countries such as Indonesia, Ghana, Brazil, Ecuador and Cameroon.
                        </details>
                                  <image>
                                  <url>coca2.jpg</url>
                                  </image>
                                            </section>
              <section>
                                  <details>
                                  Dark chocolate helps to relax and reduce the stress and blood pressure because it has antioxidants elements, which helps in vasodilatory process.
                                  </details>
                                            <image>
                                            <url>coca3.jpg</url>
                                                      </image>
                                                                </section>
              <section>
                        <details>
                        Chocolate provides energy and hyperactive sometimes because it contains high level of caffeine and sugar.
                        </details>
                                  <image>
                                  <url>coca4.jpg</url>
                                            </image>
                                                      </section>
              <section>
                        <details>
                        Chocolate could be mixed with many different flavors, such as mint, strawberry, orange, banana, vanilla, hazelnut, almond, coconut, and etc.
                        </details>
                                  <image>
                                  <url>coca5.jpg</url>
                                  </image>
                                            </section>
              <section>
                        <details>
                                  Chocolate is expressing of well hospitality and good time due to its lovely taste.
                                  </details>
                                            <image>
                                            <url>coca6.jpg</url>
                                                      </image>
                                                                </section>
    </sources>
    And here is my Action Script for "Chocolate Sources" section:
    stop();
    function Choco1(evt:MouseEvent): void {
              gotoAndStop('16');
    choco_btn.addEventListener(MouseEvent.CLICK,Choco1);
    function Souc1 (evt:MouseEvent): void {
              gotoAndStop ('31');
    souc_btn.addEventListener(MouseEvent.CLICK,Souc1);
    function ShopIn1 (evt:MouseEvent):void {
              gotoAndStop('46');
    shops_btn.addEventListener(MouseEvent.CLICK,ShopIn1);
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import flash.display.MovieClip;
    import flash.display.Loader;
    import fl.motion.MotionEvent;
    import flash.events.MouseEvent;
    import flash.sampler.NewObjectSample;
    import flash.text.TextFormat;
    var xmlLoader: URLLoader = new URLLoader (new URLRequest("sources.xml"));
    xmlLoader.addEventListener(Event.COMPLETE, finishedXmlLoader);
    var xmlFile:XML;
    var xextend:int = 10;
    var gal:galary = new galary ();
              gal.x = 85;
              gal.y = 165;
              addChild(gal);
    var txfe: TextField = new TextField ();
    txfe.x = 25;
    txfe.y = 45;
    var tformat:TextFormat = new TextFormat ();
    tformat.bold = true;
    tformat.color = 0xFFFFFF;
    tformat.size = "18";
    tformat.font = "Arial";
    txfe.defaultTextFormat = tformat;
    addChild(txfe);
    function finishedXmlLoader (e:Event): void{
              xmlFile = new XML (xmlLoader.data);
              var leng:int = xmlFile.image.length();
              txfe.text = xmlFile.image.details[0];
              for (var i:int = 0;i<leng;i++){
                        var b:thumbs = new thumbs ();
                        b.x = xextend;
                        b.y = 480;
                        b.buttonMode = true;
                        b.details = (i+1).toString();
                        addChild(b);
                        b.addEventListener(MouseEvent.MOUSE_OVER, theMosover);
                        b.addEventListener(MouseEvent.MOUSE_OUT, theMosout);
                        b.addEventListener(MouseEvent.CLICK, onMosClick);
                        var bloader:Loader = new Loader();
                        bloader.load(new URLRequest("thumbs/" + (i+1) + ".jpg"));
                        b.addChild(bloader);
                        xextend += b.width + 50;
    var loader:Loader = new Loader ();
    loader.load(new URLRequest ("pictures/coca1.jpg"));
    gal.addChild(loader);
    function theMosover(m:MotionEvent):void{
              m.currentTarget.alpha = 0.5;
    function theMosout (m:MouseEvent):void{
              m.currentTarget.alpha = 1.0;
    function onMosClick(m:MouseEvent):void{
              var loader:Loader = new Loader();
              loader.load(new URLRequest("pictures/" + m.currentTarget.details + ".jpg"));
              gal.addChild(loader);
              txfe.text = xmlFile.image.details[int(m.currentTarget.details) -1];
    I need an urgent help to fix the errors and make this section work well.
    thanks.

    try:
    txfe.text = xmlFile.section[int(m.currentTarget.details) -1].details;
    instead of
    txfe.text = xmlFile.image.[int(m.currentTarget.details) -1];
    and add your thumbs to gal, not the stage.  when you're done with the gallery, remove gal.

  • Creating AIR/Web Apps. with XML & E4X using AS3

    Needing tips using AS3 with XML/E4X to make my project work over the server:
    1) Here I'm having trouble trying to create a component with a 'GOOGLE MAP' with the user being able to input their location for directions with once submitting the get directions button that it generates the directions in the datagrid automatically.
    2) Including a 'DATAGRID'  for customers to be able to retain their info in a datagrid that has been updated by office personnel from an 'AIR APPLICATION' with a XML file that holds the customers info
    /**the Component*/
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:s="library://ns.adobe.com/flex/spark" width="1400" backgroundColor="#666666" xmlns:mx2="library://ns.adobe.com/flex/mx" creationComplete="initApp(event)">
        <mx:Style source="map_1.css"/>
        <mx:XML id="customer_info.xml" source="Assets/customer_info.xml" />
    <mx:Script>
            <![CDATA[
                /**Google Map Code API:http://code.google.com/apis/maps/documentation/flash/tutorial-flexbuilder.html#DeclaringMa ps_&
                 _http://www.adobe.com/devnet/flex/articles/googlemaps_api.html */
                import com.google.maps.LatLng;
                import com.google.maps.Map;
                import com.google.maps.MapEvent;
                import com.google.maps.MapType;
                private function onMapReady(event:Event):void {
                        this.map.setCenter(new LatLng(31.683952973286058, -97.09904551506042), 14, MapType.NORMAL_MAP_TYPE);
                            click="processForm(event);"
                            private function processForm(event:Event):void { trace(from.text + " " + to.text); }
                [Bindable]
                    public var directionsSteps:ArrayCollection = new ArrayCollection();
                    dataProvider="{directionsSteps}"
                    var directions:Directions = new Directions(); directions.addEventListener(DirectionsEvent.DIRECTIONS_SUCCESS, onDirectionsSuccess);
                    directions.addEventListener(DirectionsEvent.DIRECTIONS_FAILURE, onDirectionsFail);directions.load("from: " + from.text + " to: " + to.text);
                    Alert.show("Status:" + event.directions.status);
                    map.clearOverlays(); var directions:Directions = event.directions; var directionsPolyline:IPolyline = directions.createPolyline(); map.addOverlay(directionsPolyline);
                                var directionsBounds:LatLngBounds = directionsPolyline.getLatLngBounds(); map.setCenter(directionsBounds.getCenter()); map.setZoom(map.getBoundsZoomLevel(directionsBounds));
                                var startLatLng:LatLng = dir.getRoute(0).getStep(0).latLng;
                                var endLatLng:LatLng = dir.getRoute(directions.numRoutes-1).endLatLng; map.addOverlay(new Marker(startLatLng)); map.addOverlay(new Marker(endLatLng));
                    for (var r:Number = 0 ; r < directions.numRoutes; r++ ) { var route:Route = directions.getRoute(r); for (var s:Number = 0 ; s < route.numSteps; s++ )
                    { var step:Step = route.getStep(s); directionsSteps.addItem(step);
                                    directionsSteps.removeAll();
                                    itemClick="onGridClick(event)"
                                    privatefunction onGridClick(event:Event):void { var latLng:LatLng = directionsGrid.selectedItem.latLng;
                                        var opts:InfoWindowOptions = new InfoWindowOptions(); opts.contentHTML = directionsGrid.selectedItem.descriptionHtml; map.openInfoWindow(latLng, opts);
                                        var ServerPath:String = "http://www.sometext.com/";
                                        var ServerPage:String = serverPath + "getCountries";
                                                dataProvider="{directionsSteps}"
                                                var directions:Directions = new Directions(); directions.addEventListener(DirectionsEvent.DIRECTIONS_SUCCESS, onDirectionsSuccess); directions.addEventListener(DirectionsEvent.DIRECTIONS_FAILURE, onDirectionsFail);
                                                directions.load("from: " + from.text + " to: " + to.text);
                                                Alert.show("Status:" + event.directions.status);
                                                map.clearOverlays(); var directions:Directions = event.directions; var directionsPolyline:IPolyline = directions.createPolyline();
                                                map.addOverlay(directionsPolyline);
                                                var directionsBounds:LatLngBounds = directionsPolyline.getLatLngBounds(); map.setCenter(directionsBounds.getCenter());
                                                map.setZoom(map.getBoundsZoomLevel(directionsBounds));
                                                var startLatLng:LatLng = dir.getRoute(0).getStep(0).latLng; var endLatLng:LatLng = dir.getRoute(directions.numRoutes-1).endLatLng; map.addOverlay(new Marker(startLatLng));
                                                map.addOverlay(new Marker(endLatLng));
                                                for (var r:Number = 0 ; r < directions.numRoutes; r++ ) { var route:Route = directions.getRoute(r); for (var s:Number = 0 ; s < route.numSteps; s++ )
                                                { var step:Step = route.getStep(s); directionsSteps.addItem(step); } }
                                                directionsSteps.removeAll();
                                                itemClick="onGridClick(event)"
                        import flash.events.IOErrorEvent;
                        import flash.events.SecurityErrorEvent;
                                    var sender:URLLoader;
                                    var sendPage:URLRequest;
                                    var sendVars:URLVariables;
                                         initApp;
                                        function initApp:void {
                                    var ServerPath:String = "http://localhost/silverfoxcc/";
                                    var url:String = serverPath + "login.aspx";
                                    sender = new URLLoader();
                                    sendPage = new URLRequest(url);
                                    sendPage.method = URLRequest.POST;
                                    sendvars = new URLVariables();
                                    SUBMIT.btn.addEventListener(MouseEvent.CLICK, clickHandler);
                                    sender.addEventListener(Event.COMPLETE, completeHandler);
                                    sender.addEventListener(IOErrorEvent.SECURITY_ERROR, securityErrorhandler);
                                                function clickhandler(e:MouseEvent:void{
                                                    var suppSUBMIT:String = username_txt.text;
                                                    var suppRESET:String = reset_txt.text;
                                                    if (suppSUBMIT.length > 0 && suppRESET.length > 0) {
                                                        message_txt.text = "";
                                                        sendVars.submit = suppSUBMIT;
                                                        sendVars.reset = suppRESET;
                                                        sendPage.data = sendVars;
                                                        sender.load(sendPage);
                                                    else{
                                                        message_txt.text ="You must enter a last name and customer identification before clicking the submit button."
                                                  function completeHandler(e:Event):void{
                                                      var xmlResponse:XML = XML(e.target.data;
                                                          var userMessage:String;
                                                          if (xmlResponse.text().toString() == "true") {
                                                              userMessage = "Congratulations, information is retrieved"'';
                                                          else {
                                                              usermessage = "Information to be retrieved failed. Please try again";
                                                                              message_txt.text =userMessage;
                                                                      function ioErrorHandler(e:IOErrorEvent):void{
                                                                          message_txt.text = e.text;
                                                                      function securityErrorHandler(e:SecurityErrorEvent):void {
                                                                          message_txt.text = e.text;
                                                             /**Foundation for Ed: XML & E4X-Chapter 9: COMMUNICATION WITH THE SERVER*/
                                                              import mx.events.FlexEvent;
                                                              import xmlUtilities.XMLLoader;
                                                              import flash.events.IOErrorEvent;
                                                              import flash.events.SecurityErrorEvent
                                                              private var serverPath:String = "http://localhost/FOE/";
                                                              private function initApp(e:FlexEvent):void {
                                                                  myXMLLoader = new XMLLoader();
                                                                  myXMLLoader.addEventListener(Event.COMPLETE, completeHandler);
                                                                  myXMLLoader.addEventListener(IOErrorEvent.IO_Error, IOErrorHandler);
                                                                  SUBMIT.btn.addEventListener(MouseEvent.CLICK, clickHandler);
                                                                          private function completeHandler(e:Event):void{
                                                                              var userMessage:String;
                                                                              var response:String =myXMLLoader.response().toString();
                                                                              if (response:String = myXMLLoader.response().toString();
                                                                                  if (response == true"){
                                                                                         usermessage = "Congratualtions. You were successful";
                                                                                              else{
                                                                                            userMessage = Login failed. Please try again";
                                                                                      message_txt.text = userMessage;
                                                                                  private function clickHandler(e:MouseEvent):void{
                                                                                      var SUBMIT:String = submit_txt.text;
                                                                                      var RESET:String = reset_txt.text;
                                                                                      vars myVars:URLVariables = new URLVariables();
                                                                                      if (username.length > 0 && password.length > 0) {
                                                                                          myVars.SUBMIT = submit;
                                                                                          myVars.CUSTMER ID = customerid;
                                                                                          myXMLLOADER.loafxml("login.aspx, myVars);
                                                                                            else {
                                                                                             message_txt.text = "You must enter a last name and customer id before clicking the submit button"
                                                                                  private function IOErrorHandler(e:IOErrorEvent):void{
                                                                                      message_txt.text = e.text;
                                                                                  private function securityErrorHandler(e:SecurityErrorEvent):void{
                                                                                      message_txt.text = e.text;
                                                                            /**Foundation for Ed: XML & E4X-Chapter 8: MODIFYING XML CONTENT WITH ACTIONSCRIPT 3.0*/
                                                                                import mx.events.FlexEvent;
                                                                                import mx.events.ListEvent;
                                                                                import mx.collections.XMLListCollection;
                                                                                import xmlUtilities.MyXMLLoaderHelper;
                                                                                import mx.events.FlexEvent;
                                                                                import mx.events.DataGridEvent;
                                                                                private function initApp(e:Event):void {
                                                                                /add testing lines here
                                                                                            private var myXMLLoader:MyXMLLoaderHelper;
                                                                                            private function initApp(e:FlexEvent):void {
                                                                                                 myXMLLoader = new MyXMLLoaderHelper();
                                                                                                 myXMLLoader.addEventListener(Event.COMPLETE, completeHandler);
                                                                                                 myXMLLoader.addEventListener("xmlUpdated", xmlUpdatedHandler);
                                                                                                 authors_cbo.addEventListener(ListEvent.CHANGE, changeHandler);
                                                                                                 addRow_btn.addEventListener(MouseEvent.CLICK, addClickHandler);
                                                                                                 delete_btn.addEventListener(MouseEvent.CLICK, deleteClickHandler);
                                                                                                 books_dg.addEventListener(DataGridEvent.ITEM_EDIT_END, itemEditEndHandler);
                                                                                                 authors_cbo.labelFunction = getFullName;
                                                                                                 myXMLLoader.loadXML("Assets/customer_info.xml", "lastname");
                                                                                            private function completeHandler(e:Event):void {
                                                                                                 authors_cbo.dataProvider = myXMLLoader.getChildElements("author");
                                                                                                 tree_txt.text = myXMLLoader.getXML().toXMLString();
                                                                                                 books_dg.dataProvider = myXMLLoader.getBooks(0);
                                                                                            private function getFullName(item:Object):String {
                                                                                              return item.authorFirstName + " " + item.customerLastName;
                                                                                            private function changeHandler(e:Event):void {
                                                                                                 books_dg.dataProvider = myXMLLoader.getBooks(e.target.selectedIndex);
                                                                                            private function addClickHandler(e:MouseEvent):void {
                                                                                              var newBookName:String = name_txt.text;
                                                                                              var newPublishYear:String = year_txt.text;
                                                                                              var newBookCost:String = cost_txt.text;
                                                                                              var authorIndex:int = authors_cbo.selectedIndex;
                                                                                              if(newBookName.length > 0 && newPublishYear.length > 0 && newBookCost.length > 0) {
                                                                                                 myXMLLoader.addBook(authorIndex, newBookName, newPublishYear, newBookCost);
                                                                                            private function deleteClickHandler(e:MouseEvent):void {
                                                                                              var bookIndex:int = books_dg.selectedIndex;
                                                                                              var authorIndex:int = authors_cbo.selectedIndex;;
                                                                                              if (books_dg.selectedIndex != -1) {
                                                                                                 myXMLLoader.deleteBook(authorIndex, bookIndex);
                                                                                            private function itemEditEndHandler(e:DataGridEvent):void {
                                                                                              var authorIndex:int = authors_cbo.selectedIndex;
                                                                                              var dg:DataGrid = e.target as DataGrid;
                                                                                              var field:String = e.dataField;
                                                                                              var row:int = e.rowIndex;
                                                                                              var col:int = e.columnIndex;
                                                                                              var oldVal:String = e.itemRenderer.data[field];
                                                                                              var newVal:String = dg.itemEditorInstance[dg.columns[col].editorDataField];
                                                                                              if (oldVal != newVal) {
                                                                                                   myXMLLoader.modifyXMLTree(authorIndex, dg.columns[col].dataField, row, newVal)
                                                                                            private function xmlUpdatedHandler(e:Event):void {
                                                                                                 books_dg.dataProvider = myXMLLoader.getBooks(authors_cbo.selectedIndex);
                                                                                                 tree_txt.text = myXMLLoader.getXML().toXMLString();
            ]]>
        </mx:Script>
        <s:Panel x="9" y="257" width="459" height="383" contentBackgroundColor="#666666" backgroundColor="#666666" chromeColor="#FCF6F6" title="DIRECTIONS TO SILVER FOX COLLISION CENTER:" fontSize="14">
            <s:TextInput x="55" y="7" contentBackgroundColor="#030000" height="17" width="392"/>
            <mx:Label x="3" y="6" text="FROM:" fontSize="14" color="#FDF9F9"/>
            <s:TextInput x="1114" y="637" contentBackgroundColor="#FCF7F7" height="17" width="213"/>
            <s:Button x="1337" y="634" label="GET DIRECTIONS" focusColor="#FBFCFD" chromeColor="#666666" color="#FEFEFE" width="141" fontSize="14"/>
            <mx:Label x="1088" y="637" text="TO:" fontSize="12" color="#FDFBFB"/>
            <s:Button x="295" y="56" label="GET DIRECTIONS" focusColor="#FBFCFD" chromeColor="#666666" color="#FEFEFE" width="157" fontSize="12"/>
            <s:TextInput x="55" y="31" contentBackgroundColor="#070000" height="17" width="392"/>
            <mx:Label x="25" y="30" text="TO:" fontSize="14" color="#FDFBFB"/>
        </s:Panel>
        <mx2:DataGrid x="10" y="54" width="458" height="104" color="#666666" contentBackgroundColor="#060000" borderColor="#030000" fontSize="8" focusColor="#666666" chromeColor="#030000" selectionColor="#666666" dropShadowVisible="true" rollOverColor="#FFFFFF">
            <mx2:columns>
                <mx2:DataGridColumn headerText="LAST NAME:" dataField="col1"/>
                <mx2:DataGridColumn headerText="DESIGNATED DUE DATE:" dataField="col2"/>
                <mx2:DataGridColumn headerText="STATUS UPDATED:" dataField="col3"/>
                <mx2:DataGridColumn headerText="CUSTOMER ID:" dataField="col3"/>
            </mx2:columns>
        </mx2:DataGrid>
        <mx:Text id="directionsSummary" width="100%"/> <mx:DataGrid id="directionsGrid" dataProvider="{directionsSteps}" width="100%" height="100%" sortableColumns="false" />
        <mx:Text id="directionsCopyright" width="100%"/>
        <mx:HBox> <mx:Label text="From: " width="70"/> <mx:TextInput id="from" text="San Francisco, CA" width="100%"/> </mx:HBox>
        <mx:HBox> <mx:Label text="To: " width="70"/> <mx:TextInput id="to" text="Mountain View, CA" width="100%"/> </mx:HBox>
        <s:Label x="11" y="38" text="LAST NAME:" color="#FCFBFB" fontSize="14" verticalAlign="top"/>
        <s:TextArea x="96" y="32" width="145" height="18" focusColor="#FCFAFA" color="#010000" contentBackgroundColor="#000000" id="message_txt" text="{xmlService.lastResult.toString()}>
        <s:Label x="273" y="37" text="CUSTOMER ID;" fontSize="14" color="#FDFBFB"/>
        <s:TextInput x="376" y="32" width="89" height="18" focusColor="#FCF9F9" color="#FAF8F8" contentBackgroundColor="#040000"/>
        <s:Button x="318" y="212" label="RESET" focusColor="#F8FAFB" color="#FEFBFB" chromeColor="#666666" fontSize="12"/>
        <s:Button x="393" y="212" label="SUBMIT" focusColor="#F8F9FA" color="#FFFBFB" chromeColor="#666666" fontSize="12"/>
        <s:TextArea x="10" y="160" width="458" height="48" color="#FEF8F8" contentBackgroundColor="#050000"/>
        <mx:Panel x="483" y="31" width="750" height="609" layout="absolute" backgroundColor="#666666" borderVisible="true" dropShadowVisible="true" chromeColor="#FDF9F9">
            <mx:VBox x="26" y="7" height="559" width="708">
                <maps:Map xmlns:maps="com.google.maps.*" id="map" mapevent_mapready="onMapReady(event)" x="500" y="25" width="700" height="550" key="ABQIAAAA9YXHa-b0xqHBMiooUNYUbhRpa9TAnukyOWjhoGl3Y9H2BJoi9xSrm6cnM0lBZ4lCtqRLxKpQK_eb Rg" sensor="true"/>
            </mx:VBox>
        </mx:Panel>
    </mx:Application>
    /**the AIR APPLICATION*/
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                           xmlns:s="library://ns.adobe.com/flex/spark"
                           xmlns:mx="library://ns.adobe.com/flex/mx" backgroundColor="#666666" width="854" height="348" creationComplete="initApp(event)">
        <s:HTTPService id="customer_info" url="data/customer_info.xml" resultFormat="e4x" result="resultHandler(event)"/>
        <mx:Script>
            <![CDATA[
            /**FLEX 4 Bible: Chapter 24- Managing XML w/ E4X*/
            private var xmlData:XML;
            private function resultHandler(event:ResultEvent):void
                xmlData = event.result as XML:
            ]]>
        </mx:Script>
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <mx:Image source="@Embed('Assets/logo.png')" x="1" y="0" width="760" height="168"/>
        <s:Label x="96" y="126" text="Last Name:&#xd;" color="#FFFFFF" fontSize="20" fontFamily="Times New Roman"/>
        <s:Label x="13" y="218" text="Designated Due Date:&#xd;" fontSize="20" fontFamily="Times New Roman" color="#FBF8F8"/>
        <s:Label x="63" y="186" text="Status Updated:&#xd;" color="#FCF5F5" fontSize="20" fontFamily="Times New Roman"/>
        <s:TextInput x="192" y="125" width="196"/>
        <s:TextInput x="193" y="215" width="195"/>
        <s:TextInput x="193" y="185" width="195"/>
        <s:Label x="80" y="158" text="Customer ID:" color="#FDFCFC" fontSize="20" fontFamily="Times New Roman"/>
        <s:TextInput x="192" y="155" width="196"/>
        <s:Button x="243" y="241" label="RESET"/>
        <s:Button x="317" y="241" label="UPDATE" focusColor="#666666"/>
    </s:WindowedApplication>
    /**the Customer Information XML*/
    <?xml version="1.0" encoding="utf-8"?>
        <allNames>
            <name namesID="1">
                <nameLastName>Ambrose</nameLastName>
                <customerids>
                    <customerid customerID="1">
                        <customerID>777777</customerID>
                    </customerid>
                </customerids>

    Hi All,
    please note that we found the problem. The problem was that we didn't configure under:
    "Configuration-> Security -> Message Security -> SOAP" the voprrect provider to handle the security.
    After that was done (extract of domain.xml) the message was understood.
    <provider-config class-name="com.sun.identity.agents.jsr196.as9soap.AMServerAuthModule" provider-id="AMServerProvider-UserNameToken-Plain" provider-type="server">
                <request-policy auth-source="content"/>
                <response-policy auth-source="content"/>
                <property name="providername" value="UserNameToken-Plain"/>
              </provider-config>unfortunately the next problem occured I will post in a new thread.
    Edited by: rankin_ut on Jan 26, 2009 4:43 AM

  • Link button to local html page using AS3

    I am using AS3 and having trouble linking a button to a local html page

    Okay, I tried both of the codes and it is still now working.
    navigateToURL(new URLRequest("file:///fishcom/Home.html"));
    I get a Windows dialog box that states that the path can not be found.
    navigateToURL(new URLRequest("./fishcom/Home.html"));
    This goes to http://./fishcom/Home.html  but not my page.
    The Flash file and the HTML page are in the fishcom folder on my desktop. Very frustrating because this was so easy in AS2. 

  • How could I know that my swf file is in AS3 or in AS2  ?

    Is there any body know the techinique that how to identify my swf file is in AS3 or in AS2 ?

    you can check if it's an AVM1Movie using the "is" operator on your loader's content.  if it is, it's an as2 swf.  if not, it's an as3 swf.

  • Creating a water Effect using AS3

    Hi There
    I have created a water effect in Adobe Flash using AS2,
    however I now wish to create a flash application with the same
    effect but using AS3.
    Please see the attached code I have used to create the water
    effect using AS2.
    I am looking for somebody to help me change this to work in
    Action Script 3. Any help would be greatly appreciated.
    Thanks
    Tremayne

    You are maybe talking about the cursor tooltips? The
    one when you pause over a link a little box pops up
    with the link or name of the link? Maybe?
    If so, iweb can't do this. It make the default
    tooltips the name of the link. You can edit it to
    whatever you want by changing the "alt" tag in the
    html.
    ???

  • Can InDesign tell me the percentage of color used on a document?

    I have a client on a fixed budget who wants a booklet with some pages in color. I use a printer who charges fluctuate based on the amount of color coverage. Can Adobe InDesign tell me the percentage of color used on a document?

    I'm used to seeing digital printers charge based on color vs. black per page, but never by coverage, but then you used to be able to buy software instead of renting it, so times change.
    It's pretty common for files with Black ink only to really have some color on them -- printers marks, for example, or they go through a profile conversion and print as rich black.

  • Is there a way to use AS3 in slide presentation?

    I'm trying to use text effects, but cannot get them to work in a slide presentation.  Is there anyway to utilize AS3 in this AS2 based function?  I need to use a slide show so that the presenter can control the speed of his presentation.

    it doesn't matter how you create an flv or what you use to create an flv.  if it's a valid flv you can play it using as2 and you can play it using as3.

  • Advantages & Disadvantages of AS3.0 against AS2.0

    Hi,
         Let me know about Advantages & Disadvantages of AS3.0 against AS2.0?

    Hi Subbu,
    >which is the best option to integrate i.e using XI as a middle layer
    I Prefer SAP XI / PI as Middle ware  and design because in SAP XI / PI we can do end to end montoring, We can do Transformation, Validation, Look Up, even Sucessfull message in XI can be resend if we needed, Can raise Alert if and notify to support team etc
    Regards
    Agasthuri Doss

  • Exception access violation using jlong instead of jint

    Hi,
    I hope you can help me.
    I'm using Java5 under Windows XP and I'm developing under Eclipse.
    I try to use an "old" c-Application accesed via JNI.
    Status Quo is that, I have access to the c-side, over my JNI-conform DLL. My current task is to translate the c-side structs to java-objects. This also works, but only with limitation.
    Calling methods bidirectional is working, manipulation a java-object is like a walk on an warm and sunny Saturday afternoon.
    But I'm not able to use all possible parameters (for now I have tried to use jobject, jstring, jint, jboolean, jlong).
    The first problem I had, were using Strings as parameters, but this now I deal with the loopway over java/lang/object (using java/lang/String results in an access_violation).
    The next problem, and the harder one, is, that I cannot use the type long or jlong.
    int (jint) is no problem, with int all works fine, but if I change the environment, creating and using long, I allways get an the access_violation shown below.
    Is there anything, I need to know?
    working c-side-code:
    jobject someObject;
    jint anIntegerValue;
    anIntegerValue =5;               
    jmethodID mid3 = (*env)->GetMethodID(env, cl, "initReturnSomeObject", "(ILjava/lang/Object;)Ljava/lang/Object;");
                   if(mid3 == (jmethodID)0) printf("\ndooofes MethodName4!\n");
                             else {
                                  const char* myParams;
                                  myParams = "ooooohwow!!!";
                                  someObject = (*env)->CallObjectMethod(env, jobj, mid3,
                                             anIntegerValue, (*env)->NewStringUTF(env, myParams));
                             }wokring java-side-code
    public Object initReturnSomeObject(int i, Object obj) {
              String s = (String)obj;
              System.out.println("String: "+s+"\nInteger: "+i);
              some = new SomeObject(s,i);
              if(some==null) System.out.println("Some is not yet initialized, FEAR!!!!\n");
              else System.out.println("Yoh, I'm soooo many good!! \nSome:\nString: "+some.getS1()+"\nInt: "+some.getI1()+"\n");
              return (Object)some;
    so, und this code, doesn't work. you can see, the changes are dramatically!! ;)
    sorry for my sarcasm. I do not know, why it doesn't work.
    jlong aLongValue;
    aLongValue = 2;
    jmethodID mid3 = (*env)->GetMethodID(env, cl, "initReturnSomeObject", "(JLjava/lang/Object;)Ljava/lang/Object;");
                   if(mid3 == (jmethodID)0) printf("\ndooofes MethodName4!\n");
                             else {
                                  const char* myParams;
                                     myParams = "ooooohwow!!!";
                                  someObject = (*env)->CallObjectMethod(env, jobj, mid3,
                                            aLongValue, (*env)->NewStringUTF(env, myParams));
         public Object initReturnSomeObject(long i, Object obj) {
              String s = (String)obj;
              System.out.println("String: "+s+"\nInteger: "+i+"\nLong: ");
              some = new SomeObject(s,(int)i);
              if(some==null) System.out.println("Some is not yet initialized, FEAR!!!!\n");
              else System.out.println("Yoh, I'm soooo many good!! \nSome:\nString: "+some.getS1()+"\nInt: "+some.getI1()+"\n");
              return (Object)some;
    # An unexpected error has been detected by Java Runtime Environment:
    #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d942975, pid=1784, tid=1648
    # Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing)
    # Problematic frame:
    # V  [jvm.dll+0x182975]
    # An error report file with more information is saved as hs_err_pid1784.log
    # If you would like to submit a bug report, please visit:
    #   http://java.sun.com/webapps/bugreport/crash.jsp
    #do you need some other informations or details? something out of the log-file? ok, i have to take the bus, so sorry for uncomplete informations or sentences ;)
    till later.

    Hi,
    I'm quite sure, the signature is correct. For failure check, yesterday I ran javap to check the signature, but I do also mean, that I changed the signature afterwards for several time. And, it works ;) at least the way, using Integer.
    Trying to use java/lang/String everytime I got the Error, that the method could not be found - this is the part, I was wrong in my description. So the error-Message is a different one.
    Belonging to the question for assumptions I made... it's difficult. I'm quite new to JNI, so, I don't know, what I can assume to do. The Method call seems to be a kind of reflection-mechanism. So I assume that the behaviour is similar. But reflection I'm not very firm, either ^^.
    What I do assume is, that the parameter-value J fits to the java-type jlong. But a work around on this, I will try today. getting the jlong into an char* or using long instead of jlong or using Ljava/lang/Long; or a casted Long as Ljava/lang/Object; ...
    I'm anxious to the ideas, I will have, bypassing this point. if there is no way, I will write a file, send a email or something like this ;)
    Thx for thinking about my problem jschel!! It's great not to be alone.
    John

  • I just found my old ipod touch (i think 1st generation) and would like to let my toddler use it instead of my phone.  I am trying to download apps but it say I need to update to 4.3 but it won't let me update.  I have the most recent itunes. any idea why?

    I just found my old ipod touch (i think 1st generation) and would like to let my toddler use it instead of my phone.  I am trying to download apps but it say I need to update to 4.3 but it won't let me update.  I have the most recent itunes. any idea why? I saw a thread saying to purchase the newest software (that was posted a few years ago) I paid 4.95 for the software and it's still saying it can't be updated.  Am I just SOL??

    The 1G iPod can only go as high as 3.1.3. The 1G does not have an internal speaker or volume buttons on the upper left edge.
    Identifying iPod models
    To more easily find compatible apps:
    iOSSearch - search the iTunes store for compatible apps.
    Apple Club - filter apps by iOS version.

  • How to modify a lookup field-type to use checkbox instead of radiobutton?

    How to modify a lookup field-type to use checkbox instead of radiobutton?
    I would like to modify the behavior for the lookup field.
    Normally you get a screen where it is possible to search through a lookup. The items resulted from the search are listed as radiobutton items. Therefore you can select only one at the time to be added.
    Is it possible to have the items to be listed as checkbox instead? So that you can check multiple items and therefore be able to add multiple items at the time?
    For example:
    To add the user to 10 different groups on MS-AD.
    It is desired to have the ability to check multiple groups to be added instead only one at the time.
    My client would like to use this feature in many other situations.

    Displaying will not be a big deal but with that you have to customize the action class and its working as well.

  • How to read a local file using as3 in a flash object in HTML? [urgent]

    My web site contains a flash object.
    I want to use as3 to read some local .txt file
    by getting the user directory of the file.
    i know AIR can support this by sth like:
    File.desktopDirectory.resolvePath
    but when i open a AIR file for this, it seems
    the action cant be run when i embed it in html.
    And i tried to use the above function in a normal
    flash file in the action script.
    But it cant recognize the File. class..
    How can it be done ?
    It's reli urgent,
    please help...
    Thanks !

    a web based flash app can't detect user directories.  you can use the filereference class'es browse method to let the user locate a file in any directory the user wants.  flash can then retrieve the file's name and type.  but, as mentioned before,  flash can't determine the file's directory.

  • Invalid security certificate for my website host-they say the problem is Apple Safari and use Firefox instead

    For the past few days, I keep getting an invalid security certificate in Safari whenever I select Edit My Site from my website homepage (http://annaporterartist.com), or whenever I select anything requiring a secure log in from my website host main page (FASO.com). I have contacted technical support at my website host (fineartstudioonline.com) and they say that this has been an intermittently recurring problem in Safari for years and they recommend that I use Firefox instead. As proof of this they emailed a link to an Apple Support discussion, but it was for Mac OS X Lion v 10.7.4 and Safari 5.1, even though I told them I am using Mac OS X Mountain Lion v 10.8.2 and Safari 6.0.2. I do not get this error message anywhere else on the web using Safari. I did try Firefox and it seems to work fine, but I prefer Safari and I want to know why Safari is not working as it should be. I am concerned that there is a real security problem with my website host and I need someone to explain why I am getting this error message, what it means, and if it is, in fact, a known problem with Safari or is my website host corrupted? Really tired of technical support playing pass the buck or pretending the problem does not exist.
    The specific error message is:
    Their response to my inquiry and my reply is shown below:

    Back up all data.
    Launch the Keychain Access application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Keychain Access in the icon grid.
    From the menu bar, select
    Keychain Access ▹ Preferences ▹ Certificates
    There are three menus in the window. What is selected in each of them?

Maybe you are looking for

  • Re: Mac OS 10.6 user. New HP P1102w. Cannot get the wireless feature to work. Prints via usb ok

    sorry to resurrect this issue, but I have reinstalled all drivers and updated firmware, but cannot connect wirelessly.  The set up is fine, but the bonjour version of the printer only lasts 1 second before going away.  I have had this product for a w

  • How to migrate HPSu 8.3.2 to Oracle EPM 11.1.2.1?

    Dear Experts, We need your expert advice on HPSu 8.3.2 migration to Oracle EPM 11.1.2.1. Client is having more than 2000 scheduled Jobs and approx 3000 published Bqys in HPSu 8.3.2. Now they want to migrate their current environment to Oracle EPM 11.

  • Iphone 3GS  to update 4.1 or not?

    I read a while ago that the 4.1 update had alot of bugs. Thanks to all, i have held out and still run 4.0.1 Is 4.1 good now or should i stick with what i got?

  • I can't create a security copy into iCloud

    When I upgraded to iOS 5, I enabled iCloud backup. The first security backup was created succesfully but it almost used all the available space. The next day, when the iPad tried to create the iCloud backup, it warned me that there was not enough spa

  • Question about Delegate Control to Desktop Support

    I am working on delegating control to a newly formed/reclassified position in my company. This role will primarily provide Desktop Support. They will have little to no need to log into servers. I have already gave them admin rights to the end users m