Movement of multiple images in Applet
Hello all
I am working on this application in which there is a background image and foreground image.now user can move the front image with mouse.intially i was working with single image movement and it worked great.but i changed the code for multiple image movement , its not working. I have used the paint component method of the panel for the drawing. Can any one could give me the idea of doing it in a better way
Thanx
I have done it , If any body needs help Please do ask
thanx
Similar Messages
-
How to move multiple images in applet
Hi,how to move multiple images in applet or random images in applet .
Means moving images.gif around the applet with different starting point ,help me to create that move method ..why don't you check the tumbling duke applet as provided free in this site? :-)
-
Can you move a 'Multiple Image Upload' button into the 'Update Form'?
I am able to creat and an Update form and an image upload using the "Update Form Wizard" tool and the "Multiple Image Upload" tool succesfully.
<br />
<br />The problem comes when I try to move the "UPLOAD" button inside the Update form. Right now it looks like this:
<br />http://www.webritesolutions.com/Test/upload/now.JPG
<br />
<br />This is how I would like it to show:
<br />http://www.webritesolutions.com/Test/upload/tryingto.JPG
<br />
<br />I want to "Upload" button to go next to the "Update record" button. When I do this I get a javascript error and the "Update record" button is disabled.
<br />Here is the code of what I tried to do:
<br />
<br />
<br />
<br />
<br />
<table>
<tr class="KT_buttons">
<td>
<?php<br /> // Multiple Upload Helper<br /> echo $muploadHelper->Execute();<br /> ?>
</td>
<td colspan="1">
<input type="submit" name="KT_Update1" id="KT_Update1" value="Update record" />
<br /></td>
</tr>
</table>
<br />
<br />Here is the Javascript error:
<br />http://www.webritesolutions.com/Test/upload/error.JPG
<br />
<br />thanks for your help.A control can only appear once in the visual tree. So you have to remove it from the Grid before you can add it to the DockPanel.
This code will move the Border element from the Grid to the DockPanel when you click the button:
Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
Dim border = CType(LayoutRoot.FindName("myborder"), Border)
LayoutRoot.Children.Remove(border)
contain.Children.Add(border)
End Sub
<StackPanel>
<Grid x:Name="LayoutRoot">
<Border x:Name="myborder" BorderBrush="Black" BorderThickness="2">
<TextBlock>...</TextBlock>
</Border>
</Grid>
<DockPanel x:Name="contain" Background="Yellow">
<TextBlock>2</TextBlock>
</DockPanel>
<Button Click="Button_Click" Content="Move"/>
</StackPanel>
You can try it for yourself. But please post your code as formatted text and not as embedded images if you want anyone to be able to reproduce your issue and help you in the future.
Please remember to close your threads by marking helpful posts as answer. -
Loading multiple images in applet
I am trying to create an applet that displays 8 images in a grid and up until now I have had no problems loading single images into the applet but I am having difficulty more than one. I thought I could just create multiple lines of the getImage method. It keeps telling me that an identifier is expected. I'm quite new to this so don't mock me.
import java.applet.*;
import java.awt.*;
import javax.swing.*;
public class clown extends Applet {
Image[] cln=new Image[8];
cln[0]=getImage(getDocumentBase(), "clown2.gif");
cln[1]=getImage(getDocumentBase(), "clown3.gif");
cln[2]=getImage(getDocumentBase(), "clown4.gif");
cln[3]=getImage(getDocumentBase(), "clown5.gif");
cln[4]=getImage(getDocumentBase(), "clown6.gif");
cln[5]=getImage(getDocumentBase(), "clown7.gif");
cln[6]=getImage(getDocumentBase(), "clown8.gif");
cln[7]=getImage(getDocumentBase(), "clown9.gif");
public void paint(Graphics g){
g.drawImage(cln[0], 0, 0, 0, 0, this);
g.drawImage(cln[0], 50, 10, 0, 0, this);
g.drawImage(cln[0], 100, 10, 0, 0, this);
g.drawImage(cln[0], 150, 10, 0, 0, this);
g.drawImage(cln[0], 200, 10, 0, 0, this);
g.drawImage(cln[0], 250, 10, 0, 0, this);
g.drawImage(cln[0], 300, 10, 0, 0, this);
g.drawImage(cln[0], 350, 10, 0, 0, this);
}Ive just noticed a mistake but that still doesnt resolve the problem it should read:
import java.applet.*;
import java.awt.*;
import javax.swing.*;
public class clown extends Applet {
Image[] cln=new Image[8];
cln[0]=getImage(getDocumentBase(), "clown2.gif");
cln[1]=getImage(getDocumentBase(), "clown3.gif");
cln[2]=getImage(getDocumentBase(), "clown4.gif");
cln[3]=getImage(getDocumentBase(), "clown5.gif");
cln[4]=getImage(getDocumentBase(), "clown6.gif");
cln[5]=getImage(getDocumentBase(), "clown7.gif");
cln[6]=getImage(getDocumentBase(), "clown8.gif");
cln[7]=getImage(getDocumentBase(), "clown9.gif");
public void paint(Graphics g){
g.drawImage(cln[0], 0, 0, 0, 0, this);
g.drawImage(cln[1], 50, 10, 0, 0, this);
g.drawImage(cln[2], 100, 10, 0, 0, this);
g.drawImage(cln[3], 150, 10, 0, 0, this);
g.drawImage(cln[4], 200, 10, 0, 0, this);
g.drawImage(cln[5], 250, 10, 0, 0, this);
g.drawImage(cln[6], 300, 10, 0, 0, this);
g.drawImage(cln[7], 350, 10, 0, 0, this); -
how to have multiple images on the same screen? like in the movies where you see several actions at the same time ....
i don't find a tutorial in adobe tv....
thanks !!The short answer is that you'll put the source clip(s) for each inset on a different video track, all stacked up. Then use the Scale and Position effects (under "Motion" on the Effect Controls panel) to reduce their size and place them where you want.
If the content of an inset will involve edited content (where you're cutting among various clips or just trimming out unwanted content from a single clip), then you'll probably find it easier to do all those edits in one sequence, then nest that sequence in the master sequence, where you apply the Scale and Positioning effects. That will save the step of applying the scale and position effects to each edited track item. -
How to move multiple images in lr at one time from one subfolder to the next?
How would i accomplish this procedure in lr5. I know you can click on an image and drag it to the target folder. But for multiple images this is the ? Thanks!!
Same as you would do it in your operating system.
You select multiple images (click, ctrl-click, ctrl-click, etc., or click on one image and then shift-click on another image to select the entire sequence) and then drag.
Of course, you might also want to simplify your life and develop a workflow where you don't have to move photos from here to there by using keywords instead of folders to organize. -
Trying to create a surface with multiple images with mouse events
novice programmer (for a applet program)
hi trying to create a surface i.e jpanel, canvas, that allows multiple images to be created.
Each object is to contain a image(icon) and a name associated with that particular image. Then each image+label has a mouse event that allows the item to be dragged around the screen.
I have tried creating own class that contains a image and string but I having problems.
I know i can create a labels with icons but having major problems adding mouse events to allow each newly created label object to moved by the users mouse?
if any one has any tips of how to acheive this it would be much appreciated. Thanks in advance.
fraser.This should set you on the right track:- import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class DragTwoSquares extends JApplet implements MouseListener, MouseMotionListener {
int x1, y1; // Coords of top-left corner of the red square.
int x2, y2; // Coords of top-left corner of the blue square.
/* Some variables used during dragging */
boolean dragging; // Set to true when a drag is in progress.
boolean dragRedSquare; // True if red square is being dragged, false // if blue square is being dragged.
int offsetX, offsetY; // Offset of mouse-click coordinates from
// top-left corner of the square that was // clicked.
JPanel drawSurface; // This is the panel on which the actual
// drawing is done. It is used as the
// content pane of the applet. It actually // belongs to an anonymous class which is
// defined in place in the init() method.
public void init() {
// Initialize the applet by putting the squares in a
// starting position and creating the drawing surface
// and installing it as the content pane of the applet.
x1 = 10; // Set up initial positions of the squares.
y1 = 10;
x2 = 50;
y2 = 10;
drawSurface = new JPanel() {
// This anonymous inner class defines the drawing
// surface for the applet.
public void paintComponent(Graphics g) {
// Draw the two squares and a black frame
// around the panel.
super.paintComponent(g); // Fill with background color.
g.setColor(Color.red);
g.fillRect(x1, y1, 30, 30);
g.setColor(Color.blue);
g.fillRect(x2, y2, 30, 30);
g.setColor(Color.black);
g.drawRect(0,0,getSize().width-1,getSize().height-1);
drawSurface.setBackground(Color.white);
drawSurface.addMouseListener(this);
drawSurface.addMouseMotionListener(this);
setContentPane(drawSurface);
} // end init();
public void mousePressed(MouseEvent evt) {
// Respond when the user presses the mouse on the panel.
// Check which square the user clicked, if any, and start
// dragging that square.
if (dragging) // Exit if a drag is already in progress.
return;
int x = evt.getX(); // Location where user clicked.
int y = evt.getY();
if (x >= x2 && x < x2+30 && y >= y2 && y < y2+30) {
// It's the blue square (which should be checked first,
// since it's in front of the red square.)
dragging = true;
dragRedSquare = false;
offsetX = x - x2; // Distance from corner of square to (x,y).
offsetY = y - y2;
else if (x >= x1 && x < x1+30 && y >= y1 && y < y1+30) {
// It's the red square.
dragging = true;
dragRedSquare = true;
offsetX = x - x1; // Distance from corner of square to (x,y).
offsetY = y - y1;
public void mouseReleased(MouseEvent evt) {
// Dragging stops when user releases the mouse button.
dragging = false;
public void mouseDragged(MouseEvent evt) {
// Respond when the user drags the mouse. If a square is
// not being dragged, then exit. Otherwise, change the position
// of the square that is being dragged to match the position
// of the mouse. Note that the corner of the square is placed
// in the same position with respect to the mouse that it had
// when the user started dragging it.
if (dragging == false)
return;
int x = evt.getX();
int y = evt.getY();
if (dragRedSquare) { // Move the red square.
x1 = x - offsetX;
y1 = y - offsetY;
else { // Move the blue square.
x2 = x - offsetX;
y2 = y - offsetY;
drawSurface.repaint();
public void mouseMoved(MouseEvent evt) { }
public void mouseClicked(MouseEvent evt) { }
public void mouseEntered(MouseEvent evt) { }
public void mouseExited(MouseEvent evt) { }
} // end class -
Looking for Image Button Applet
I'm looking for a simple image button applet (normal state, mouse-over and mouse-click) which can refer to a HTML or start a Javascript function. Can anyone help?
KippieHi,
This is the source code. I don't quite understand what I should do with the tokens. I hope this is allright. Thanks for your help
Kippie.
import java.net.URL;
import java.awt.Color;
import java.util.Vector;
import java.util.Enumeration;
import java.util.StringTokenizer;
import java.applet.Applet;
import java.applet.AudioClip;
Program Name: ImageURLButtonBar
Author: Paul Whitelock
Version: 1.1
Copyright: (c) 1997 by Paul Whitelock and Modern Minds, Inc.
Requires: ImageURLButtonBar.class
ButtonBar.class
ButtonBarObserver.class (Interface definition)
ButtonRegion.class
ButtonAnimate.class
Modifications: v1.01 (15 April 97)
* Added "sticky" button behavior (controlled
by applet "stick" parameter)
v1.03 (25 June 97)
* Added applet parameter "useCodeBase". If useCodeBase
is true, then image file locations will be based on the directory
in which the Java class files are located. If useCodeBase is false, then
the locations will be based on the HTML directory. Note that audio
file locations are always based on the Java directory. The default
for useCodeBase is false (use HTML directory for base).
* The "stick" parameter will now accept a button number in
addition to the value of "true" or "false". If a button number
is specified, then that button will be "stuck" down
when the button bar initializes.
* Added the capability of loading multiple URLs for each button
with an optional target for each URL.
v1.1 (25 September 97)
* Added "baseBrighten" and "baseBrightenTint" parameters to control
highlighting for base button bar.
* Added "mouseOverBrighten" and "moBrightenTint" parameters to control
highlighting for base button bar.
* Added "mdBrightenTint" and "mdBrightenAll" parameters to control
highlighting for base button bar. Previous versions of the applet
supported "mouseDownBrighten," but only if button borders were not
drawn for the button-down button bar (the "mdBrightenAll" can be set
to "true" to override the this default behavior).
* An "appletBGColor" parameter has been added to set the
applet background color. The applet background color is
sometimes visible during scrolling or during a page repaint.
NOTE: This source code was composed using Microsoft Visual J++
with tab stops of 4. Text may not be formatted correctly
if another editor is used.
******************************** PARAMETERS ********************************
Applet Parm ButtonBar Class Parm Default Value
================== ======================= ==================
appletBGColor
disableBadURL true
mouseEnterAudio null (audio disabled)
mouseClickAudio null (audio disabled)
buttonDownAudio null (audio disabled)
stick false
* useCodeBase base false (i.e., use getDocumentBase())
orient barHorizontal horizontal if applet width > height
base baseBarName none - parameter REQUIRED
mouseOver mouseOverBarName null
mouseOver2 mouseOverBar2Name null
mouseDown mouseDownBarName null
mouseDownOver mouseDownOverBarName null
buttonsDisabled buttonsDisabledBarName null
background backgroundImageName null
barXPos barXBackgroundPos 0
barYPos barYBackgroundPos 0
buttonBorders drawButtonBorders ButtonBar.BORDERS_NONE
borderColorTL borderColorTopLeft null (Color.white if error)
borderColorBR borderColorBottomRight null (Color.gray if error)
borderIntensity borderIntensityPercent 50 (used only if borders)
borderSize buttonBorderSize 1 (used only if borders)
downShift downShift false
downShiftAmt downShiftAmt buttonBorderSize
baseBrighten baseBrightenPct
baseBrightenTint baseBrightenTint
mouseOverBrighten mouseOverBrightenPct
moBrightenTint mouseOverBrightenTint
mouseDownBrighten mouseDownBrightenPct
mdBrightenTint mouseDownBrightenTint
mdBrightenAll mouseDownBrightenAll
buttonsDisabledDim buttonsDisabledDimPct 25 (used only if no buttonsDisabled)
grayBarBrighten grayBarBrighten 0
frameRate frameRate 150 (used only if mouseOver2)
* If useCodeBase is true, then all file locations are based on the Java class file
directory (i.e., use getCodeBase()).
public class ImageURLButtonBar extends Applet implements ButtonBarObserver {
// Instance Variables
ButtonBar buttonBar;
Vector buttonURL = new Vector(10, 10);
Vector buttonURLTarget = new Vector(10, 10);
Vector buttonDescription = new Vector(10, 10);
AudioClip mouseEnterAudio = null;
AudioClip mouseClickAudio = null;
AudioClip buttonDownAudio = null;
// Applet Initialization
public void init() {
// =================================================================
// Applet ImageURLButtonBar specific parameters
// =================================================================
// appletBGColor
// Set applet background color
String parm = getParameter("appletBGColor");
if (parm != null) {
try {
setBackground(new Color(Integer.parseInt(parm, 16)));
catch (Exception e) {
reportError("appletBGColor");
// disableBadURL
// If true, then any button with an invalid URL will be disabled
parm = getParameter("disableBadURL");
boolean disableBadURL;
if (parm == null || !parm.equals("false")) disableBadURL = true;
else disableBadURL = false;
// mouseEnterAudio
// Sound to play each time the mouse enters any of the buttons
parm = getParameter("mouseEnterAudio");
if (parm != null) {
mouseEnterAudio = getAudioClip(getCodeBase(), parm);
if (mouseEnterAudio == null) reportError("Can't load " + parm);
// mouseClickAudio
// Sound to play each time a mouse down click occurs in a button
parm = getParameter("mouseClickAudio");
if (parm != null) {
mouseClickAudio = getAudioClip(getCodeBase(), parm);
if (mouseClickAudio == null) reportError("Can't load " + parm);
// buttonDownAudio
// Sound to play each time a mouse up occurs in a button (i.e, the
// button has be toggled through it's "down" position)
parm = getParameter("buttonDownAudio");
if (parm != null) {
buttonDownAudio = getAudioClip(getCodeBase(), parm);
if (buttonDownAudio == null) reportError("Can't load " + parm);
// stickyBar
// If the "stick" applet parameter is "true", then buttons will stay
// "stuck" in the down position until another button is clicked.
// If the "stick" applet parameter is the number of a button in the
// button bar, then that button will be "stuck" down when the
// button bar initializes.
int stickyBar = -1;
parm = getParameter("stick");
if (parm != null && !parm.toLowerCase().equals("false")) {
try {
stickyBar = Integer.parseInt(parm);
catch (Exception e) {
stickyBar = 0;
// =================================================================
// Class ButtonBar specific parameters
// =================================================================
// orient (barHorizontal)
// If this parameter = 'h' then the button bar is horizontal
// If this parameter = 'v' then the button bar is vertical
// If this parameter is not specified, then the button bar is
// horizontal if the applet width is greater than the applet height
boolean horizontal;
parm = getParameter("orient");
if (parm == null) horizontal = size().width > size().height;
else horizontal = parm.equals("h") ? true : false;
// base (baseBarName)
// The base image file for the buttons. This is the only image
// file that MUST be specified.
String baseBar = getParameter("base");
if (baseBar == null) {
reportError("Parameter 'base' REQUIRED!");
return;
// barXPos (barXBackgroundPos)
// barYPos (barYBackgroundPos)
// If a background image is specified then these to parameters
// represent the top-left corner location where the button bar
// should be placed on the background
int barXPos = 0, barYPos = 0;
try {
parm = getParameter("barXPos");
if (parm != null) barXPos = Integer.parseInt(parm);
parm = getParameter("barYPos");
if (parm != null) barYPos = Integer.parseInt(parm);
catch (Exception e) {
reportError("barXPos or barYPos");
barXPos = barYPos = 0;
// buttonBorders (drawButtonBorders)
// "none" = do not draw any button borders
// "all" = draw borders around all button bar buttons
// "base" = draw borders only around buttons on base button bar
// "other" = draw borders around all button bar buttons EXCEPT base button bar buttons
parm = getParameter("buttonBorders");
int drawButtonBorders = ButtonBar.BORDERS_NONE;
if (parm != null) {
if (parm.equals("base")) drawButtonBorders = ButtonBar.BORDERS_BASE;
else if (parm.equals("other")) drawButtonBorders = ButtonBar.BORDERS_OTHER;
else if (parm.equals("all")) drawButtonBorders = ButtonBar.BORDERS_ALL;
// borderColorTL (borderColorTopLeft)
// borderColorBR (borderColorBottomRight)
// Normally, borders are drawn around buttons by lightening or darkening
// the image in the border region. A specific color can be used instead
// for the top and left borders and/or the bottom and right borders. The
// value specified for either of these two parameters should be a hexadecimal
// number (e.g., "FF0000" for red, "888888" for medium gray, etc.).
Color borderColorTopLeft = null;
Color borderColorBottomRight = null;
try {
parm = getParameter("borderColorTL");
if (parm != null) borderColorTopLeft = new Color(Integer.parseInt(parm, 16));
parm = getParameter("borderColorBR");
if (parm != null) borderColorBottomRight = new Color(Integer.parseInt(parm, 16));
catch (Exception e) {
reportError("borderColorTL or borderColorBR");
borderColorTopLeft = Color.white;
borderColorBottomRight = Color.gray;
// borderIntensity (borderIntensityPercent)
// If borders are drawn for buttons, and if a border color is not specified
// (see above), then the image in the border region will be lightened or
// darkened by this percentage to create the borders.
int borderIntensityPercent = 50;
try {
parm = getParameter("borderIntensity");
if (parm != null) borderIntensityPercent = Integer.parseInt(parm);
catch (Exception e) {
reportError("borderIntensity");
borderIntensityPercent = 50;
// borderSize (buttonBorderSize)
// The size of borders, if borders are specified.
int buttonBorderSize = 1;
try {
parm = getParameter("borderSize");
if (parm != null) buttonBorderSize = Integer.parseInt(parm);
catch (Exception e) {
reportError("borderSize");
// downShift
// If true, then the button image is shift down and right downShiftAmt
// (see below) pixels when the mouse is clicked on the button.
parm = getParameter("downShift");
boolean downShift = (parm == null || !parm.equals("true")) ? false : true;
// downShiftAmt
// If downShift is true, then the button image is shift down and right
// downShiftAmt (see above) pixels when the mouse is clicked on the button.
int downShiftAmt = buttonBorderSize;
try {
parm = getParameter("downShiftAmt");
if (parm != null) downShiftAmt = Integer.parseInt(parm);
catch (Exception e) {
reportError("downShiftAmt");
// baseBrighten (baseBrightenPct)
// The base bar will be lightened by this percentage
int baseBrightenPct = 0;
try {
parm = getParameter("baseBrighten");
if (parm != null) baseBrightenPct = Integer.parseInt(parm);
catch (Exception e) {
reportError("baseBrighten");
// mouseOverBrighten (mouseOverBrightenPct)
// A button will be lightened by this percentage when the mouse
// moves over a button.
int mouseOverBrightenPct = 0;
try {
parm = getParameter("mouseOverBrighten");
if (parm != null) mouseOverBrightenPct = Integer.parseInt(parm);
catch (Exception e) {
reportError("mouseOverBrighten");
// mdBrightenAll (mouseDownBrightenAll)
// A button will be lightened by this percentage when the mouse
// moves over a button.
boolean mouseDownBrightenAll = false;
parm = getParameter("mdBrightenAll");
if (parm != null && parm.charAt(0) == 't') mouseDownBrightenAll = true;
// mouseDownBrighten (mouseDownBrightenPct)
// A button will be lightened by this percentage when it is
// clicked.
int mouseDownBrightenPct = 0;
try {
parm = getParameter("mouseDownBrighten");
if (parm != null) mouseDownBrightenPct = Integer.parseInt(parm);
catch (Exception e) {
reportError("mouseDownBrighten");
// baseBrightenTint (mouseOverBrightenTint)
// moBrightenTint (mouseOverBrightenTint)
// mdBrightenTint (mouseDownBrightenTint)
Color baseBrightenTint = null;
Color mouseOverBrightenTint = null;
Color mouseDownBrightenTint = null;
try {
parm = getParameter("baseBrightenTint");
if (parm != null) baseBrightenTint = new Color(Integer.parseInt(parm, 16));
parm = getParameter("moBrightenTint");
if (parm != null) mouseOverBrightenTint = new Color(Integer.parseInt(parm, 16));
parm = getParameter("mdBrightenTint");
if (parm != null) mouseDownBrightenTint = new Color(Integer.parseInt(parm, 16));
catch (Exception e) {
reportError("baseBrightenTint, moBrightenTint or mdBrightenTint");
// buttonsDisabledDim (buttonsDisabledDimPct)
// If a button is disabled and if there is no buttonsDisabled image,
// then the button will be dimmed by this percentage.
int buttonsDisabledDimPct = 25;
try {
parm = getParameter("buttonsDisabledDim");
if (parm != null) buttonsDisabledDimPct = Integer.parseInt(parm);
catch (Exception e) {
reportError("buttonsDisabledDim");
// grayBarBrighten
// If there is no mouseOver image, then the base image will be used for
// the mouseOver image, and a grayscale version of the base image will
// be used for base button images. This parameter can be used to lighten
// COLORS (not grays) in the image before it is converted to grayscale.
// This can help if the standard conversion produces buttons that are
// too dark.
int grayBarBrighten = 0;
try {
parm = getParameter("grayBarBrighten");
if (parm != null) grayBarBrighten = Integer.parseInt(parm);
catch (Exception e) {
reportError("grayBarBrighten");
// frameRate
// If a mouseOver2 image is specified, then this parameter controls
// how quickly animation will be performed (using mouseOver and mouseOver2
// images) in milliseconds when the mouse is moved over a button.
int frameRate = 150;
try {
parm = getParameter("frameRate");
if (parm != null) frameRate = Integer.parseInt(parm);
catch (Exception e) {
reportError("frameRate");
// =================================================================
// Instantiate the button bar
// =================================================================
try {
// Allow the use of documentBase (default) or codeBase for image file
// base directory.
URL documentBase;
parm = getParameter("useCodeBase");
if (parm == null || parm.equals("false")) documentBase = getDocumentBase();
else documentBase = getCodeBase();
// Create the button bar
buttonBar = new ButtonBar(
horizontal, /* barHorizontal */
documentBase, /* base */
baseBar, /* baseBarName */
getParameter("mouseOver"), /* mouseOverBarName */
getParameter("mouseOver2"), /* mouseOverBar2Name */
getParameter("mouseDown"), /* mouseDownBarName */
getParameter("mouseDownOver"), /* mouseDownOverBarName */
getParameter("buttonsDisabled"),/* buttonsDisabledBarName */
getParameter("background"), /* backgroundImageName */
barXPos, /* barXBackgroundPos */
barYPos, /* barYBackgroundPos */
drawButtonBorders, /* drawButtonBorders */
borderColorTopLeft, /* borderColorTopLeft */
borderColorBottomRight, /* borderColorBottomRight */
borderIntensityPercent, /* borderIntensityPercent */
buttonBorderSize, /* buttonBorderSize */
downShift, /* downShift */
downShiftAmt, /* downShiftAmt */
baseBrightenPct, /* baseBrightenPct */
baseBrightenTint, /* baseBrightenTint */
mouseOverBrightenPct, /* mouseOverBrightenPct */
mouseOverBrightenTint, /* mouseOverBrightenTint */
mouseDownBrightenAll, /* mouseDownBrightenAll */
mouseDownBrightenPct, /* mouseDownBrightenPct */
mouseDownBrightenTint, /* mouseDownBrightenTint */
buttonsDisabledDimPct, /* buttonsDisabledDimPct */
grayBarBrighten, /* grayBarBrighten */
frameRate /* frameRate */
// =================================================================
// Add buttons to the button bar
// =================================================================
ButtonRegion buttonToAdd;
String buttonNbr, urlString;
URL urlForButton;
int nbr = 0;
int buttonStart, buttonSize;
// Initialize button on bar flag (used to determine if at least one button
// was successfully added to the button bar)
boolean buttonOnBar = false;
// This loop will be exited when no more buttons can be found in the HTML
while (true) {
// Construct the prefix for the button parameters
buttonNbr = "button" + ++nbr;
// Find the starting offset and the size of the button
// If null is returned as the starting offset parameter value for the
// button, then all buttons should have been read so the loop can
// be exited.
try {
parm = getParameter(buttonNbr + "Start");
if (parm == null) break;
buttonStart = Integer.parseInt(parm);
buttonSize = Integer.parseInt(getParameter(buttonNbr + "Size"));
catch (Exception e) {
reportError("Button" + nbr + " start or size in error or missing");
buttonStart = 0;
buttonSize = 0;
// Create a ButtonRegion for the button
// The button ID will be set to the number of the button (this will
// be converted to an integer later when a buttonBarEvent is received).
buttonToAdd = new ButtonRegion("" + nbr, buttonStart, buttonSize);
// If the buttons on this button bar are "sticky" buttons, then
// enable "sticky" behavior for this button. The button will always
// "pop-up" whenever another button is clicked.
if (stickyBar >= 0) {
buttonToAdd.stickyButton(true, ButtonRegion.POPUP_ALWAYS, false);
// If the current button number matches the value of stickyBar, then the
// current button should be "stuck" down for its initial state.
if (stickyBar == nbr) buttonToAdd.setStuck(true);
// Try to add the button (i.e., the ButtonRegion) to the buttonBar
if (buttonBar.addButton(buttonToAdd)) {
// Set flag to indicate that at least one button has been added
buttonOnBar = true;
// The button was successfully added, so save the button's description
// (which will be displayed in the status bar) and the target frame
// for the button URL in the appropriate Vector.
buttonDescription.addElement(getParameter(buttonNbr + "Desc"));
buttonURLTarget.addElement(getParameter(buttonNbr + "Target"));
// Try to create a URL for the button.
// If the URL is invalid, then place an error message in the
// buttonURLTarget Vector (this will be used to warn the user
// when the button is clicked). Also, if disableBadURL is true, then
// disable the button.
String theURL;
urlString = getParameter(buttonNbr + "URL");
if (urlString != null) {
Enumeration urls = new StringTokenizer(urlString);
while (urls.hasMoreElements()) {
theURL = (String)urls.nextElement();
try {
urlForButton = new URL(theURL);
catch (Exception e) {
try {
urlForButton = new URL(getDocumentBase(), theURL);
catch (Exception e2) {
reportError("Button" + nbr + " has invalid URL");
buttonURLTarget.setElementAt("Invalid URL", nbr - 1);
urlString = null;
break;
else {
reportError("Button" + nbr + " has no URL");
buttonURLTarget.setElementAt("No URL", nbr - 1);
buttonURL.addElement(urlString);
// Remove any unused elements in the Vectors
buttonURL.trimToSize();
buttonURLTarget.trimToSize();
buttonDescription.trimToSize();
// If no buttons were added, throw exception
if (!buttonOnBar) throw new IllegalArgumentException("No buttons on bar");
// Let the buttonBar know that all buttons have been defined. This is
// really only necessary if downShift is true, but it won't hurt calling
// the method in either case.
buttonBar.allButtonsDefined();
// Add the applet as an observer so that the applet will be notified
// when button events occur.
buttonBar.addButtonObserver(this);
// Enable the button bar now that all buttons have been defined.
// (the buttonBar is disabled when it is created and must be
// specifically enabled).
buttonBar.enable(true);
// Add the buttonBar to the applet
setLayout(null);
add(buttonBar);
catch (Exception e) {
reportError("Can't create ButtonBar\n" + e);
// buttonBarEvent
// This method is called by the ButtonBar whenever a button event occurs
// It provides the ButtonBar that the event occurred for, the button ID
// that the event occurred for, and the event type.
public void buttonBarEvent(ButtonBar barID, String buttonID, int buttonEvent) {
String description;
// The buttonBar will send an IMAGES_READY event when all button bar images
// have been prepared. We are not interested in this event, but only in
// certain "action" events that occur for a button.
if (buttonEvent != ButtonBar.IMAGES_READY) {
// A number in String format was assigned as the buttonID when each
// ButtonRegion was created. The buttonID String will now be converted
// back into a number that can be used as a Vector index to retrieve
// button specific information (i.e., URL, target frame, and description).
int buttonNbr = Integer.parseInt(buttonID) - 1;
switch (buttonEvent) {
// If a mouseDown event has occurred for the button, and if an
// AudioClip is available for this event, play the AudioClip.
case ButtonBar.MOUSE_CLICK:
if (mouseClickAudio != null) mouseClickAudio.play();
break;
// If the mouse has been moved over a button, display the button's
// description in the browser's status area. If the button that the mouse
// is over is an active button, and if there is an AudioClip available
// for this event, then play the audio clip.
case ButtonBar.MOUSE_ENTER:
case ButtonBar.MOUSE_ENTER_DISABLED:
description = (String)buttonDescription.elementAt(buttonNbr);
if (description != null) showStatus(description);
if (mouseEnterAudio != null && buttonEvent == ButtonBar.MOUSE_ENTER) {
mouseEnterAudio.play();
break;
// If the mouse has been moved off of a button and if the button has
// description text associated with it, then clear the browser's
// browser's status area.
case ButtonBar.MOUSE_EXIT:
case ButtonBar.MOUSE_EXIT_DISABLED:
description = (String)buttonDescription.elementAt(buttonNbr);
if (description != null) showStatus("");
break;
// If the button has been depressed (i.e., a mouseDown followed by
// a mouseUp for the same button) then load the URL(s) for the button
// in the target frame(s), if specified. If the URL is null, then the
// URL was found to be missing or invalid, so display the text stored in
// the buttonURLTarget Vector in the brower's status area. If there is
// an AudioClip for the event, play the audio.
case ButtonBar.BUTTON_DOWN:
// Get the string of URLs and Targets for the button
String urlString = (String)buttonURL.elementAt(buttonNbr);
String targetString = (String)buttonURLTarget.elementAt(buttonNbr);
// If there is at least one URL for the button
if (urlString != null) {
URL urlForButton;
String theURL;
String theTarget;
Enumeration urls = new StringTokenizer(urlString);
Enumeration targets = null;
if (targetString != null) targets = new StringTokenizer(targetString);
// While there is another URL for the button
while (urls.hasMoreElements()) {
// Get the next String token that represents a URL
theURL = (String)urls.nextElement();
// Convert the String to a URL
try {
urlForButton = new URL(theURL);
catch (Exception e) {
try {
urlForButton = new URL(getDocumentBase(), theURL);
catch (Exception e2) {
urlForButton = null;
break;
// If the String was successfully convert to a URL
if (urlForButton != null) {
// If there is a target for this URL
if (targets != null && targets.hasMoreElements()) {
// Get the String that represents the target
theTarget = (String)targets.nextElement();
// If the target String does NOT begin with a "-",
// then load the URL in the target
if (theTarget.charAt(0) != '-') {
getAppletContext().showDocument(urlForButton, theTarget);
// Else a target for this URL should not be used
else {
getAppletContext().showDocument(urlForButton);
// Else there is no target for this URL, so just show
// the URL.
else {
getAppletContext().showDocument(urlForButton);
// Else URL is missing or invalid
else showStatus((String)buttonURLTarget.elementAt(buttonNbr));
if (buttonDownAudio != null) buttonDownAudio.play();
break;
// Error reporting
private void reportError(String message) {
message = "[ImageURLButtonBar] Error - " + message;
System.out.println(message);
showStatus(message);
} -
Bridge CS4 won't output to pdf multiple images with same filename
Hiya...my googling efforts have thus far failed!
I've got CS4, and in Bridge, I created a New Smart Collection to find all filenames in a folder containing "." or ".jpg" - which in turn searched through all the subfolders like what you used to be able to do in Photoshop CS3. Very simple stuff, but all the images are jpg's, but in multiple folders (I don't want to move them out of the folders, as the files came from an external source, and there are heaps of folders, and I don't want to pdf each subfolder seperately as it will take forever).
The problem is that some of the files have the same filenames (again I'd prefer not to rename, as it happens a lot on this project, and they are all over the place). So whilst Bridge will show the thumbnail images correctly in the content tabbed screen in my New Smart Collection, but once I've done the Output to PDF thing, for example, instead of showing both different images it has pdf only the first image but repeated it twice. And this happens multiple times throughout the pdf, the more times the same filename is used, the more times the first image gets repeated.
I know that it is messy to have multiple similar filenames, but why can't bridge just place the image anyway? It allocated a space for it on the pdf and does show it in bridge, it just doesn't seem to survive the transfer to pdf well.
The only other thing that I have done is use the below link (which was posted on another adobe forum thread) to create a custom pdf output template (nothing too fancy, just number of rows / columns, size, font etc). But I've tried using the standard bridge templates and it does the same thing.
http://www.proficiografik.com/2009/08/03/save-custom-pdf-output-template-in-adobe-bridge-c s4.html
Any help would be appreciated...even if to tell me that I am being unreasonable!
UPDATE 16/11/09
Just to let you know that I seem to have resolved the bug inadvertently with one of the Adobe updates. The below is the link for the AdobeOutputModule-2.1-mul-AdobeUpdate.zip which was released on 2/19/2009 - which allows for headers & footers to be placed in the Ouput pdf. I finally installed it today, and everything seems to be working fine now (i.e. I can pdf multiple images with the same filenames and the pdf will actually show each different image rather than repeating only 1 of the images).
Must have been a fix installed in the contact sheet templates that get installed with the update - not sure why the original version was corrupted, but I've left that with the Adobe guys (I submitted a bug report - and they were able to replicate the problem but hadn't fixed it as yet).
http://www.adobe.com/support/downloads/detail.jsp?ftpID=4228
Message was edited by: djtun71 (16/11/09)When I click import from disc I am asked to choose a disc and then I get this message:
The following photos will not be imported because they are already present in the catalog. To see these photos in the catalog select 'Show in Library' (the import will be canceled).
This is followed by a long list of images. If I click 'Show in Library' I can see all the images with the same filename. And then they start to automatically write over those images with images from the disc. However they keep the same metadata and keywords from the previous images. If I click on Import and deselect the "don't reimport suspected duplicates" box, it imports only the images that don't share filenames and none of the images that do.
Is there a way of setting the "Don't reimport suspected duplicates" box in preferences? -
I am getting a error IO when trying to upload multiple images within wordpress using the flash uploader. I do not get the error when uploading using explorer. The error only appears if I try uploading using firefox....any ideas?
Logged the call with SAP who directed me to 'Define settings for attachments' in IMG and setting the 'Deactivate Java Applet' & 'Deactivate Attachment versioning' checkboxes - problem solved.
-
Problem in Loading Multiple image in Single Sprite/MovieClip
Hi All,
I am having a killing problem in loading multiple images in single movie clip/sprite using a separate class.
Here is the ImageLoader.as class
package com.project.utils{
import com.project.*;
import com.project.utils.*;
import flash.events.EventDispatcher;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.display.Loader;
import flash.events.IOErrorEvent;
import flash.net.URLLoader;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.display.Bitmap;
public class ImageLoader extends EventDispatcher {
public var imgloader:Loader;
public var imgMc:MovieClip;
public var imgObject:Object;
public var loaded:Number;
public function ImageLoader():void {
imgMc = new MovieClip();
imgObject = new Object();
imgloader = new Loader();
public function loadImage(imgHolder:MovieClip, imgObj:Object):void {
imgMc = new MovieClip();
imgObject = new Object();
imgloader = new Loader();
imgMc = imgHolder;
imgObject = imgObj;
imgloader.contentLoaderInfo.addEventListener(Event.COMPLETE,onImgLoad);
imgloader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,onImgLoadProgress);
imgloader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,onImageLoadFailed);
imgloader.load(new URLRequest(imgObj.FilePath));
private function onImgLoad(Evt:Event):void {
var image:Bitmap = Bitmap(Evt.target.content);
try {
imgMc.removeChildAt(0);
} catch (error:Error) {
imgMc.addChild(image);
try {
if (imgObject.URL != undefined) {
imgMc.buttonMode = true;
imgMc.removeEventListener(MouseEvent.CLICK, onImageClicked);
imgMc.addEventListener(MouseEvent.CLICK, onImageClicked);
} catch (err:Error) {
dispatchEvent(new CustomEvent("CustomEvent.ON_IMGE_LOAD"));
private function onImageClicked(evt:MouseEvent):void {
trace("Image Attrs:"+imgObject.URL +" Target "+imgObject.Target);
private function onImgLoadProgress(Evt:ProgressEvent):void {
if (Evt.bytesLoaded>0) {
loaded = Math.floor((Evt.bytesLoaded*100)/Evt.bytesTotal);
dispatchEvent(new CustomEvent("CustomEvent.ON_IMGE_LOAD_PROC",loaded));
private function onImageLoadFailed(Evt:IOErrorEvent):void {
trace("Image Loading Failed");
dispatchEvent(new CustomEvent("CustomEvent.ON_IMGE_LOAD_FAIL"));
Here I am loading some images using the above class in a for loop, like
for (var i=0; i < 3; i++) {
//imgLoader=new ImageLoader;
imgLoader.addEventListener("CustomEvent.ON_IMGE_LOAD",onImageLoad);
var target:MovieClip=videolist_mc["list" + mcCount + "_mc"];
target.list_mc.visible=false;
var imgObj:Object=new Object;
imgObj.FilePath=list[i].Thumbnail;
imgObj.Url=list[i].Url;
imgObj.Target=list[i].Target;
target.list_mc.urlObj=new Object ;
target.list_mc.urlObj=imgObj;
imgLoader.loadImage(target.list_mc.imgholder_mc,imgObj);
target.list_mc.lable_txt.htmlText="<b>" + list[i].Label + "</b>";
target.list_mc.imgholder_mc.buttonMode=true;
target.list_mc.imgholder_mc.addEventListener(MouseEvent.CLICK,onItemPressed);
mcCount++;
In this case, the ImageLoader.as works only on the last movie clip from the for loop. For example, if i am trying to load three image in three movie clips namely img_mc1,img_mc2 and img_mc3 using the for loop and ImageLoader.as, I am getting the image loaded in the third movie clip only img_mc.
See at the same time, If i uncomment onething in the for loop that is
//imgLoader=new ImageLoader;
its working like a charm. But I know creating class objects in a for loop is not a good idea and also its causes some other problems in my application.
So, help to get rid out of this problem.
Thanks
-Varunpackage com.project.utils{
import com.project.*;
import com.project.utils.*;
import flash.events.EventDispatcher;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.display.Loader;
import flash.events.IOErrorEvent;
import flash.net.URLLoader;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.display.Bitmap;
public class ImageLoader extends EventDispatcher {
public var imgloader:Loader;
public var imgMc:MovieClip;
public var imgObject:Object;
public var loaded:Number;
public function ImageLoader():void {
// better add you movieclip to the stage if you want to view anything added to it.
imgMc = new MovieClip();
imgObject = new Object();
imgloader = new Loader();
public function loadImage(filepath:String):void {
imgloader.contentLoaderInfo.addEventListener(Event.COMPLETE,onImgLoad);
imgloader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,onImgLoadPr ogress);
imgloader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,onImageLoadF ailed);
imgloader.load(new URLRequest(filepath));
private function onImgLoad(Evt:Event):void {
var image:Bitmap = Bitmap(Evt.target.content);
try {
imgMc.removeChildAt(0);
} catch (error:Error) {
imgMc.addChild(image);
try {
if (imgObject.URL != undefined) {
imgMc.buttonMode = true;
imgMc.removeEventListener(MouseEvent.CLICK, onImageClicked);
imgMc.addEventListener(MouseEvent.CLICK, onImageClicked);
} catch (err:Error) {
dispatchEvent(new CustomEvent("CustomEvent.ON_IMGE_LOAD"));
private function onImageClicked(evt:MouseEvent):void {
trace("Image Attrs:"+imgObject.URL +" Target "+imgObject.Target);
private function onImgLoadProgress(Evt:ProgressEvent):void {
if (Evt.bytesLoaded>0) {
loaded = Math.floor((Evt.bytesLoaded*100)/Evt.bytesTotal);
dispatchEvent(new CustomEvent("CustomEvent.ON_IMGE_LOAD_PROC",loaded));
private function onImageLoadFailed(Evt:IOErrorEvent):void {
trace("Image Loading Failed");
dispatchEvent(new CustomEvent("CustomEvent.ON_IMGE_LOAD_FAIL"));
Here I am loading some images using the above class in a for loop, like
for (var i=0; i < 3; i++) {
var imgLoader:ImageLoader=new ImageLoader();
imgLoader.addEventListener("CustomEvent.ON_IMGE_LOAD",onImageLoad);
var target:MovieClip=videolist_mc["list" + mcCount + "_mc"];
target.list_mc.visible=false;
var imgObj:Object=new Object;
imgObj.FilePath=list[i].Thumbnail;
imgObj.Url=list[i].Url;
imgObj.Target=list[i].Target;
target.list_mc.urlObj=new Object ;
target.list_mc.urlObj=imgObj;
imgLoader.loadImage(pass the image file's path/name);
target.list_mc.lable_txt.htmlText="<b>" + list[i].Label + "</b>";
target.list_mc.imgholder_mc.buttonMode=true;
target.list_mc.imgholder_mc.addEventListener(MouseEvent.CLICK,onItemPressed);
mcCount++; -
I can't set up multiple images in tabbed panels in photoshop CC (do not have this problem in PS5 or 6). Has anyone had this problem with CC and if so do they know the fix?
I just discovered something really weird. If I open the images in
photoshop (and the tabs are not showing) and then open another window on
top of photoshop (for example word or safari) , then the images and tabs
show in the photoshop window. But if I move Pshop to the front screen then
the tabs disappear! -
Selecting multiple images to edit the source code
Hi. Does anyone know if there's a way to select multiple
images in a table and change there source code. The reason why I
ask is that I recently decided to organize my assets folder by
adding subfolders. Naturally, this makes my images appear as broken
links. It's a pretty big site that I'm working on and I would like
to know if there is a faster way than just selecting them one by
one.If you would have created the folders within DW itself (file
management), and moved images from one
folder to the other, the links would have been adjusted
automatically. Carrying out changes like
this outside of DW will create broken links as you have
found.
Did you backup the original site, if so, and have a lot of
broken links, it maybe worthwhile, going
back to the original and use the file management to
rename/create new folders and move your assets
that way.
Nadia
Adobe® Community Expert : Dreamweaver
Unique CSS Templates |Tutorials |SEO Articles
http://www.DreamweaverResources.com
CSS Tutorials for Dreamweaver |
http://www.adobe.com/devnet/dreamweaver/css.html
"lordcornwallis" <[email protected]> wrote
in message
news:gpqni2$3io$[email protected]..
> Hi. Does anyone know if there's a way to select multiple
images in a table and
> change there source code. The reason why I ask is that I
recently decided to
> organize my assets folder by adding subfolders.
Naturally, this makes my
> images appear as broken links. It's a pretty big site
that I'm working on and
> I would like to know if there is a faster way than just
selecting them one by
> one.
> -
Bridge CS6 Script to Find Multiple Images in Multiple folders.
Is it possible to have a script to find multiple images within multiple folders that is on a external hard drive?
For instances I have a external hard drive assuming it's for a library of pictures.
Inside this hard drive has folders named as below
1-1000
1001-2000
2001-3000
3001-4000
If I had a perfect csv file for example that calls out for specific pictures for example 2, 10,1500 and 2000 (remember think big, it may be a larger list than this it could be hundreds or thousands of pictures); is there a script that would allow me to find these images and save a copy of them on to my desktop so that way I don't have to hunt for them in the old fashion way? I can read scripts but writing them is a different story.If you want to go with Batch I would recommend creating an Action of more or less these steps:
• set the resolution to the same as the background image’s
• change the image from Background Layer to regular Layer if necessary
• convert it to a Smart Object
• add a Drop Shadow Layer Style to the image (do not use Global Angle)
• place the background image (File > Place …)
• move it behind the image layer
• Image > Reveal All
• make Selection from that layer’s transparency (cmd-click its icon in the Layers Panel) and use Image > Crop
• select and transform the image layer to fit the intended position
This would naturally work out best if the images had the same size and proportions.
For the reflection on the floor duplicate the image, flip it vertically, move it in position and reduce its opacity to maybe 10%.
Realistically you may have to hide it partially behind the pillows, a Vector Mask would be an option. -
Selecting multiple images in a table
Hi. I have a website and have recently decided to organize my
assets folder by creating subfolders. However, this has made all of
the pictures on my site turn into broken source codes. Is there a
way to select multiple images within a table and edit the source
code? If anyone can help me I'd greatly appreciate it!You should always do this kind of thing using DW's Files
panel - DW will manage your links when you do.
Did you move all of the images into the same subfolder, or
different ones? If the latter, you will just have to remake all of
the links one by one. If the former you may be able to do
find/replace to find the old links and replace with the new folder
path.
Maybe you are looking for
-
The field "GLTPC" is unknown, but there is a field with the similar name*
Hi all When i am running the report painter reports in SAP i am getting this error . Syntax error in program SAPFGRWG in include FGRWGE60 in line 19 Last changed by SAP Author SA
-
Problem related to error handling in Proxy for Inbound
Hi All, I have a requirement to process the inbound interface , which internally updates the HR Infotypes. I need to handle all possible erorrs and store it in the custom table. Can anyone please guide, as to how to catch the errors and wht type of e
-
How To Process Inbound Shipment IDOC of IS-OIL ?
Hi Expert, We are on 4.7E IS-OIL. We have one requirement thru which we are getting the Shipment IDOC from SCM system which is coming to R/3. The IDOC Message Type Which is Flowing From SCM To R/3 is OILSH1 & Basic Type is OILSHI01. I want to Kno
-
Certain pages aren't opening in safari
certain pages aren't opening in safari when they have worked before. I havent got any extensions loaded and most pages work fine but its a select few that wont load and they're working on my iPhone.
-
Dynamic combination of members in evdre
Hi How is it possible to restrict the dynamic generation of combinationof members. say In my entity dimension, 5 members, and User defined dimension 5 members, when I am selecting these two dimensions in rows in evdre it is generating 25 combinations