A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Custom Flash Gallery Button Checks

Threaded View

  1. #1
    Junior Member
    Join Date
    Aug 2010
    Posts
    7

    Custom Flash Gallery Button Checks

    Hi, I'm trying to get a custom flash gallery going by using the loadMovie command with Jpeg's. I must use this method as it's what is required by our project. I am trying to figure out some way to make an array to keep all of my image names and then detect which button is being pressed and have it call the corresponding number within the array.

    Currently I have some code that is working quite well but not fully

    Code:
    stop();
    
    var thumbArray:Array = ["i1", "i2", "i3", "i4", "i5"];
    
    i1 = "MedievalCrossbowDiffuse.jpg";
    i2 = "InGameScreenShot9.jpg";
    
    	//Button Objects
            Button.prototype.onPress = function() { //function to detect the instance name of the button
    	var clickedNumber:String = this._name; //when traced returns i1 or i2 depending on which button is clicked.
    	imgContainer.loadMovie(clickedNumber); //trying to load i2 but just comes up as undefined.
    }
    I have two buttons currently instanced named i1 and i2. The trace is working and calling "i1" but for some reason even though i set i1 = "thejpeg.jpg" it isn't calling the jpeg. All help appreciated! I can upload my file if necessary.

    Also i'm going to need to be able to unload the opened jpeg by clicking anywhere off of the jpeg's area, help with that too would be highly appreciated, i know how to unload a jpeg but I don't know how to detect when you click any surrounding area of it.
    Last edited by shinji246; 08-26-2010 at 10:26 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center