ActionScript 2.0 :: Loading Images Accurately - Dynamic Button Rollover
May 4, 2006
As a test, I'm loading images (or references to images, more accurately) from an external XML file into Flash, each image representing where a thumbnail might appear in a portfolio, for example. I can get that to work fine. I have a couple of problems with the way the images appear, though. For one thing, when the 95 px X 95 px images are brought into the dynamically created 100 px X 100 px movieclips I have set for them, the JPGs stretch to fit... is this because I'm using the loadMovie method? The main difficulty I have, though, is my inability to get these individual movieclips containing JPG images to exhibit rollover and rollout behavior dynamically... without disturbing the image contained within.
Here's the code I have right now; my lame attempt at a dynamic rollover behavior is the for.. loop at the bottom, which is non-functional, by the way.
Code:
function loadXML(loaded) {
if (loaded) {
//according to "content2.xml," this would set the parser at "<projects>".
xmlNode = this.firstChild;
var thumbs:Array = new Array;
var description:Array = new Array;
[Code] .....
View 8 Replies
Similar Posts:
Dec 6, 2009
Odd, I thought this code should accomplish what I need what am I missing?
myBtn.addEventListener (MouseEvent.MOUSE_OVER, loadit);
function loadit (e:MouseEvent):void{myLdr.source = ("4girls_hbo.psd");}
View 3 Replies
May 10, 2006
i have a movie in which i have 50 thumbnails dynamically added to a mc and i have a scroller to scroll the mc which works fine.. on each thumb i have a rollover image (which is a bigger image of the thumb) which works fine but i want the rollover image to be shown within the area of mask area which is not happening now..
View 4 Replies
Dec 2, 2011
I know I can make an array if all the buttons would have a unified code executable change, i.e. they would become larger and brighter.
My problem is that each button represents an product image in the lights off stage, then of rollover it is a lights on stage so I have to import two images in the on and off stage and play around with the opacity.Additional problem is that each button has to ling to a different label.
My question is: is it possible to unify the code if buttons have that much individuality or I have to make each one of them as in the example below.
// makes a hand cursor appear over a mc acting as a button for all the buttons inside the scrollpnaeBckgrnd_mc.scrollpaneBckgrnd_btns_mc.
MovieClip(mc_pane2.content).scrollpaneBckgrnd_mc.scrollpaneBckgrnd_btn s_mc.buttonMode = true;
MovieClip(mc_pane2.content).scrollpaneBckgrnd_mc.scrollpaneBckgrnd_btn s_mc.useHandCursor = true;
[code]....
View 2 Replies
Mar 1, 2009
Whenever I am trying to do, the button rollover work, and put the dynamic text on top of it. The area outside the text is reacting to the rollover, but when I rollover on the text, I lost the rollover effect of the button under.The only way I have found to work around this, is to create another mc, invisible, on top and covering the button and create a script to activate the button rollover effect under... but is it the only way?
I don't have to do all this with static text, but the font react bad with rollovers or some other effects.
View 3 Replies
Mar 14, 2011
I'm trying to create reusable rollover button states with dynamic/changing text - any cleaver workaround for that?
View 1 Replies
Sep 25, 2010
I've got an issue - When one of my buttons is rolled over, I want text and a movieclip to appear. When the button is no longer rolled over, I want the text and movieclip to disappear. The way that I was going to do this was to have anchor_mc as an anchor, and upon rollover have the movieclip play from inside the anchor (as its at the exact X & Y that its needed at) and dynamic text appear.
[Code]...
View 10 Replies
Sep 25, 2010
When one of my buttons is rolled over, I want text and a movieclip to appear. When the button is no longer rolled over, I want the text and movieclip to disappear.The way that I was going to do this was to have anchor_mc as an anchor, and upon rollover have the movieclip play from inside the anchor (as its at the exact X & Y that its needed at) and dynamic text appear.
1) Is there an alternative way of doing the below, to avoid so many listeners?
2) Can the below functions be merged into one?I've tried merging them into one using IF statements, for example:
if(event.target.name == line1)
{
line_output.text = "This is a test made by the MonkeyTest that has previously messed up
And testing a new line";
gotoAndStop(2);
}
However this does not work, and gives an error.
3) I had to get the background to display by moving to the next frame. I could not work out how to get the textbox to appear at a specific XY, or how to get the textbox to disappear after a rollover. Is there a better way to do this, or is what I'm doing acceptable? (NOTE: Textbox is a Movieclip)
AS3 code is attached below.
Code:
import flash.events.MouseEvent;
stop();
[code]....
View 3 Replies
Mar 26, 2010
I'm currently working on a flashsite and are trying to figure out rollover menu buttons. The site has 6 menu buttons and are placed next to each other. I want to put a rollover action on the buttons, that when you rollover a button that the whole button image enlarges and moves in front of the other.
View 1 Replies
Jan 8, 2012
I have written the following to send variables to PHP which searches a MySQL database and returns the results in XML. However for the life of me I cannot get the XML data loaded into the Movie Clips of my Flash site.Is there an obvious problem that I've overlooked?
ActionScript Code:
var imageDir:String = "Images/";
var getImage:XML;
var imageList = new Array();
var newPic:MovieClip = new MovieClip();
[code]....
View 5 Replies
May 15, 2004
I have 3 movieClips on the stage. I want this to load images from urls that I have withdrawn from a php script that randomly selects from stored urls in the database. I want to load one of these into each movieclip. Here is the code that I have, but it doesn't work. (Btw, this is on a frame of the movie)
PHP Code:
loadText = new LoadVars();
loadText.load("generateQuiz.php?week="+_root.week);
loadText.onLoad = function() {
j = 1;
sortItOut();
[Code] .....
View 4 Replies
Aug 17, 2009
I have a project where I'm loading some HTML into an HTML-enabled dynamic textbox, along with some images, using the img tag. The problem I have is that no matter what I do, the text tries to flow down one side of the image (depending on whether I have the image set to align 'left' or 'right'). I don't want this. I want the text to sit under the image, not flow around the side. I've tried everything I can think of, and I just can't seem to achieve this.
View 3 Replies
Sep 26, 2010
I was just wondering what are the pros and cons of using embedded images instead of dynamic loading? Because when making games on pure AS3 (without Flash IDE), its a pain to manually embed all the assets needed... That makes your code sloppy, besides you don't have control to automatically change the hud, for example, by only changing the external file.
But I heard that some sites only let you upload a single swf, so you can't have external images. Also I heard that some are worried about users downloading their art... But as far as I know, they can also download them if they hack the swf with a decompiler. Having it external, you can encrypt the image, and unencrypt it on the code, so if they try to download they will only get encrypted code.
View 3 Replies
May 15, 2004
I have 3 movieClips on the stage. I want this to load images from urls that I have withdrawn from a php script that randomly selects from stored urls in the database. I want to load one of these into each movieclip. Here is the code that i have, but it doesn't work. (btw, this is on a frame of the movie)
PHP Code:
loadText = new LoadVars();
loadText.load("generateQuiz.php?week="+_root.week);
loadText.onLoad = function() {
[Code].....
View 4 Replies
Sep 3, 2010
I'm currently using this script which works perfectly.
ActionScript Code:
//LOAD IMAGES
var imageLoader:Loader;
function loadImage(url:String):void {
// Set properties on my Loader object
[Code]...
View 5 Replies
Oct 13, 2002
i know there been a lot of poasts on this but none of them. I am duplicating a movie clip called "thumb" on my main timeline. they are named by number (1 to 233) within each clip i would like to load an image
[Code]...
the reason i have put in 10.jpg is just to get it loading one image into all clips. But its not loading the image into any. the trace is bringin back each MC's name fine when i remove the if(_name != "thumb"){ it loads the image into the duplicated original MC so im completely confused. this is the duplication script on the first frame of my Main timeline
[Code]...
View 2 Replies
Jan 8, 2012
I have written the following to send variables to PHP which searches a MySQL database and returns the results in XML. However I cannot get the XML data loaded into the assigned Movie Clips. I think the problem might be somewhere in the URLLoader.
var imageDir:String = "Images/";
var getImage:XML;
var imageList = new Array();
var newPic:MovieClip = new MovieClip();
var thumbnailGroup:MovieClip = new MovieClip();
var loadGallery:String = "getImage.php";
[Code] .....
The remaining script (not included) handles the loaded data but is there an obvious problem I have overlooked in the above?
View 2 Replies
Oct 26, 2009
I am using a loader (Loader.loadBytes()) to load multiple jpeg images (motion jpeg)continually whenever a new jpeg image is ready. However, when the mouse is moving over the loader, it seems to repaint everything including the background and causes the flashing. Is there a way to prevent this from happening without using the double-buffer concept? Is there way to stop repainting the background?
Is the problem caused by the images loading or mouse over? When the mouse is not moving over the loader, everything looks fine. However, when only a image is loaded by the loader, I think the display won't be flashing even though you move the mouse over it.
View 0 Replies
Jan 18, 2010
Again some questions I feel a decent as3coder should know...I created a class to load image files. It works nice and all, but I have some questions... ok here goes ...This is my class :
ActionScript Code:
package {
import flash.display.Loader;
[code]......
View 1 Replies
Feb 8, 2007
Currently, I use loadmovie to load a jpg into a movieclip. However, when the jpg is loaded, I believe that the top left hand corner of the jpg is in the middle of the clip and does not line up with the top left hand corner of the clip.
How do I get the jpg to line up correctly?
View 3 Replies
Apr 11, 2005
I'm trying to create something that will load a bunch of images into an array and then be displayed whenever needed via using the attachMovie() function.
Code:
for (var i=1; i<list.length; i++) { //list is an array full of urls to images
_root.createEmptyMovieClip("img"+i,i);
loadMovie(list[i], "_root.img"+i);
}
I dont think this is what I want because I don't actually want the images to appear right here (this is the loading part). What I want is each image to be in a separate symbol with a unique identifier so that I can create them dynamically during runtime.
View 1 Replies
Jun 21, 2010
I want to rollover a button and have it trigger the rollover state of another button. The buttons overlap. The one on top is transparent and smaller than the bottom button. So far I think I have the AS3 to handle the rollover of the top button, but I don't know how to trigger the other button's rollover state.
[Code]....
View 4 Replies
May 25, 2009
I've constructed a dynamic slideshow using ActionScript 2.0 and PHP/MySQL. The reason for this, aside from update purposes, is that the slideshow will eventually display over 200 images. Thus, to save loading time and bandwidth, I decided to use PHP to pull ten images from an SQL database, formatting the output in XML. The slideshow itself works fine. Unfortunately, there are a couple of issues I need to address; my ActionScript is extremely rusty, so much of my work's patchy.
The code's displayed below:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var myShowXML = new XML();
myShowXML.ignoreWhite = true;
myShowXML.load("getData.php");
[Code] .....
The code in red is my main focus. It's the loop which loads all images as movie clips using the XML information from an array. The loop loads all of the images, making them transparent before the presentation begins. What I would like to do instead, to save loading time, is to load the next image while the current one is displaying. The function "moveSlide" controls the transition of the images, so I'd imaging it'd be best to plade it in there.
There's already an incremental variable being used, with _root.target_mc, for removing transparency from the current slide. The code in blue is also nagging me quite severely. I retrieve the next chain of slides by simply contacting the PHP script again. The only way I could think of doing that was to refresh the slideshow (this is done COMPLETELY in ActionScript, with nothing on the stage). Unfortunately, I could only work out how to reload the whole video.
View 1 Replies
Nov 16, 2009
I want an Object or symbol that is a button similar to what you would see on an iPhone home screen. That is, There is a base image (dynamic) that has some level of alpha masking or effects on top (highlights), a rounded corner mask, and a text label underneath (dynamic).
I have found many, many resources to make a dynamic text label, but making the image dynamic and applying the effects on top of the image.
View 0 Replies
Jul 26, 2009
I'm using actionscript 1.0 and 2.0 on flash Pro 8 and keep getting an error when I test the movie. Here is the error:
[Code]...
I've tried to create this rollover navigation...starting over 6 times already. Is there different language / coding for 1.0 and 2.0? I don't understand what I'm doing wrong.
View 1 Replies
Jul 28, 2004
The animation/rollover works well but it still abruptly stops when I rollover another button. The link below is an example on what I want to accomplish.
View 1 Replies
Apr 1, 2010
I have a main swf(let's call it 'main.swf'), and within this swf I have a container movieclip (instance name of 'projectloader_mc'), next to this 'projectloader_mc' I have two buttons 'next project' and the second 'previous project' lets give them instance names 'next_btn' and 'prev_btn'. The timeline of main.swf has some AS3 to tell projectloader_mc to load an external .swf, the first .swf being 'project1.swf'. This way on launch of main.swf the container automatically loads the project1.swf and gives users immediate access to this. Project1.swf contains some text and an image that links to a webpage URL using URLrequest etc.
There are going to be many other Project.swf files to load. lets call these Project2.swf, Project3.swf etc that have the same thing text and an image link inside.
Here is what I want to achieve, I want the user to be able to click on next_btn and load project2.swf in to the container, BUT I want to be able to say next time they click on next_btn it will load Project3.swf and so on. My problem is I am unsure how to dynamically change the URLrequest reference once the user clicks, so clicking to load project1.swf would load and say to next_btn also change to load project2.swf on the next clip. Previous has to do the same but backwards. It is almost like the next button and prev button need to know what mc is loaded in order to adjust the functions for loading the next or previous clip.
View 4 Replies
Sep 5, 2011
i need code for dynamic loading of swf file frm xml on button press in as2
View 8 Replies
May 17, 2010
I have an embedable widget. For each impression, I would like to track the referrer (the page where the widget is embedded onto). Right now I am using ExternalInterface to use javascript to check window.location.href when its available, however, I am finding that most of the time I am unable to set the referrer.
I not using javascript correctly to get the referrer?
View 1 Replies
Mar 14, 2010
How to match substrings accurately?eg: I wanted to search whether any pronouns like he, she etc are present in a string say input.Where is he?Here I wanted to find whether the pronoun 'he' is present. But since the where contains the substring 'he' I can't get the result properly.I tried with RegExp and arrays and strings; using match(), search() indexOf(). They all do it the same way.My RegExp pattern is as below:
Code:
var pronouns:RegExp = /(i)|(me)|(us)|(he)|(him)|(she)|(her)|(it)|(they)|(them)|(that)/;
I wanted to find for eg, strings like
He is alright
Where is he
She is there
Who is it
I know them
In the above sentences I wanted to get the position of where the pronouns 'he' 'she' 'it' 'them' etc occurs.Why because if it occurs I wanted it to replace them with another words.
View 3 Replies