ActionScript 2.0 :: Adding 'on(Press)' To An Image?
Dec 9, 2010adding 'on(Press)' to an image
View 5 Repliesadding 'on(Press)' to an image
View 5 RepliesI have a button on stage and when it is pressed I would like to add a movieclip in increments of one. For example if I press the button once I get "mc1", if I press it twice I get "mc2". Does anyone know what I'm doing wrong? Right now its just counting straight to 9.
Code:
private function more_text_ButtonPressed(event:MouseEvent) {
for (var i:Number = 0; i < 9; i++)
{
[code]....
I have 6 input texts on stage and I want to compare this to an array with the right answers, so far so good. The problem came when even if I put the right answer it considered it bad. After some hours and thanks to the debug, I managed to see that a line break was being added to the value of the input text only when I clicked on it to type, if I enter the input text by tapping the "tab" key, everything works just fine.The input texts are named r0 to r5, here is the comparison code:
ActionScript Code:
for(var i=0;i<respuestaCorrecta.length;i++)
{
trace('Answer: ' + eval('r'+i).text.toUpperCase() + ' Against: ' + respuestaCorrecta[i]);
if(respuestaCorrecta[i] == eval('r'+i).text.toUpperCase())
[code].....
I'm running flash cs4. I have an xml file I've loaded in but cs4 actually takes out the root nodes. So now I've been trying to add them back in when a button is pressed but I can't do it. I looked at creatElement and appendChild functions they seem to be what i need but I can't get them to work.
View 1 RepliesI have a image gallery but when I put the whole thing into its own new movieclip and THEN insert it on the main timeline it doesn't work. It only works when its scripted on the main timeline but I don't want it on the main timeline because I want my gallery to appear after I press my button.
View 9 RepliesI'm used to working with the timeline and don't often go into the actionscript side of things.
I've created a 60 second animation of an hourglass timer counting down, and next to it, is a card showing a word. I need this whole animation to play when you hit a 'start game' button and also I need the word on the card to be a random word. All of the words are saved as separate vector files for now.
What is the best way to manage this on the timeline, and what would be the code to make a random image appear?
I am trying to figure out if it is possible to click and hold an image loaded into the uiLoader?
What I would like to acchieve is an image gallery which loads a big sized image, but first it would resizes it, to the half of its original size and when the user would click on it, the image would zoom to 100%, and by holding the left mouse button he would be able to scroll the image (left, right, up or down).
Is this possible with a dynamically loaded image?
I need to create a gallery to load images and display them. This part is fine:
/**
* @variable image_name to store the name of the selected item
*/
private function showimage(evt:Event):void
[Code].....
where imgMain is the id the image component.
But, I need a small twist. A transition image i.e. loading image should be displayed while the the image is being loaded.
How do I move an image across the screen when I press a button and change its property.[code]...
View 3 RepliesHow can i make it so a when you press a button it starts a countdown but every other press dosent reset it?
View 14 RepliesI have a problem when I making a game Flash with action script 3,. I want tomake my character move when the key helding and I want my character attackwith one tab press either
View 3 RepliesI have text field which is 0 by default (score_txt)Two buttons +1 and -1 (plus_btn and minus_btn) When I press +1 text increases by one, and when i press -1 it decreses
View 4 RepliesI am not having much luck creating a link for an icon image on my site. What would be the easiest way to create a URL link to an image?
View 1 RepliesI have a simple website and use XML to add text content.To add an image I have been using the following code: Code:<IMG SRC="golf6.jpg" WIDTH="100" HEIGHT="80" BORDER="0">Is this the best way to add an image?The image is added but the text flows around it rather than starting a new line after it.
View 6 RepliesI am kind of new to flash and used a template to build a flash website. One of my pages has links on it that when you click them open a pop-up text box. I've looked at the actions of the link to try to figure out how to add an image but can't seem to figure it out. The actions of the link also reference a text file. The [URL] and it's the second page with the contacts (peoples names). Below is the actions from one of the links:
[Code]...
I am trying to build a simple preloader. I have 4 movieclips on stage and on each one I am adding an image that comes from an xml file:
theMap = new XML();
theMap.ignoreWhite = true;
theMap.onLoad = function(success){
if (success) {
theNodes = theMap.firstChild.childNodes;
[Code] .....
Everything works ok but as the jpgs are a bit heavy I'd like to preload them. Is that possible?
Been trying to crack adding images to a pdf using AlivePDF 0.1.4.9 for a week or two now. Creating the pdf and adding text was straight forward and easy to do. How ever adding an image has managed to illude us. I have included our code below. We have also tried the addImage() method without success as well. Our code builds perfectly but produces a blank pdf that opens and says An error has occurred on this page
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.DisplayObject;
[Code]....
I am trying to add a separate image in the background of a carousel...when a carousel image is clicked on, it moves back and the new image appears with it - but nothing loads in the new image. I thought this would be how to do it, but it's not working...what am I doing wrong? here is what it looks like so far: [URL]
[Code]....
Well yeah, I thought so as well. I mean I know the 'formula' by heart on how to add the link to an image (make it into a button, blah blah blah)
But for some reason when I do that, it doesn't work.
I want to add 5 links (lets say google.com) to the 5 images that are in a slider.
For some reason it gives me like... oh man.. so many errors
Here is the link, its about 500kbs, the link is located at the BOTTOM, RIGHT, CORNER: [URL]
I customize the file so that I can load multiple image folders for different set of sub-menu button.Right now, it is loading pictures from folder called "images"; I need to add more folders like images2, images3, and images4 that would play the same way as pictures from "images" folder.Where exactly do I need to alter the variable. I am not sure how it adds the other image folders
import mx.xpath.XPathAPI;
//banner
_root.banner = new Array();
[code].......
I am trying to achieve something like this: [URL]
I have successfully gone through and executed the Interactive Image Pan tutorial you have on here. However I am looking to add more of a sense of depth, so would like some images in the "foreground" to scroll by faster (than the background) as the cursor is moved.
To accomplish this I have made the foreground image cover a much bigger width than the background, as it makes sense to me that this would make it scroll faster, using the same code as the background.
So my question is what code do I need to add to the original code to make the foreground image scroll too? It's a MC called fg_mc. Here's the original code for quick reference:
Code:
this.onMouseMove = function() {
constrainedMove(bg_mc, 4, 1);
};
[Code]....
What I want to do is add a border on the image that I load into my scroll bar via XML on the rollover. So when I rollover the image a border appears around it. I created a movie clip of the just the border and I am having trouble getting it to appear on all my images when I rollover them. I am not sure how to fix this. How can I do this?
Code:
scrollBar_mc.visible = false;
var space:int = 10;//space between cells
var w:int = 47;//width of cell
[Code].....
I have a preloader on the first frame. It works great, with no problems and it's loading images from a directory. I would like to add to it an image counter, not only the bytes that are loading.
Actionscript Code:
stop();
// array of your movieclips$
mcs = ["page_1.jpg", "page_2.jpg", "page_3.jpg", "page_4.jpg", "page_5.jpg", "page_6.jpg", "page_7.jpg", "page_8.jpg", "page_9.jpg", "page_10.jpg", "page_11.jpg", "page_12.jpg", "page_13.jpg", "page_14.jpg", "page_15.jpg", "page_16.jpg", "page_17.jpg", "page_18.jpg", "page_19.jpg", "page_20.jpg",
[Code] .....
So, basically I would like to add another dynamic text box in which - as the images are loaded - I would like to have a counter for the images.
Am working on a simulation and am running into some trouble. I am attaching what I have so far. (I'm just in beginning stages so it's nothing fancy) What I still need to do is place the main image into the code using this code:
[Code]...
I've got a xml gallery. Now I want to add a link to a image but I don't know how to do this.This is my code:
portfolioInfo = new XML();
portfolioInfo.ignoreWhite = true;
timeline = this;
[code].....
I added an image background 1900 x 1200 in dreamweaver, which will serve as my background image for my web site. I would like to incorporate my .flv or .swf on top of my background image. Although, when doing so, the .flv or .swf gets placed under the background image and not on top. How do I place the .flv or .swf file on top of my background image in Dreamweaver CS5.
View 2 RepliesI have a problem with the TLF text alignment issue. The problem comes when am adding an image in the TLF text and some text in the text box after the image tag and setting the format tag to leftMargin.<TEXTFORMAT LEFTMARGIN = "20">Some text goes here< /TEXTFORMAT>. what am expecting is if i insert a image tag means it needs to come in the first column and text in the second column just like the normal textfield. For normal text the TEXTFORMAT tag is working perfectly for TLF its not working is there any chance to rectify the problem.
Below is the text what i have given in the Tlf textbox please check it with the normal text also tlf_txt.htmlText = '<img src = "[URL]" width = "10" height = "10" align = "texttop"/><TEXTFORMAT LEFTMARGIN = "20">Fonts should be embedded for any text that may be edited at runtime, other than text with the Use Device Fonts setting. Use the Text Font Embedding command to embed fonts.</TEXTFORMAT>'
I am going nuts! I have a canvas which I am trying to add a background image to. I am not setting the Y position, but after I add it to the canvas it always starts about 40 px down. If I trace the Y position it still says 0, even after a timer. I have tried to move it to the parent canvas and got the same results.
View 1 RepliesI am new to flex, and do not know how to add an image (or other ui component) to canvas, so user can select it (and see that it's selected), also I want to add a possibility for example to click backspace and remove selected image from scene. How to do that?
View 1 RepliesThe project I'm working on requires older libraries that extend mx components (such as TitleWindow and TabNavigator), I can't use what I know about Spark skinning directly. However, since the project is being programmed using the default Spark theme (with my modifications on top) rather than the Halo theme, I apparently don't have access to the styles I need (namely backgroundImage and contentBackgroundImage which apparently require Halo to be active). Simply setting Halo to be the theme will break other things, not the least of which my own theme.
Plans are in the works to replace the older libraries or at least patch them better to Flex 4, but as of right now, I need a way to style/skin these components without modifying them directly. It would be ridiculous to be unable to add a background image to a TitleWindow's content area! I've searched the internet high and low all day and tried countless variations of styles, skins, selectors, and combinations thereof with no luck. How to add a background image to the content of a mx TitleWindow while using the Flex 4.1 sdk?!