ActionScript 2.0 :: Duplicating Buttons Passing URL?

Dec 21, 2011

I want to display photos and load them dynamically.What I have is pretty basic .[URL]I have this much done and normally I would just manually add the URL to each button (boring and tedious) and I am learning to import variables and images and all of that...I want to be able to click the thumb to see the actual image:

Main Stage:

code:

onClipEvent(load){
_xscale=1000;
_yscale=1000;

[code]...

my problem is that I want to pass a value to the button based on 'i'

code: _root.mc_picGroup.mc_picGroupA["btnPic"+i].strURL = i;

Then the image name would be 0.jpg,1.jpg,2.jpg etc...I was displaying the images based on an MC

_root.mc_picGroup.mc_picGroupA["mc_picHolder"+i].gotoAndStop(i);

That worked but I thought it would be easier to place it in the button.(That didn't work...) I will just use the image mc but my real roblem is passing the value to the button.

code:

on (release){
getURL(strURL+".jpg","_blank");
trace(this._name);
}

returns "mc_picGroupA" instead of the button I am clicking.I know its ugly, but I just thought it would be a cool way to display some photos.[URL]

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Sound Duplicating On Passing As Parameter

Oct 1, 2011

Following my tiny project I experienced awkawrd behaviour of the sound object. Likely it is something wrong in my code though. I've got a DocumentClass where the sound loads in, and then starts, and have 2 Sliders, one responsible for actual position of the sound in time, and second VolumeSlider. I pass to both of them current Sound object and SoundChannel to the constructor and when I move my TimeSlider to scrub the sound I hear that second sound plays in the background (which is not scubbable). Moreover my VolumeSlider even if it passes a value to the sound.soundTransform and reapply it I didn't hear any change. My question is: can I have right soundChannel object referenced in other classes to change its parameters? From my point of view it is rhetorical question and any passed object has a reference to the main object, but as always I can be wrong.

Or maybe some of had similar issue in the past. Particularly I can instantiate my sliders in the same class as sound object to pass the value(already sliders are instantiated in mainPanel class which represents what the name suggest - main panel ^^just exactly like i.e. Winamp^^ )this way it should work ( I wouldn't have to pass sound object as a parameter to the sliders objects but retrieve slider's value to change the volume) From one point it is clear method as sliderVolume object shouldn't have an sound object inside, but from the point of my app it would be better to pass it though and manage inside the sliderVolume, timeSlider sliders.

View 2 Replies

Professional :: Duplicating Buttons Does Not Working?

Aug 4, 2011

ive made a simple button that sends you to the first frame. and its working good but than when i duplicate it only 1 button works i got 33 buttons and only one of them is working....

View 4 Replies

ActionScript 2.0 :: Duplicating The Array Of Buttons?

Apr 13, 2007

Working on my website navigation system with for loop and arrays. Here is the look right now top right nav working.Im trying to have the word links fade in white on mouseOver and fade to blue onpress. and fade back to normal when another button is pressed. any suggestions on how i should go about doing this?I was thinking of duplicating the arreay of buttons but have the mouse over fade in the white font array buttons on mouse over. But not sure if that would be a good idea or if it would work.

View 2 Replies

ActionScript 2.0 :: Create A List By Duplicating Buttons?

Jun 28, 2003

hey, i'm trying to create a list by duplicating buttons, and then when these buttons are clicked, they load a movie

so far here's my script in a frame
[AS]
text1 = "link1";
text2 = "link2";

[Code]...

however this doesn't work too well, the position of new buttons dont really go where they are supposed to go (which should be directly under each other). neither does the entering of the text in the new button work.

View 5 Replies

ActionScript 3.0 :: Passing Buttons Names To External .as File?

Jun 5, 2011

I am working on a project where I have on the stage 8 movie clips, and when hovered, they are to shake. I have made this into a class, and placed the code as an external .as file.

Each movie clip is named shaker_mc - shaker_mc7

I have also gone in and changed all of the button movie clips base classes to ShakeButton.

Right now I am getting a couple of errors, and I believe all i need to do is pass the buttons names to the class in the external .as file, but I am not sure how to do that? I had everything working without the external script, but I did not want to have to create the effect for each button.

The erros are:

1120: Access of undefined property shaker_mc.

Here is my code for the ShakeButton.as file

ActionScript Code:
package{ 
import flash.display.Sprite; 
import flash.events.MouseEvent; 

[Code]......

View 3 Replies

ActionScript 2.0 :: Buttons Lose Focus Passing Data

Jun 7, 2006

Very strange. I'm using the following function to pass characters to 2 text input components, but sometimes (and much more often with the "Password" field), after I click a button, the button loses focus and I have to move the mouse to regain the rollover state and be able to click the button again. When I've lost focus, if I click the mouse, it just changes the button to the rollover state but doesn't pass the value...

Here's the code:
var Focus:String = "";
function KeyPadButtonClick(_id:Number) {
// default the focus to the UserID
if (this.Focus == "") {
this.Focus = "UserID";
[Code] .....

View 3 Replies

IDE :: Duplicating Two Or More Mc?

May 19, 2009

I am tring to create a movie clip in which different coloured birds are flying..I am tring to duplicate two or more MovieClips at the same time..but only either of them WorksHow should I modify the code so that I can achieve that ?

PHP Code:
function birds() for(m=1; m<=10; m++) 
{firstEnem y= "bird"+1;

[code].....

View 2 Replies

ActionScript 2.0 :: CS3 Duplicating Multiple MC?

Jul 31, 2009

im having a problem duplicating more than 1 mc in my flash movie here's my code which is meant to duplicate it 1 time.

Code:
function createEnemy ()
{
i = i + 1;

[Code]....

View 2 Replies

ActionScript 2.0 :: Duplicating MC In Masklayer?

Nov 26, 2009

As the tittle suggests i have some trouble with Duplicating movieclips in a masklayer. The mask works but it wont duplicate. Also when i turn of the masklayer and use it as a normal layer the duplicate works perfectly. cant find any reason why it wont work.

View 0 Replies

ActionScript 3.0 :: AddChild Is Duplicating Itself

Jan 27, 2010

I am working on an Augmented Reality project .. This is the code that is called when the marker makes contact with the webcam.

[Code]...

Every time I remove the marker and put it back in view .. this script is called and is causing the action to duplicate itself over and over each time the marker is present. How can I do some sort of check to see if this is already added so that it wont duplicate ?

View 9 Replies

ActionScript 2.0 :: Duplicating MovieClip?

Feb 10, 2011

Here's the deal... I built a dynamic image gallery that runs hoizontally, and the idea is tu duplicate it and, when it reaches a certain point, use it's duplicate, so that there's the illussion of a "never ending" gallery.The problem is that, when duplicating the movieclip, it appears empty, even though I duplicate it after having loaded every picture.

View 8 Replies

ActionScript 2.0 :: Duplicating MC And Moving It?

Aug 12, 2004

i have a battlehsip that launches torpedoes. i want the gun of the battleship to aim (not perfectly but not way off so the gn can have 8 directions instead of every direction. [ignore this if u dont know what i mean]) the gun aims near the shark and launches a torpedo.i need the battlehsip turret to aim at the shark and duplicate torpedos and have the torpedos launched near the shark. and i need it to move toward the shark.

View 2 Replies

ActionScript 2.0 :: Duplicating MC's Trying To Use Function

Apr 13, 2003

I have two small dots (stars) that I want to duplicate. I have created a function-[ [code]I placed the function on a blankMC in the onClipevent (load) section. In the onClipEvent (enterFrame) I have placed a setinterval command [code]Now this waits 8 seconds and then creates a massive amount of duplicated stars - more than I want. I had just put the duplicate movie bit in a movie every couple of frames and that did what I wanted but I am trying to challenge myself and use functions and code.

View 2 Replies

ActionScript 2.0 :: Duplicating MCs (yet Another One) (MX2004)?

Apr 9, 2006

Whenever I make a code to duplicate anything in a reaction to an action, i get the problem of having my initial duplicated mc destroyed upon re-duplicating (you fire bullets and the one shot before the last always disappears and so).The thing is, if you take kirupa's "How to Fire"-tutorial, download the source and run it, the thing works like a charm. However, even if i copy every last single bit of code and content to a new document, the duplication process acts as described above.In addition, here's a quote from the tutorial "How to Fire" [url]

explain how on earth one would get "_level0.bullet" from something the likes of "trace(this._name)", which, of course, returns the instance name. Which would, in the aforementioned tutorial's case, be, in fact, "bullet". Not "_level0.bullet". He states "It's not the instance name"... Well, what the heck is it then? The result of the trace in question varies relying COMPLETELY upon the given instance name. If you write "Bratwurst" as the instance name, you get "Bratwurst" from the trace, as god is my wittness.

Even if i remove EVERYTHING from the code that even COULD, by the user's will, remove the duped mc, the initial problem remains. You can only fire one bullet at any given time, other(s) disappear.It's most propable that there's just something i've missed completely, and end up making myself looking like an ***, but still.For those who want a code, just take a look at the tutorial (the URL above). Everything's basically the same. I would also appreciate if someone were to try what i've described, which is to copy everything from the tutorial .fla and placing the stuff on a fresh document.

View 1 Replies

ActionScript 2.0 :: Creating And Duplicating MC?

May 2, 2006

I�m tring this AS to duplicate a MC on the main movie. This AS is on a loaded SWF. It�s not working but can�t find the reason.

Code:
duplicateMovieClip(_root.container, "container1", _root.getNextHighestDepth());
_root.container1.loadMovie("grupo01.swf");

View 2 Replies

ActionScript 2.0 :: Duplicating A 2d Array Into A New One?

Jun 18, 2007

but in a more complex way. I have an existing 2d array that I want to copy to a new 2d array (but the NEW array can vary in size!).

For example, my current 2d array with the data:

var old_array =
[[0,1,2,3,4],
[5,6,7,8,9],
[10,11,12,13]];

And I want the new array to contain the same data as the old_array, yet if the new array is larger, it will put a zero instead of 'undefined'...like this:

var new_array =
[[0,1,2,3,4,0,0],
[5,6,7,8,9,0,0],
[10,11,12,13,0,0],
[0,0,0,0,0,0,0]];

View 3 Replies

ActionScript 2.0 :: Duplicating Multiple MC's?

Jul 4, 2007

was going well but then i decided to make it so they appear at certain intervals using the amount of seconds elapsed.

Code:
var PreElapsedS=0;
dupCir = function(mc:MovieClip, interval:Number){

[code].....

View 2 Replies

IDE :: Movie - Duplicating A Section

Mar 22, 2009

[URL] if you go into my movie section. i want to add movies to my section if i copy for exemple Audi commercial. i'll have 2 that's great when it'S time to change the name like Audi to Marli it will affect the first one, the original section that i copy too. that's my problem. how can i copy a section to be indivudual. without affecting the first one. cause after that i can go and change everything.

View 1 Replies

ActionScript 2.0 :: Break Onto The Next Row After Duplicating

Nov 11, 2009

i've read some other threads about this but i can't seem to get them to work with my script..i'm trying to fill my stage with squares to make a visual grid, using setInterval so it shows them animating across row by row. so far i have this:

[Code]....

however i've tried adding in code to make it break onto the next row after duplicating 50 but can't seem to get it to work no matter what i do..

View 2 Replies

IDE :: Duplicating Items In Timeline?

Jan 6, 2010

when copying one timeline to another it keeps asking me to 'replace existing items'.When i do this it pastes 2 instances of the same item on my page + another random item.

View 1 Replies

IDE :: Duplicating Multiple Movieclips?

Apr 11, 2011

I am a newbie in flash Action script2can anyone please tell me that how can i duplicate a movieclip to as much numbers i want through out the stage using actionscript2. i have searched lots of posts in sites but i can't get it

View 1 Replies

ActionScript 2.0 :: SwapDepth Duplicating Movieclip?

Jan 12, 2009

I've developed a resource with drag and drop movieclips within a presentation.There are a huge number of drag and drop clips, so I've added a bit of swapDepth code so that the chosen movieclip is always in view. The problem now is that when I go to the next page (which contains a different drag and drop activity), a movieclip from the previous page is duplicated. Is there any solution to this? I've tried an onenterframe unload for the next page, but obviously this deletes the MC permanently making it fairly useless.

View 2 Replies

ActionScript 2.0 :: CS3 Duplicating Movieclips Outside The Stage?

Aug 9, 2009

i made this code that duplicates a movie clip randomly in the stage but i want it to be duplicated out of the stage.

View 1 Replies

ActionScript 3.0 :: Duplicating The Movie Clips?

Feb 2, 2010

i know i can duplicated a movie clip by using addChild:

Code:

var myMC:MovieClip = new blank_character;
this.addChild(myMC);
myMC.x = 200;
myMc.y = 200;
etc...

Im making somewhat of an online multiplayer game, it loops through an XML file full of character co-ords and names etc and creates movie clips and positions the characters on the screen accordingly.

The characters are pulled out from the library once, and then after that i want to access the movie clips within the characters.
for example, in the root timeline i have all the characters, inside the characters i have movie clips containing their clothing, names, etc, that i want to be able to edit.But im having troubles referencing the movie clips and doing this.

I've tried things like

Code:

var myMC:MovieClip = new blank_character;
this.addChild(myMC);
myMC.name = "character"+characterID;

[code]....

1119: Access of possibly undefined property clothing through a reference with static type flash.displayisplayObject.

View 7 Replies

ActionScript 2.0 :: Duplicating The Movie Clip?

May 15, 2010

in flash 8 im trying to duplicate movie clip - after clicking on button i am calling loadT function.

Code:

function loadT () {
xpos = 1;
ypos = 1;

[code]....

View 4 Replies

ActionScript :: Duplicating Objects In A Loop?

Dec 15, 2010

The follow code produces a strawberry image that falls from the top of the screen to the bottom. I tried using a for loop to create 10 different instances of this but it doesn't seem to work for me.(Note: ranx is a number produced randomly earlier in the program)

Code:
var nstrawberry:strawberry = new strawberry();
stage.addChild(nstrawberry);
nstrawberry.x = ranx;

[Code].....

View 2 Replies

Flash :: Button Bar Duplicating And Freezes

Jun 28, 2009

I created a button bar with 6 buttons that display separate content.  When I click on one of my buttons, it brings up the content alright, but on release creates an entire duplicate set of buttons on top of my existing set of buttons.  I can click on another button, and it will display content okay, but add yet another set of buttons on top of itself. after 2 buttons it basically freezes. why are my buttons in essence copying itself, and how can i correct.

View 6 Replies

ActionScript 3.0 :: Way Of Duplicating A Sprite Object

Feb 2, 2007

Does anyone know a way of duplicating a Sprite object.

View 9 Replies

ActionScript 2.0 :: Repeated Duplicating Of Various Items?

Feb 16, 2009

I would like to be able to click on various items within my movie clip, with each clip producing a new duplicate that can dragged around, independent of the original item or other duplicates.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved