'animation on top of a background in photoshop6'
I recently saw a PSD CS6 movie from a animated object in front of an imported background picture. So the whole movie plays in an outcut in front of this picture. Would somebody know how this had been done? As I didn't use the animation function yet in PCS6 can't think how to start. It seems to be very simple (as always once you know how) :-)
This was in Photokina so can't show it. TX
Looks great. Lot of possibilities I see. I suppose since one can make a smart object of it and then use the filters on it (clipping mask as you say) that could do the job. Have to try this out. Very promising in fact! Still think the movement made by the object and the object itself has to be rather simple. Still thinking I'm overlooking something, seems to be too simple. With a sort of blue key sytem enviroment this must do the job.
But first things first, let's try out.
Similar Messages
-
How do I export an animation from Photoshop with no background, to use in after effects?
Its been a few years since I've used photoshop and after effects together so hoping you can remind me how to do this.
I'm trying to export an animation created in photohop, its frame by frame, no background. I've been exporting it as an image sequence, now I"ve coloured it I need to solve this transparency issue.
Is there a way to export it to use in after effects on top of a background layer.
So I just want to see the character, no background, animation on top of my background layer in after effects, does that make sense??
Please don't say I need to have an alpha channel on each frame, that will take ages, there must be another way.
Please help I need to sort this ASAP
Thanks in advance!
xThanks!
So this makes sense, I tried it, when I import into after effects (here is the psd.)
I get this window not sure what to be selecting, but I tried different things and it still isn't importanting as literally the animation with no background, have I missed something? whats strange is that when I import the psd, what does import is a strange monatage of snippets of the video I'm making in afterfx, not the completely separate animation i made in photoshop which I'm trying to work into the video.
very perplexing! any more help is much appreciated.
Thanks -
Problem placing buttons on top of a background image
My knowledge of Java isn't the greatest and I am currently having problems placing buttons on top of a background image within a JApplet (this is also my first encounter with Applets).
I'm using a Card Layout in order to display a series of different screens upon request.
The first card is used as a Splash Screen which is displayed for 5 seconds before changing to the Main Menu card.
When the Main Menu card is called the background image is not shown but the button is.
While the Applet is running no errors are shown in the console.
Full source code can be seen below;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.net.*;
// First extend JApplet
public class WOT extends JApplet {
//--------------- Variables are declared here -----------------
private CardLayout contentCardLayout = new CardLayout(); // declare CardLayout
private Container contentContain; // declare content Container
private JPanel contentCard, splashScreen, mainMenu, menuImage; // declare content Panels
private JLabel splash, menu, map; // declare image labels
private ImageIcon mapBtn; // declare ImageIcons
private JButton mapOption; // declare option Buttons
private Timer timer; // declare Timer
private ActionListener actionListener, mapOptionListener; // declare ActionListener
//--------------- Initialise Applet -----------------
public void init() {
//--------------- Set-up Card Layout -----------------
contentCard = new JPanel(contentCardLayout); // assign card panels to CardLayout
//--------------- Splash Screen -----------------
splashScreen = new JPanel();
splash = new JLabel(new ImageIcon(getClass().getResource("img/bg.gif")));
splashScreen.add(splash);
splashScreen.setSize(600,800);
splashScreen.setLocation(0,0);
//--------------- "View Map" Option Button -----------------
mapBtn = new ImageIcon(getClass().getResource("img/map.gif"));
mapOption = new JButton(mapBtn);
mapOption.setBorder(null);
mapOption.setContentAreaFilled(false);
mapOption.setSize(150,66);
mapOption.setLocation(150,450);
mapOption.setOpaque(false);
mapOption.setVisible(true);
//--------------- Main Menu Screen -----------------
//menuImage = new JPanel(null);
//menuImage.add(mainMenu);
//menuImage.setLocation(0,0);
mainMenu = new JPanel(null);
menu = new JLabel(new ImageIcon(getClass().getResource("img/menu.gif")));
menu.setLocation(0,0);
mainMenu.add(menu);
//mainMenu.setBackground(Color.WHITE);
mainMenu.setLocation(0,0);
mainMenu.setOpaque(false);
//mainMenu.setSize(150,66);
mainMenu.add(mapOption);
//--------------- Map Image Screen -----------------
map = new JLabel(new ImageIcon(getClass().getResource("img/map.gif")));
//--------------- Add Cards to CardLayout Panel -----------------
contentCard.add(splashScreen, "Splash Screen");
contentCard.add(mainMenu, "Main Menu");
contentCard.add(map, "Map Image");
//--------------- Set-up container -----------------
contentContain = getContentPane(); // set container as content pane
contentContain.setBackground(Color.WHITE); // set container background colour
contentContain.setLocation(0,0);
contentContain.setSize(600,800);
contentContain.setLayout(new FlowLayout()); // set container layout
contentContain.add(contentCard); // cards added
//--------------- Timer Action Listener -----------------
actionListener = new ActionListener()
public void actionPerformed(ActionEvent actionEvent)
//--------------- Show Main Menu Card -----------------
contentCardLayout.show(contentCard, "Main Menu");
//--------------- Map Option Button Action Listener -----------------
mapOptionListener = new ActionListener()
public void actionPerformed(ActionEvent actionEvent)
//--------------- Show Main Menu Card -----------------
contentCardLayout.show(contentCard, "Map Image");
//--------------- Timer -----------------
timer = new Timer(5000, actionListener);
timer.start();
timer.setRepeats(false);
}Any help would be much appreciated!
Edited by: bex1984 on May 18, 2008 6:31 AM1) When posting here, please use fewer comments. The comments that you have don't help folks who know Java read and understand your program and in fact hinder this ability, which makes it less likely that someone will in fact read your code and help you -- something you definitely don't want to have happen! Instead, strive to make your variable and method names as logical and self-commenting as possible, and use comments judiciously and a bit more sparingly.
2) Try to use more methods and even classes to "divide and conquer".
3) To create a panel with a background image that can hold buttons and such, you should create an object that overrides JPanel and has a paintComponent override method within it that draws your image using the graphics object's drawImage(...) method
For instance:
an image jpanel:
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import javax.imageio.ImageIO;
import javax.swing.JButton;
import javax.swing.JPanel;
public class BackgroundImage
// **** this will have to be changed for your program:
private static final String IMAGE_PATH = "../../m02/a/images/Forest.jpg";
private BufferedImage myImage = null;
private JPanel imagePanel = new JPanel()
@Override
protected void paintComponent(Graphics g)
{ // *** here is where I draw my image
super.paintComponent(g); // **** don't forget this!
if (myImage != null)
g.drawImage(myImage, 0, 0, this);
public BackgroundImage()
imagePanel.setPreferredSize(new Dimension(600, 450));
imagePanel.add(new JButton("Foobars Rule!"));
try
myImage = createImage(IMAGE_PATH);
catch (IOException e)
e.printStackTrace();
catch (URISyntaxException e)
e.printStackTrace();
private BufferedImage createImage(String path) throws IOException,
URISyntaxException
URL imageURL = getClass().getResource(path);
if (imageURL != null)
return ImageIO.read(new File(imageURL.toURI()));
else
return null;
public JPanel getImagePanel()
return imagePanel;
}and an applet that uses it:
import java.lang.reflect.InvocationTargetException;
import javax.swing.JApplet;
import javax.swing.SwingUtilities;
public class BackgrndImageApplet extends JApplet
@Override
public void init()
try
SwingUtilities.invokeAndWait(new Runnable()
@Override
public void run()
getContentPane().add(new BackgroundImage().getImagePanel());
catch (InterruptedException e)
e.printStackTrace();
catch (InvocationTargetException e)
e.printStackTrace();
} -
How can I put a vertical menu ON TOP OF the background image?
I've taken a screenshot to describe my problem.
http://i48.tinypic.com/10ndeg4.jpg
I want to put the menu on top of the background image. Compare it to placing another image on top of the background image. HOW on earth can I do this?Did you try putting the image in a <div> and setting the background image for the <div> with CSS. Then within the <div> place your menu.
Just a thought.
LJD -
Wrapping text around an image on top of a background
I am trying to wrap text around a photo, but I'm doing so on top of a background color box in my Master Page. Problem is that when I create the background box in the Master Page, the text goes away. I can resolve the problem by checking the "Ignore Text Wrap" option under the Text Frame Option menu, but then I lose the text wrap around my images. Is there a way around this?
Don't apply text wrap to the background....
-
Inserting a Spry Accordion on top of a background image?
I created an 800 x 600 pixel graphic image in Adobe Photoshop CS4 to be used as an overall background image for a webpage. I also created a few navigation links from the image Layers using the Slice Select Tool, then optimized and saved the image as an html file using the Save for Web & Devices command in Photoshop. Next, I opened the html file in Dreamweaver CS4.
Is it possible to insert a Spry Accordion with a clear (transparent) background anywhere on top of that background image in Dreamweaver CS4 so that I can see the background image behind the text content of the Spry Accordion? I use Windows Vista.Hi,
Yes, as is shown by the following code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
<link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />
</head>
<body style="background: url(images/detail/cd1.jpg) no-repeat center;"> //use your own location and file
<div id="Accordion1" class="Accordion" tabindex="0">
<div class="AccordionPanel">
<div class="AccordionPanelTab">Label 1</div>
<div class="AccordionPanelContent">Content 1</div>
</div>
<div class="AccordionPanel">
<div class="AccordionPanelTab">Label 2</div>
<div class="AccordionPanelContent">Content 2</div>
</div>
</div>
<script type="text/javascript">
<!--
var Accordion1 = new Spry.Widget.Accordion("Accordion1");
//-->
</script>
</body>
</html> -
Need to embed a Flash animation over top of a html page!
Hello,
I've created an animation in Flash with a transparent
background which needs to be embedded into a html page with lots of
div tags. I didn't create the html page and now I need to place the
animation into that page somehow, overlapping with some text and
graphics. Every where I place the animation, it will sit before or
after the text and elements in the page and not over top of them.
Hope I am clear enought to explain what my problem is. Does anybody
know what I should do? I truly appreciate your help.
PS. I am not a technical person so if any body wants to help
me and needed the sources please email me at:
Many thanks in advance.
Mojan
MojanTreat Flash as any other content and place it within its own
containing div. Position the div in the normal flow of the document
allowing the div to 'stack' with the other divs above and below it.
If you want to place the Flash such that it 'covers' existing
content you can use CSS positioning techniques. Options include
absolute positioning the containing div with the Flash swf within
it (this removes the div from the normal flow of the document) and
placing it over the existing content. Us position: absolute; and
top and left, with px values to place the div where you need it.
You can find tutorials on absolute positioning in the developer
center or www.communitymx.com
You can use the float property and negative margins to pull
containing divs (or other elements) around the document, too.
Experimenting with floats can be fun but you need to read up on
their specific behavior as you can end up pulling your hair out.
Again, there are plenty of CSS tutorials on positioning and a
Google search should throw-up some options.
Outside of CSS you can use DOM Scripting and JavaScript to
also position and hide various content depending on your
requirements. If you get stuck come back on this forum and ask for
more help but provide specific code to help us. -
Problem: Light color shadow on top of black background when printing
Using InDesign CS3, PC.
I have a book cover design that looks perfect on screen. There is a section with a black background and colored letters on top of it. Also on top of this black background is an image of a dinosaur (made in illustrator CS3). The image was placed into the InDesign file and does not have any color to the background. But when it is printed (Xerox Phaser), there is a colored shadow where the image overlaps the black background section.
There are also colored areas over other black background sections where drop shadows (35%) occur on top of the black background.
Could anyone tell me what I am doing wrong? I have never dealt with 100% black in my designs before and I must be doing something wrong.
Again, on the screen you cannot see any of these colored areas on top of the black background. It's only when I print that they show up.
Thank you,
Cathyhttp://indesignsecrets.com/eliminating-ydb-yucky-discolored-box-syndrome.php
http://indesignsecrets.com/eliminating-the-white-box-effect.php
Bob -
Navigator transition animation more like android default background animation
Hi,
I'm building an mobile Air app for my tablet.
This app has multiple screens and the user will be navigating through them a lot.
I'm using the navigator push and pop views to accomodate this.
this works perfectly with all the default animations.
My problem is that i would like the animation to be more like the default android background animation.
and by that i mean that one you drag your finger over the screen the next 'view' already comes into the viewing area a little bit (and your current view disappears a little).
If you release your finger to early the view snaps back, if you swipe through you go to the next view.
With the current navigator transition it's an 'all or nothing' swipe, if i swipe i get the next (or previous) view but i don't have the option to drag my screen a little bit to see the first part of the screen i want to navigate to.
Does anyone know of a way to accomplish this with the navigator?
Or am i forced to abandon the navigator and write this transition logic by myself?
I hope i made myself clear, any help is much appreciated.
with kind regards,
Peter BiermanAIR does not currently have an API to read this particular Android setting. To answer your question, Flex view transitions are independent of the Android system settings.
Jason San Jose
Software Engineer, Flex Mobile -
Semi-transparent foreground image on top of opaque background image
The client has sent me this image (a low-res .jpg file) to place on top of a green gradient background (also provided, as a multi-layered .psd file). I'm to silhouette the image and place it on top of the green background at the appropriate size (easy) while maintaining the transparency of the grid and the reflection so that the green shows through (difficult ... as in I don't know how and haven't been able to Google up the answer). The end result will be used on the client's Website.
I considered telling him it couldn't be done (not sure if that's true) or would be cost prohibitive (I would need to be able explain why it would take me longer to do than he thinks it should take). The third (and most desirable) alternative is that this is easier to do than I realize and I just need to be pointed to the proper instructions.
Any advice?
Thanks,
AndreaPut the gradient in photoshop and also convert the jpg to .psd in same colour profile as gradient, then place graphic into gradient as a layer on top. Set graphic to 'multiply'. That is technically the way to do it.
This will not look good, so you will want to isolate the blue bars of the graph and the arrow using 'select colour range' (and maybe some manual selection) then do 'command-j' to create another layer containing only those items and leave that as 'normal' (ie don't multiply that one) and it should look fine.
There is no way to silhouette the fading part into the gradient, it must overlay. Lifting the bars out is cheating a bit but will give nice appearance.
Should only take a few mins, make sure your gradient has some noise in it if you have any problems, I would be happy to do it for you if you want to send files to my email in profile.... -
My background photos in the Family Album theme do not bleed when I put another photo on top of them. Does anyone know how to fix this in iphoto 9?
Can you post a screenshot of what you're seeing on that page? In the meantime try this basic fix: make a temporary, backup copy (if you don't already have a backup copy) of the library and try the following:
1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
User/Home()/Library/ Preferences folder.
2 - delete iPhoto's cache file, Cache.db, that is located in your
User/Home()/Library/Caches/com.apple.iPhoto folder.
Click to view full size
3 - launch iPhoto and try again.
NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto. You'll also have to reset the iPhoto's various preferences.
Happy Holidays -
Black Text on top of a background, is grey
I'm getting fairly frusturated trying to do something simple. I just started using InDesign.
I want to add text on top of a green background, near the very to of the page. Everytime I use the text tool, it shows up nice and black like I want, but once I unselect it, the text fades to like a grey color.
How do I get it to display right? I'm thinking it is blending it with the background color?
However, when I press enter and go down the page further, to where I don't want it positioned, it seems to blacken. I don't understand what is going on, any help is appreciated.Can you post a link to a sample of this file? Needn't be more than a box with the background and some text overlapping and not.
It's puzzling to me that you say it gets lighter on the background. Unless you've changed it, the black swatch overprints by default, so it should actually appear darker. Are you sure your eye isn't playing tricks on you? What values do you see in Separations preview?
And I still wnat to know the answers to the porevious questions about the printer and settings.
Peter -
Is it possible to draw a mesh on top of a background image in flash ?
Problem i am trying to draw my 3d mesh on top of any image or an object in flash but my model is drawing under the image all the time i don't know how to sort this problem since i am bit new to flash development .
Please help me with this thank you.Sorry about this messy code its because of this copy pasting stuff but if you could press ctrl + f and type Init mesh and Init Functions thats where everything is happening and this 3d mesh will be loaded
using a preloader function in a separate file thats why i add a event with Added_to_stage to the listener Problem is once i Draw this mesh with their morph target on to the screen i couldn't able to draw anything
in the background of this object everything comes on top of this 3d mesh .
once again sorry for this mess anyway its still in the unit test phase .
package
// All the import stuff hided by me ...
[Event(name="FLACEventEncodingComplete", type="FLACEvent")]
[Event(name="FLACEventDecodingComplete", type="FLACEvent")]
[Event(name = "progress", type = "flash.events.ProgressEvent")]
public class ChatBotMain extends Sprite
//Embedded assets
Variable which loads all the textures are hided ....
//engine variables
private var scene:Scene3D=new Scene3D();
private var camera:Camera3D = new Camera3D();
private var view:View3D = new View3D();
private var cameraController:HoverController;
private var dlight : DirectionalLight;
//material objects
Hided
//scene objects
Hided
//navigation variables
Hided
// morph targets
// hided ......
//Chatbot code
Hided
//Flac encoding variables
Hided
//button bitmaps
Hided
public function ChatBotMain():void
var stage1:Stage = Stageobject;
//trace("stage",stage1.stage);
this.addEventListener(Event.ADDED_TO_STAGE,init);
* Global initialise function
private function init(e:Event= null):void
this.removeEventListener(Event.ADDED_TO_STAGE,init);
microphone = Microphone.getMicrophone();
microphoneBuffer.length = 0;
microphone.rate = 16;
flacCodec = (new cmodule.flac.CLibInit).init();
initListeners();
initEngine();
initLights();
initMaterials();
initObjects();
fileCount = 8;
initChatBot();
bootscreenBitmap.x = (width / 2) - (bootscreenBitmap.width / 2);
bootscreenBitmap.y = (height / 2) - (bootscreenBitmap.height / 2);
//addChild(bootscreenBitmap);
headMeshGeometry = new CustomPrimative("C:/Users/Rakesh/Documents/flashport/Chatbot/embeds/head3.mesh.xml",onloaded,true);
headMeshGeometry_blink = new CustomPrimative("C:/Users/Rakesh/Documents/flashport/Chatbot/embeds/head3_blink.mesh.xml", onloaded, true);
headMeshGeometry_mouthopen = new CustomPrimative("C:/Users/Rakesh/Documents/flashport/Chatbot/embeds/head3_mouthopen.mesh.xml", onloaded, true);
headMeshGeometry_smile = new CustomPrimative("C:/Users/Rakesh/Documents/flashport/Chatbot/embeds/head3_smile.mesh.xml",onloaded,true);
eyelMeshGeometry = new CustomPrimative("C:/Users/Rakesh/Documents/flashport/Chatbot/embeds/eyeball2_l.mesh.xml",onloaded,true);
eyerMeshGeometry = new CustomPrimative("C:/Users/Rakesh/Documents/flashport/Chatbot/embeds/eyeball2_r.mesh.xml",onloaded,true);
hairMeshGeometry = new CustomPrimative("C:/Users/Rakesh/Documents/flashport/Chatbot/embeds/hair3.mesh.xml", onloaded, true);
shirtMeshGeometry = new CustomPrimative("C:/Users/Rakesh/Documents/flashport/Chatbot/embeds/shirt.mesh.xml",onloaded,true);
//We can use the playerObject class to "analyse" the audio data as it is being played
//Currently not needed due to just moving the mouth in random patterns as the speech plays
playerObject.outputSnd = new Sound();
playerObject.outputSnd.addEventListener(SampleDataEvent.SAMPLE_DATA, processSound);
private static const FLOAT_MAX_VALUE:Number = 1.0;
private static const SHORT_MAX_VALUE:int = 0x7fff;
* Converts an (raw) audio stream from 32-bit (signed, floating point)
* to 16-bit (signed integer).
* @param source The audio stream to convert.
public function convert32to16(source:ByteArray):ByteArray
* Called when encoding has finished.
private function encodingCompleteHandler(event:*):void {
function ioErrorHandler(e:Event):void {
trace("error");
thinking = false;
microphoneButton.upState = upButton;
microphoneButton.overState = downButton;
microphoneButton.downState = downButton;
function loaderCompleteHandler(e:Event):void {
var loader:URLLoader = URLLoader(e.target);
var str:String = loader.data;
trace(str);
if (str.length > 0)
_mytext.text = str;
sendText();
thinking = false;
microphoneButton.upState = upButton;
microphoneButton.overState = downButton;
microphoneButton.downState = downButton;
//var responseVars = URLVariables( e.target.data );
//trace( "responseVars: " + responseVars );
* Called when the encoding task notifies progress.
private function encodingProgressHandler(progress:int):void {
trace("FLACCodec.encodingProgressHandler(event):", progress);
dispatchEvent( new ProgressEvent(ProgressEvent.PROGRESS, false, false, progress, 100));
private function getElapsedTime():int {
var now:int = getTimer();
return now - initTime;
private function start() : void {
initTime = getTimer();
public function encode(data:ByteArray):void
private function onSampleData(event:SampleDataEvent):void
private function onloaded(event:CustomPrimativeEvent):void
fileCount--;
trace("loaded geometry " + event.asset.url);
function processSound(event:SampleDataEvent):void
private function drawButton():void
private function buttonPressed(e:Event):void {
if (!thinking)
if (recording)
StopRecording();
else
//start recording
recording = true;
hided
private function StopRecording(): void
//stop recording
recording = false;
microphone.removeEventListener(SampleDataEvent.SAMPLE_DATA, onSampleData);
encode(microphoneBuffer);
private function initChatBot()
function keyHandler(e:KeyboardEvent)
if(e.charCode == 13)
sendText()
private function onOpen(e:Event)
debugOutput2.text = "Connection opened";
private function onStatusChange(e:HTTPStatusEvent)
debugOutput2.text = "Status Changed to "+e.status;
private function onMessageFailIO(e:Event)
debugOutput2.text = "IO ERROR: Could not send your request. Please try again later.";
private function onMessageFailSecurity(e:Event){
debugOutput2.text = "Security ERROR: Could not send your request. Please try again later.";
private function sendText()
if(_mytext.text != "")
chatHistoryText.text = chatHistory("You : " + _mytext.text);
var variables:URLVariables = new URLVariables();
var request:URLRequest = new URLRequest(urlToSend);
variables.sessionid = _sessionid
variables.chattext = _mytext.text;
chatLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
request.data = variables;
request.method = URLRequestMethod.POST;
chatLoader.addEventListener(Event.COMPLETE, getAudio);
chatLoader.addEventListener(Event.OPEN,onOpen);
chatLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS,onStatusChange);
chatLoader.addEventListener(IOErrorEvent.IO_ERROR,onMessageFailIO);
chatLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR,onMessageFailSecurity);
chatLoader.load(request);
_mytext.text = "";
function chatHistory(newText):String
chatTextArr[0] = chatTextArr[1];
chatTextArr[1] = chatTextArr[2];
chatTextArr[2] = chatTextArr[3];
chatTextArr[3] = chatTextArr[4];
chatTextArr[4] = chatTextArr[5];
chatTextArr[5] = newText;
var chatHistory = chatTextArr[0] != ""?chatTextArr[0]+"\n":"";
chatHistory += chatTextArr[1] != ""?chatTextArr[1]+"\n":"";
chatHistory += chatTextArr[2] != ""?chatTextArr[2]+"\n":"";
chatHistory += chatTextArr[3] != ""?chatTextArr[3]+"\n":"";
chatHistory += chatTextArr[4] != ""?chatTextArr[4]+"\n":"";
chatHistory += chatTextArr[5] != ""?chatTextArr[5]+"\n":"";
return chatHistory;
function randomNumber()
var rand = Math.random() * 1000000;
return Math.round(rand);
function getAudio(e:Event)
var loader:URLLoader = URLLoader(e.target);
//traceTxt.text = loader.data.soundFile;
debugOutput.text = loader.data;
var getStr:String = loader.data.soundFile;
var arr:Array = getStr.split("^_^");
loadAudio(arr[0], arr[1]);
function loadAudio(audioFile, textChat)
function completeHandler(event:Event):void
trace("completeHandler")
* Initialise the engine
private function initEngine():void
trace("intEngine");
//view.graphics.clear();
view.antiAlias = 4;
view.backgroundColor = backgroundColour;
view.scene = scene;
view.camera = camera;
//setup controller to be used on the camera
cameraController = new HoverController(camera, null, 25, 10, 70);
cameraController.panAngle = 90;
cameraController.tiltAngle = 2.5;
lastPanAngle = cameraController.panAngle;
lastTiltAngle = cameraController.tiltAngle;
view.addSourceURL("srcview/index.html");
addChild(view);
//Uncomment this to show some stats
var stats:AwayStats = new AwayStats(view);
stats.y = 100;
//addChild(stats);
* Initialise the lights in a scene
private function initLights():void
//Add a point light
// hided
scene.addChild(light);
* Initialise the materials
private function initMaterials():void
* Initialise the scene objects
private function initObjects():void
//default available parsers to all
Parsers.enableAllBundled();
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete);
var grid:WireframeGrid = new WireframeGrid(14, 140);
//view.scene.addChild(grid);
private function InitMesh()
var headMaterial:TextureMaterial = new TextureMaterial(new BitmapTexture(new headTexture().bitmapData));
var eyeMaterial:TextureMaterial = new TextureMaterial(new BitmapTexture(new eyeTexture().bitmapData));
var shirtMaterial:TextureMaterial = new TextureMaterial(new BitmapTexture(new shirtTexture().bitmapData));
var hairalphaMaterial:TextureMaterial = new TextureMaterial(new BitmapTexture(new hairalphaTexture().bitmapData))
//Not using specular maps at this stage
//headMaterial.specularMap = new BitmapTexture(new headSpecularTexture().bitmapData);
headMaterial.repeat = true;
headMaterial.bothSides = true;
headMaterial.alphaThreshold = 0.5;
headMaterial.gloss = 100;
headMaterial.specular = 3;
headMaterial.ambientColor = 0x808080;
headMaterial.ambient = 1;
//create subscattering diffuse method
subsurfaceMethod = new SubsurfaceScatteringDiffuseMethod(2048, 2);
subsurfaceMethod.scatterColor = 0xff7733;
subsurfaceMethod.scattering = .05;
subsurfaceMethod.translucency = 4;
eyeMaterial.repeat = true;
eyeMaterial.bothSides = true;
eyeMaterial.lightPicker = lightPicker;
hairalphaMaterial.lightPicker = lightPicker;
hairalphaMaterial.gloss = 100;
hairalphaMaterial.specular = 3;
hairalphaMaterial.ambientColor = 0x808080;
hairalphaMaterial.ambient = 1;
newmesh = new Mesh(headMeshGeometry, headMaterial);
hairmesh = new Mesh(hairMeshGeometry, headMaterial);
eyelmesh = new Mesh(eyelMeshGeometry, eyeMaterial);
eyermesh = new Mesh(eyerMeshGeometry, eyeMaterial);
shirtmesh = new Mesh(shirtMeshGeometry, shirtMaterial);
//newmesh.castsShadows = true;
newmesh.subMeshes[0].material = headMaterial;
hairmesh.subMeshes[0].material = hairalphaMaterial;
eyelmesh.subMeshes[0].material = eyeMaterial;
eyermesh.subMeshes[0].material = eyeMaterial;
view.scene.addChild(newmesh);
view.scene.addChild(hairmesh);
view.scene.addChild(eyelmesh);
view.scene.addChild(eyermesh);
view.scene.addChild(shirtmesh);
eyelmesh.rotationY = 90;
eyermesh.rotationY = 90;
newmesh.rotationY = 90;
hairmesh.rotationY = 90;
eyelmesh.rotationZ = 90;
eyermesh.rotationZ = 90;
newmesh.rotationZ = 90;
hairmesh.rotationZ = 90;
//hairmesh.y += 1.8;
hairmesh.y = 7.9;
hairmesh.x = -6.0;
eyermesh.y += 8;
eyermesh.z += 4.6;
eyermesh.x += 10.1;
eyelmesh.y += 8;
eyelmesh.z -= 4.6;
eyelmesh.x += 10.1;
shirtmesh.rotationX = -90;
shirtmesh.y = -12.0;
shirtmesh.x = -3.0;
var meshOffset:int = 4;
newmesh.y += meshOffset;
hairmesh.y += meshOffset;
eyermesh.y += meshOffset;
eyelmesh.y += meshOffset;
morpher = new Morpher(newmesh);
morphTarget_mouthopen = new MorphTarget(headMeshGeometry_mouthopen, headMeshGeometry);
morphTarget_smile = new MorphTarget(headMeshGeometry_smile, headMeshGeometry);
morphTarget_blink = new MorphTarget(headMeshGeometry_blink, headMeshGeometry);
var backplane:PlaneGeometry = new PlaneGeometry(512, 256);
var carehomeMaterial:TextureMaterial = new TextureMaterial(new BitmapTexture(new carehomeClass().bitmapData));
var backplaneMesh:Mesh = new Mesh(backplane, carehomeMaterial);
backplaneMesh.rotationX = -90;
backplaneMesh.rotationY = -90;
/*view.scene.addChild(backplaneMesh);
backplaneMesh.x = -90;*/
var sphereGeometry:SphereGeometry = new SphereGeometry(4);
var sphereMaterial:ColorMaterial = new ColorMaterial( 0xffffff );
lightmesh = new Mesh(sphereGeometry, sphereMaterial);
view.scene.addChild(lightmesh);
* Initialise the listeners
private function initListeners():void
addEventListener(Event.ENTER_FRAME, onEnterFrame);
//stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
//stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
stage.addEventListener(Event.RESIZE, onResize);
onResize();
* Navigation and render loop
private function onEnterFrame(event:Event):void
this.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
if (recording)
if ((getTimer() - recordingTime) > 4 * 1000)
StopRecording();
if (newmesh == null)
if (headMeshGeometry != null && hairMeshGeometry != null && eyelMeshGeometry != null && eyelMeshGeometry != null )
if (fileCount == 0)
InitMesh();
cameraController.panAngle = 90;
cameraController.tiltAngle = 2.5;
if (newmesh != null)
if (bootscreenBitmap.alpha > 0)
bootscreenBitmap.alpha -= 0.015;
else
bootscreenBitmap.alpha = 0;
logo.alpha = 1 - bootscreenBitmap.alpha;
sagalogo.alpha = 1 - bootscreenBitmap.alpha;
chatHistoryText.alpha = 1 - bootscreenBitmap.alpha;
_mytext.alpha = 1 - bootscreenBitmap.alpha;
microphoneButton.alpha = 1 - bootscreenBitmap.alpha;
if (lastblink == 0)
if (blinkdirection)
blinkAmount += 0.25;
if (blinkAmount > 1)
blinkAmount = 1;
blinkdirection = !blinkdirection;
else
blinkAmount -= 0.25;
if (blinkAmount < 0)
blinkAmount = 0;
blinkdirection = !blinkdirection;
lastblink = 100;
else
lastblink--;
if (animdirection)
animAmount += 0.20;
if (animAmount > maxAnimAmount)
animAmount = maxAnimAmount;
animdirection = !animdirection;
else
animAmount -= 0.20;
if (animAmount < 0)
animAmount = 0;
animdirection = !animdirection;
var r:int = (Math.random() * 6);
currentMorph = morphTarget_mouthopen;
if (speechPlaying)
currentScale = animAmount;
else
currentScale = 0;
//Apply the morph targets, first apply the base, then apply the blink and the mouth shape
morpher.ApplyBaseToMesh(newmesh);
if (lastblink == 0)
morpher.ApplyMorphTarget(newmesh, morphTarget_blink, blinkAmount);
if (currentMorph != null)
morpher.ApplyMorphTarget(newmesh, currentMorph,currentScale);
light.x = Math.sin(-180/*getTimer()/1000*/)*30;
light.y = 15;
light.z = Math.cos(-180/*getTimer()/1000*/)*30;
if (lightmesh != null)
lightmesh.position = light.position;
view.render();
* Listener function for asset complete event on loader
private function onAssetComplete(event:AssetEvent):void
if (event.asset.assetType == AssetType.MESH)
* Mouse down listener for navigation
private function onMouseDown(event:MouseEvent):void
lastPanAngle = cameraController.panAngle;
lastTiltAngle = cameraController.tiltAngle;
lastMouseX = stage.mouseX;
lastMouseY = stage.mouseY;
move = true;
stage.addEventListener(Event.MOUSE_LEAVE, onStageMouseLeave);
* Mouse up listener for navigation
private function onMouseUp(event:MouseEvent):void
move = false;
stage.removeEventListener(Event.MOUSE_LEAVE, onStageMouseLeave);
* Mouse stage leave listener for navigation
private function onStageMouseLeave(event:Event):void
move = false;
stage.removeEventListener(Event.MOUSE_LEAVE, onStageMouseLeave);
* stage listener for resize events
private function onResize(event:Event = null):void
view.width = stage.stageWidth;
view.height = stage.stageHeight; -
Placing controls on top of a background image
Hello folks:
Need a bit of help please. Need to be able to display a .gif image (800x600)as a background, with controls such as Labels and textboxes on top of the image. Is there away to do this with the various panes in Swing, and if so how, or is there a better way. If y'all have a bit of sample code to share it sure would be appreciated.
Thanks for the help and advise in advance - BartHere are two ways to do it:
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class TestBackground extends JFrame
ImageIcon img;
public TestBackground()
img = new ImageIcon("????.jpg");
JPanel panel = new JPanel()
public void paintComponent(Graphics g)
g.drawImage(img.getImage(), 0, 0, null);
super.paintComponent(g);
panel.setOpaque(false);
panel.add( new JButton( "Hello" ) );
setContentPane( panel );
public static void main(String [] args)
TestBackground frame = new TestBackground();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300, 300);
frame.setVisible(true);
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class TestBackgroundLayered extends JFrame
public TestBackgroundLayered()
ImageIcon image = new ImageIcon("????.jpg");
System.out.println(image.getImageLoadStatus());
System.out.println(image.getIconHeight());
JLabel background = new JLabel(image);
background.setBounds(0, 0, image.getIconWidth(), image.getIconHeight());
getLayeredPane().add(background, new Integer(Integer.MIN_VALUE));
JPanel panel = new JPanel();
panel.setOpaque(false);
panel.add( new JButton( "Hello" ) );
setContentPane( panel );
public static void main(String [] args)
TestBackgroundLayered frame = new TestBackgroundLayered();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300, 300);
frame.setVisible(true);
} -
How can I have the Time Machine animated wallpaper as my desktop background?
I really love the animated stars when you go in the time machine app. Is there a way to have this as your desktop background?
I've found and tested a few apps that do this (animated desktop pictures), but I really want the time machine animation.
I've also found an app that lets you use the old time machine animated picture, but I don't even nearly like it as much as the new one.
If anyone knows... please tell meOpen System Preferences (gear icon on the dock)
Open Users & Groups
Click the Login Items tab (next to the Password tab)
Click the + buttton at the bottom of the list
Use the Finder interface to locatet the Time Capsule drive and open it on the desktop
Click Add
Now the Time Capsule drive....named "Data", unless you have renamed it, will mounta and appear on the desktop when your Mac starts up.
Maybe you are looking for
-
Acrobat 9 Pro Vs Adobe Export PDF?
Hi I alredy have acrobat 9 Pro which I use to convert PDFs to Word. With the project I am currently working on, the results area bit of a mess and I have to do a lot of re-formatting; please advise if Adobe Export PDF has anything in it that is like
-
Events not showing time in iCal
I just lost my hard drive last week and now I'm re-entering everything. I'm trying to put my calendar events back into iCal and it no longer shows the time next to the event on the calendar. It used to say for example: "Dr. Appt-3:15" but now it only
-
Elements 11 will not download!
When I try to download Elements 11 this is the error message I receive You may not have everything you need to view certain sections of adobe.com. To address issues with your browser or media preferences see below: Please Use a Supported Browser Your
-
Log apply service in 10g dataguard
Very Good Morning to all ; I have a doubt when applying redo data at standby site. (MAXIMUM PERFORMANCE) In physical standby database , I know , Redo Data is applied from standby redo log (real time apply ) or archive redo log ( redo apply) 1)
-
How to attach a default master page to a aspx site page ?
Hi I make a aspx file in the sharepoint designer 2013, and I place a hyperlink inside the form. It do well Then I try to attach a master page. In the sharepoint designer menu I click at the style button, then click at the attach button and select the