[F8] Att. Button.Onrelease And Imageholder Function To Thumbs
hello, and thanks so much for your time, Iam pretty new to this AS, but I have a little something...
I have tried Lee's tutorial on the scrolling thumbnail panel and it works great, but now I was wondering... I created McImageHolder functions, (4 total) and some textBoxes, that are being executed by the ButtonOnRelease function.
They used to work before, but that was when the thumbs where rolling in the document by themself by this command
code: onClipEvent (enterFrame) {
_root.movePiece(this)
}
My question is can I still use the ImageHolder functions with the new scroll panel? And how do I do that?
this is the code I use for the ImageHolder functions, I just name the instances Button01 to execute the code (normally)
code:
// main display picture 424 x 361
_root.createEmptyMovieClip("mcImageHolder",1);
mcImageHolder._x = 334;
mcImageHolder._y = 1;
// zoom detail picture 149 x 170
_root.createEmptyMovieClip("mcImageHolder2",2);
mcImageHolder2._x = 176;
mcImageHolder2._y = 213;
// related picture
_root.createEmptyMovieClip("mcImageHolder3",3);
mcImageHolder3._x = 176;
mcImageHolder3._y = 65;
// related picture 149 x 55
_root.createEmptyMovieClip("mcImageHolder4",4);
mcImageHolder4._x = 176;
mcImageHolder4._y = 1;
// button code
// North
Button09.onRelease = function() {
mcImageHolder.loadMovie("images/pieces/logo09.gif")
mcImageHolder2.loadMovie("images/pieces/logo09_d.gif")
mcImageHolder3.loadMovie("images/pieces/logo06_2.gif")
mcImageHolder4.loadMovie("images/pieces/logo06_1.gif")
textBox_client.text = "North"
textBox_year.text = "2006"
textBox_descr.text = "blahblahblah"
textBox_specs.text = "slice of orange represents summer"
textBox_uses.text = "flyers, registration forms, web"
textBox_progs.text = "Adobe Illustrator CS2"
;
}
and ofcourse there's code for the other 8 buttons too, but it's pretty much the same...
I hope someone is willing to help, I have been stuck with this for a few days now, but I can't find anything that would help me out, or am looking on the wrong spots.
Thanks!
FlashKit > Flash Help > Flash ActionScript
Posted on: 01-11-2007, 04:00 PM
View Complete Forum Thread with Replies
Sponsored Links:
OnRelease Function Targeting Button In Mc
I have a few buttons in a movie clip (remote_mc) on the first frame of the mc.
I have one button on the second frame of the mc (remote_mc)
From the maintimeline first frame I use this
remote_mc.mybutton.onRelease = function() {
//some code here
}
This works on the buttons in the first frame.
When I send movie clip to second frame and click button the function for that button does not work.
How do I target buttons in a movie clip (not on frame 1) from a function on main timeline.
Thanks
View Replies !
View Related
Button.onRelease=function ... Weird Feature
check this code out:
Code:
var i = 0;
this.attachMovie("button", "b1", 1); // first button
this["b1"]._x = 100; // put it somewhere
this["b1"].onRelease = function () {
trace(i);
}
i++;
this.attachMovie("button", "b2", 2);// second button
this["b1"]._x = 200; // put it somewhere else
this["b2"].onRelease = function () {
trace(i);
}
Usually, you would suppose that the two buttons get different actions... but both get the same value of i in the end.
Any workarounds, anybody?
View Replies !
View Related
Calling An OnRelease Function WITHOUT Pressing The Mouse Button
Long time reader, first time poster. I love Kirupa... it has been so helpful to me in the past.
Here is my question. Can I call an onRelease function without actually pressing the mouse button?
I have built an onRelease prototype function for one of my movieclips, for use when a user clicks on that movieclip. All of that works fine, BUT I would like to call the first one after the movie loads. Can I just do this:
ActionScript Code:
subm0_0.onRelease();
I did it in frame 2 of my movie (after the preloader does its thing), but it doesnt seem to be working. "subm0_0" is the name of the movie clip that has the prototype function. Again, when I click on the movieclip it works.
Thanks in advance!
View Replies !
View Related
Calling An OnRelease Function WITHOUT Pressing The Mouse Button
Long time reader, first time poster. I love Kirupa... it has been so helpful to me in the past.
Here is my question. Can I call an onRelease function without actually pressing the mouse button?
I have built an onRelease prototype function for one of my movieclips, for use when a user clicks on that movieclip. All of that works fine, BUT I would like to call the first one after the movie loads. Can I just do this:
ActionScript Code:
subm0_0.onRelease();
I did it in frame 2 of my movie (after the preloader does its thing), but it doesnt seem to be working. "subm0_0" is the name of the movie clip that has the prototype function. Again, when I click on the movieclip it works.
Thanks in advance!
View Replies !
View Related
Button With 2 Functions? Onrelease=true, Onrelease=false
I have a button that uses a function to set the visibility of an mc. BUT it's called with an 'onrelease' and I would like the button to change the visibilty back to false on the next onrelease. Understand?
Here's my code:
list_btn.onrelease = function() {
playlist._visible = true;
}
Now I want to press the same button and have the mc (playlist) go back to false. I tried using some 'if' statements but just couldn't seem to get it right. My brain is just not working today.
Need some help please!
View Replies !
View Related
V3 With Thumbs Scrolled Photo Gallery With 80x80 Not 40x40 Thumbs Problem
Hi I've been testing out the V3 with thumbs scrolled .fla from this topic
http://www.kirupa.com/forum/showthre...rolling+thumbs
well basically i've been trying to modify it to accept images for the thumbs as 80x80 not 40x40 no matter how much modding i try to do (and i'm crap at actionscript verymuch a newbie) i can only stretch all the 40x40 images and the 80x80 images are oversized for the buttons?
should i be testing all the images as 80x80 or is there something i'm missing (all the images will be 80x80 in the end)
Cheers guys for any suggestions
View Replies !
View Related
XML Photo Gallery W/Thumbs - Code For Loading SWFs Instead Of JPGs For Thumbs?
Hi, all,
I'm using Flash CS3 and have built a slide show using the excellent XML Photo Gallery tutorial, as well as adding sound thanks to another post in this forum. It's all working like a charm. The only bad thing is: I want to place .swfs files where the dynamic text is right now, and can't figure out how to do it.
What I really want is one large image/JPG on each slide, and below that, instead of the dynamic text shown in the tutorial example, a smaller .swf file should appear. (For this project, the text itself needs to be animated, and I can't do that with the <caption>/dynamic text option; I need to insert an SWF.) I'd really like to do this using XML since that's working so nicely otherwise.
Can anyone provide me with the actionscript code to use in the context of this photo gallery? I'm not advanced enough yet to know where or how to place code that doesn't fall into this gallery/AS format.
(I'm not being lazy: I have looked all over these forums for hours, read through about 60 pages of tutorials, went through the whole XML Photo Gallery with Thumbnails hoping I could somehow alter that to meet this project's needs... no dice. I had gotten far enough in that tutorial to be able to insert an empty movie clip where I want it, but could only figure out how to fill it with JPGs from the XML, not SWFs... and in any case the images did not then work correctly while advancing the slides.)
Here is my current Actionscripit code:
************************************************** *****
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
audio = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
audio[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("infant_images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.SPACE) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = false;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
sound = new Sound();
sound.loadSound(audio[p],true)
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
sound = new Sound();
sound.loadSound(audio[p],true);
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
sound = new Sound();
sound.loadSound(audio[0],true)
}
}
function loadSound() {
if (loaded == filesize) {
createEmptyMovieClip("sound_mc",2);
sound_mc.sound_obj = new Sound();
sound_mc.sound_obj.loadSound( sound[p], true);
sound_mc.sound_obj.play();
}
}
************************************************** *****
(It's not showing the preloader and is missing the counter AS on purpose; I don't need those items for this project...)
Thank you for any help you can give!!
View Replies !
View Related
Centering Content In An Imageholder
I'm using the following code for a picture viewing loading external pictures using xml.
_root.createEmptyMovieClip("mcImageHolder",1);
mcImageHolder._x = 10;
mcImageHolder._y = 40;
is it possible to center the pictures in the placeholder instead of using x and y values??
View Replies !
View Related
BlendMode Not Working On The Imageholder MC
I have a blank mc (instance=picture) servers as image holder to load images from a .xml file.
The images being pull into the image holder are mostly got white background while my stage is slight green so I'd like to apply the "screen" blendMode so they look blended right. For some reason I can't get it to work...
been googling on blendMode but no luck getting the right solution. anyone? much appreciated!
Attach Code
picture.loadMovie(image[p], 1);
picture.blendMode = "screen";
Edited: 06/12/2008 at 02:11:32 PM by ibrubru
View Replies !
View Related
Thumbnails Don't Fit In Imageholder [renamed]
For anyone out there. This might be a lame *** question but I am trying to bring in an external swf inside a mc. The external swf is a image viewer or photo gallery. It works. My problem is that my thumbnails from the external swf will not fit into my imageHolder_mc box that I want it to.
Any pointers would be great cuz I am out of ideas. I am using AS 2.0 and Flash 8 if that helps at all.
Thanks
View Replies !
View Related
[F8] OnRelease = Function()
hi can someone point me in the right direction
//create multilevel array
select_lv.onLoad = function(Boolean) {
num = parseInt(this.n);
// create vars from array
for (var i:Number=0; i < num; i++) {
Info.push({id:this["id"+i],itemname:this["itemname"+i],quantity:this["quantity"+i],totalcost:this["totalcost"+i] });
//display part of the array
itemname.text = Info[1].itemname;
//display quantity and cost from array
//price.text = Info[1].quantity+ " | " +Info[1].totalcost;
price.text = Info[1].totalcost;
object_image.onRelease = function() {
total.text = Info[1].totalcost;
}
// load image from category txt value into Mc object_image
sel_item = _root.itemname.getValue()
loadMovie(imgpath + sel_item + ".jpg","object_image")
//trace variable to output window
//trace (select_lv);
}
}
// load all from db
select_lv.sendAndLoad(filepath + "Selectwine.php", select_lv, "GET");
the red area is where the problem is, for some reason when the jpg is loaded into the movieclip object_image i cannot seem to use it as a button, which is what i want to achieve, the cursor does not even react to a rollover...
i can add code to the movieclip and it works however i would like to keep all the code in one place, all content is on the main timeline and i can trace the var into another text field.....grrr
thanks in advance
View Replies !
View Related
OnRelease Function
I have set up a number of loader objects and set up locations of the images I want to load and link urls I want assigned to each image using loops like this:
for (var j = 1; j<url_XML.firstChild.childNodes.length/2+1; j++) {
images[j]=this.createClassObject(mx.controls.Loader, "myLoader"+j, j);
images[j].scaleContent = false;
}
for (var i=0; i<url_XML.firstChild.childNodes.length; i++) {
if (i < url_XML.firstChild.childNodes.length/2) {
urls = url_XML.firstChild.childNodes.childNodes;
}
else {
links[i-(url_XML.firstChild.childNodes.length/2)] = url_XML.firstChild.childNodes.childNodes;
}
}
This worked great, and then I used a loop to assign each image to the page like this:
for (var i=0; i<urls.length; i++) {
images[i+1].contentPath = urls;
images[i+1]._x = i*320;
images[i+1]._y = 0;
}
This also worked great, but when I used the following loop to set up a link url for each image, the link does not work:
for (k=0; k<links.length; k++) {
images[k+1].onRelease = function() {
getUrl(links[k]);}
}
}
When I just used this it worked fine for the one function:
var k = 0;
images[k+1].onRelease = function() {
getUrl(links[k]);}
But I can not get the loop to work so I actually create all functions. Any ideas what I'm doing wrong and what I can do to make it work? Thanks for any help!
Bob
I have since figured this out. This is what I used, and it works fine:
for (var i=0; i<links.length; i++) {
images[i+1].iVar = i;
images[i+1].onRelease = function() {
getUrl(links[this.iVar]);}
}
Thanks!
Edited: 07/31/2008 at 11:04:07 AM by BobMelnyk
View Replies !
View Related
OnRelease = Function
i know that there is another way to write this code, a short way... can some one help me out?
ActionScript Code:
subMenu01_btn.onRollOver = function() { over(subMenu01_btn);};
thx
.am
View Replies !
View Related
[f8] OnRelease = Function Help
Hi All,
I can't seem to figure out how to get this to work when I place the button into an MC.. Would it be ._parent.? this didn't work either..
It's 3 MC's off the _root. the buttons work great when they are on the main root.
Code:
this.onRelease = function(){
if (_root.currMovie == undefined) {
_root.currMovie = "about";
container.loadMovie("about.swf");
} else if (_root.currMovie != "about.swf") {
if (container._currentframe>= container.midframe) {
_root.currMovie = "about";
container.play();
}
}
}
View Replies !
View Related
This.onRelease = Function()
Okay, I've got an MC on my stage that has the following script on the first frame of it's timeline:
ActionScript Code:
stop();
if (_root.zoomTool == 1) {
this.onRelease = function() {
_root.gotoAndPlay("zoom");
};
}
This runs great. What I want to do is after this plays, I want this to be disabled. I've tried writing the following script but it doesn't seem to work:
ActionScript Code:
stop();
if (_root.zoomTool == 1) {
this.onRelease = function() {
_root.gotoAndPlay("zoom");
};
}
_root.zoomTool = 2;
I would have thought that this would stop the if from being active since now "zoomTool" isn't equal to 1. But no, it still runs. I even tried putting in an "else" into this if statement but I couldn't get it to work...flash kept telling me that I had errors in my script even though I couldn't find any. I'll post that just to see if anyone can tell me what's wrong with it:
ActionScript Code:
stop();
if (_root.zoomTool == 1) {
this.onRelease = function() {
_root.gotoAndPlay("zoom");
} else {
trace (_root.zoomTool);
};
}
Then in a frame in _root after it plays the "zoom" label, I put the "_root.zoomTool = 2;" script. I put the trace in my if statement hoping that my output window would put a 2 in it...which to me looked like it would happen. But no, the if statement kept playing as if zoomTool was still equal to 1.
I'm thinking that when I use the script "this.onRelease = function()..." that it is then assigned throughout the clip. Is this so? If so, how can I disable it after it's played through once?
Thanks for the help in advance!
View Replies !
View Related
OnRelease = Function() - Levels
I can't this to work:
_level20.button1_mc.onRelease = function() {
play();
};
I don't get the the hand cursor. "interface.swf" is definately in level 20 and loads (I see the graphics). MC, instance name, "button1_mc" is on level 20's root. Yet, I rollover it...nothin'. But this works in a swf without using levels.
??
Thanks,
rez
View Replies !
View Related
Call An OnRelease Function
is there any way to call this same function from a button on a different level in as2? i want 2 different buttons to do the same thing, only they are on different levels, is this possible? if so how?
tyia =D
gbtn.onRelease = function() {
whichFrame = "garrett";
gbtn._x = 430;
profiles.gotoAndPlay("play");
garrettBox.onEnterFrame = function() {
this._x = 430-(430-Math.ceil(this._x))/1.1;
};
};
View Replies !
View Related
[F8] OnRelease = Function () Question Please Help
Hi,
I am using attachMovie to place some movie clips on the stage. I want to create an onRelease function for them.
If I specify the exact path of the movie clip, then it works. E.g.
box_g10.button_g.onRelease = function () {
trace ("onRelease called")
}
But if I define variables such as:
var boxname_g = 'box_g'+a
var mybutton_g = boxname_g+'.button_g'
so one instance of mybutton_g now equals 'box_g10.button_g'
and then use:
mybutton_g.onRelease = function () {
trace ("onRelease called")
}
It doesn't work. Perhaps it's looking for a movie clip called mybutton_g insead of the contents on the variable...
Any help would be greatly appreciated!
Thanks,
Rik
View Replies !
View Related
[F8] Onrelease Function Problems
i Have a slider to control volume and it works almost perfectly except that if i mouse out of the slider MC and then release my mouse button flash doesn't seem to recognize this and i can still affect the slider by moving my mouse around even though i am no longer holding the mouse button.
the code that i have is on the first frame of my swf and is basically
Code:
tool.button.slider.volslide.onRelease = stopslider;
//stopslider function
function stopslider() {
tool.button.slider.volslide.stopDrag();
}
This code works as long as i don't mouse out of volslide before i release my mouse button but if i do then i get problems. Any solutions would be greatly appreciated.
Thank you
View Replies !
View Related
Programmatically Run An OnRelease Function
Hi all.
I have the following code
PHP Code:
_root["pin"+i].onRelease = function() {
trace(i)
}
Which is in a loop where i is incremental.
What I want is at the end of the loop to randomly choose a number and then run the on release function somthing like
_root["pin"+rndNumber].onRelease = true
Is there a way. The real function can not be made into a standalone function so needs to be in the loop
View Replies !
View Related
[F8] OnRelease Like Function Within Loops?
Hello!
I need to run an mc.onRelease function for several mcs and it isn't always the same number of mcs, so I'm trying to get how to get it done. Obviously, the following code won't work just thrown on the main frame.
Code:
for (n=1; n<maxmc; n++) {
_root["mc"+n].onRelease = function() {
trace(_root["mc"+n]+" released");
};
}
but the thing is it won't work right on an onEnterFrame function neither.
I'm kind of lost, can anyone help me?
Thanks!
View Replies !
View Related
OnRelease Function Is Not Working
var moviename = "movie_mc" + j;
var movielevel = 1+j;
_root.createEmptyMovieClip(movie_mc, movielevel);
loadMovie("images/" + thumbnail + ".jpg", movie_mc);
_root[movie_mc].onRelease = function(){
trace("sd");
};
The image is loading in the movie and working properlly.But in case of onRelease function it is not working . Pls help the red line is not working.
View Replies !
View Related
OnRelease = Function () Question
Hi,
I am using attachMovie to place some movie clips on the stage. I want to create an onRelease function for them.
If I specify the exact path of the movie clip, then it works. E.g.
box_g10.button_g.onRelease = function () {
trace ("onRelease called")
}
But if I define variables such as:
var boxname_g = 'box_g'+a
var mybutton_g = boxname_g+'.button_g'
so one instance of mybutton_g now equals 'box_g10.button_g'
and then use:
mybutton_g.onRelease = function () {
trace ("onRelease called")
}
It doesn't work. Perhaps it's looking for a movie clip called mybutton_g insead of the contents on the variable...
Any help would be greatly appreciated!
Thanks,
Rik
View Replies !
View Related
OnRelease Function Not Working
Hi everyone,
I have a movieclip on the main timeline called "WebMonitor_mc". Inside this clip is a button called "close_btn". On the first frame of the main timeline I have the following code:
WebMonitor_mc.close_btn.onRelease = function () {
webMonitor_mc._visible = false;
}
I'm trying to get "close_btn" to make "webMonitor_mc" to become invisible, but the code doesn't seem to work. The hand cursor appears when you roll over "close_btn" but when you press and release the other clip doesn't become invisible.
Am I targetting things incorrectly? Could someone tell me what I might be doing wrong?
Thanks for any help offered.
View Replies !
View Related
My OnRelease Function Not Working
I am trying to get the text value of my movieclip using the onRelease method. If I trace("btn_works") I get "btn_works" in the edit window, but I am unable to retrieve the text value of the button. What am I doing wrong?
Code:
for (i=0; i<5; i++) {
_root.attachMovie("VideoText", "video_mc"+i, 60+i);
_root["video_mc"+i].v_text.html = true;
_root["video_mc"+i].v_text.htmlText = "<font face='Arial' size='12' color='#000000'><u>"+this["video"+i]+"<b></font>";
//trace(_root["video_mc"+i].v_text.text);
_root["video_mc"+i]._x = 600;
_root["video_mc"+i]._y = 250+(i*20);
_root["video_mc"+i].onRelease = function() {
//trace("btn_works")
trace(_root["video_mc"+i].v_text.text);
};
}
View Replies !
View Related
Problems With OnRelease Function
I am relatively new to actionscripting, I don't know what I've done wrong, and I'm not getting errors. HELP!
I have been working on this problem for 3 days now, with no luck. I really need help. I am trying to set up my website. I have the company logos at the top of the page, both are acting as buttons to the home page. Then I have, 6 other buttons: about_us, our_work, our_offices, in_development, PRESS, and contact_us. This is the way I've labeled the slides inside my flash presentation, and how I labeled the mc to correspond to the slides for easier scripting. Since I'm new, I am wondering two things, first am I scripting this the long way? Two I am having issues with connecting my buttons onRelease to slides, and a minor glitch with my pointer between the mc buttons and the Logo buttons.
Here is the code
Attach Code
on (load) {
import mx.transitions.*;
import mx.transitions.easing.*;
lastTarget = "home"
this.btnLogo.onRollOver = function() {
mcLogo.gotoAndPlay("_over");
};
this.btnLogo.onRollOut = function() {
mcLogo.gotoAndPlay("_out");
};
this.btnLumtype.onRollOver = function() {
mcLuminairtype.gotoAndPlay("_over");
};
this.btnLumtype.onRollOut = function() {
mcLuminairtype.gotoAndPlay("_out");
};
this.about_us.onRollOver = function() {
about_us.gotoAndStop("_over");
};
this.about_us.onRollOut = function() {
about_us.gotoAndStop("_out");
};
this.our_work.onRollOver = function() {
our_work.gotoAndStop("_over");
};
this.our_work.onRollOut = function() {
our_work.gotoAndStop("_out");
};
this.our_offices.onRollOver = function() {
our_offices.gotoAndStop("_over");
};
this.our_offices.onRollOut = function() {
our_offices.gotoAndStop("_out");
};
//In Development Rollover animation
this.in_development.onRollOver = function() {
in_development.gotoAndStop("_over");
};
//In Development Rollout animation
this.in_development.onRollOut = function() {
in_development.gotoAndStop("_out");
};
//Press Rollover animation
this.PRESS.onRollOver = function() {
PRESS.gotoAndStop("_over");
};
//Press Rollout animation
this.PRESS.onRollOut = function() {
PRESS.gotoAndStop("_out");
};
//Press Rollover animation
this.contact_us.onRollOver = function() {
contact_us.gotoAndStop("_over");
};
//Press Rollout animation
this.contact_us.onRollOut = function() {
contact_us.gotoAndStop("_out");
};
btnLogo.onRelease = btnLumtype.onRelease = function() {
this._parent._parent.pages.gotoSlide(this._parent. _parent.pages[this._name]);
var pointertween:Tween = new Tween(this._parent.mcPointer, "_x", Strong.easeOut, this._parent[lastTarget]._x, this._parent["home"]._x, 1, true);
lastTarget = this.name;
};
home.onRelease = about_us.onRelease = our_work.onRelease = our_offices.onRelease = in_development.onRelease = PRESS.onRelease = contact_us.onRelease = function() {
this._parent._parent.pages.gotoSlide(this._parent. _parent.pages[this._name]);
var pointertween:Tween = new Tween(this._parent.mcPointer, "_x", Strong.easeOut, this._parent[lastTarget]._x, this._x, 1, true);
lastTarget = this._name;
};
}
View Replies !
View Related
How To Define This Function Without OnRelease?
I need the following script to run as soon the as the play head comes on the frame. Right now it is activated through an onRelease...need to replace that:
myButton_btn.onRelease = function() {
tweenBall(mx.transitions.easing.Strong.easeOut);
};
function tweenBall(easeType) {
var begin = -50;
var end = 100;
var time = 20;
var mc = ball_mc;
ballTween = new mx.transitions.Tween(mc, "_y", easeType, begin, end, time);
}
View Replies !
View Related
#include For OnRelease() Like This Or Function?
hello
im trying to make this code below as modular as possible.
I would like to edit in only one place if possible, as opposed to every button.
any ideas would be greatly appreciated
ActionScript Code:
onClipEvent (mouseUp) { this.onRelease = function() { _parent._parent.bg_pic_linkage = "im6"; url_target = "swfs/contact.swf"; _parent.whichSection = "contact"; /* can this bit below be #include 'd */ if (_parent._parent.currMovie != _parent._parent.bg_pic_linkage) { if (_parent._parent.bg._currentframe == _parent._parent.bg.midframe) { _parent._parent.currMovie = _parent._parent.bg_pic_linkage; _parent._parent.bg.play(); loadMovie(url_target, _parent._parent.content_mc); _parent.play(); } } };}
View Replies !
View Related
How Do I Add A 'onRelease' Function To Loaded Mc's
Hi! Could anyone take a look at my code. It only displays a square.
Code:
testClass = new Object();
testClass.childClass = new Object();
function doTest() {
_root.attachMovie("empty_mc", "container", 0);
testClass.test = _root.container;
// Hmm.. Am I right on this? If I were to write code in Java equivalent to this, would that code be like:
// obj_name = new testClass.childClass()
testClass["obj_name"] = new testClass["childClass"]();
// But the thing is that, the testClass object holds the newly created "obj_name" in it. Am I right?
// Just attaches it to _root. Voila! It shows on the stage.
testClass.test.attachMovie("square_mc", testClass["obj_name"], 1);
}
doTest();
How can I add an 'onRelease' function to the childClass?
I tried this:
Code:
testClass.childClass.onRelease = function() {
trace("onRelease called");
}
Doesn't work...
Help please?
View Replies !
View Related
OnRelease Stop Function? Help
Hey guys, i have a pressing issue here was wondering if anyone could help me with.
I have a small movie that basically is a mask that when you click on it it follows the mouse to reveal the other image under it. I dont want a circle bit of a mask, i want the mask to be 1/2 the stage size and only scroll on the x plane. I have this setup and working more less except for the fact i cant "uncall" (yes i just made that up) the function. heres my code
ActionScript Code:
var speed = 5;MovieClip.prototype.follow = function() { this.onEnterFrame = function() { this._x += (_root._xmouse-this._x)/speed; if (Math.abs(_root._xmouse-this._x)<1 && Math.abs(_root._ymouse-this._y)<1) { delete this.onEnterFrame; } };};//drag the maskmask.onPress = function() { mask.follow();};
as you can see the mask when pressed gets the follow function attatched, but i cant get it to stop moving when you release. I have tried all manners of onRelease to no avail...what can i do?
I would use the startDrag function but i love the easing (and i dont know how to constrain start/stopDrag to the X axis)
Any help would be great!
Thanks
--][--
View Replies !
View Related
OnRelease Call Function
Hello,
i using createTextField e createEmptyMovieClip to create itens to my menu. this is a function.
how can i do this itens disappears and call another function onRelease one of this itens?
thanks
View Replies !
View Related
OnRelease > Swap Function?
Hello,
I have a rollOver / rollOut state on a MC. Is there an easy way to stop its rollOut state after it has been 'released'?
Code:
myMC.onRollOver = function(){ plonk;}
myMc.onRollOut = function(){ plink;)
myMc.onRelease = function(){
myMc.disable.onRollOut(); //???
}
Any ideas?
Thanks!!
View Replies !
View Related
OnRelease Function With Parameter?
I don't quite understand why this doesn't work:
ActionScript Code:
listContainer.next.onRelease = advance(1);listContainer.prev.onRelease = advance(-1);function advance(d){ // function stuff in here trace("advance function called");}
I know I can reference a function onRelease without any parameters no problem, but what if I want to pass a parameter to the function?
View Replies !
View Related
How To Define This Function Without OnRelease?
I need the following script to run as soon the as the play head comes on the frame. Right now it is activated through an onRelease...need to replace that:
myButton_btn.onRelease = function() {
tweenBall(mx.transitions.easing.Strong.easeOut);
};
function tweenBall(easeType) {
var begin = -50;
var end = 100;
var time = 20;
var mc = ball_mc;
ballTween = new mx.transitions.Tween(mc, "_y", easeType, begin, end, time);
}
View Replies !
View Related
OnRelease Function Not Working
I seem to be having a bit of a blonde moment here ...
I have a MC on my stage and in there is another MC with a tween. at the end of the tween I have
ActionScript Code:
stop();
right_btn.onRollOver = function(){
this.gotoAndPlay("b_over");
}
It doesn't read what so ever ... i even threw a trace in there and nothing ...
Sandman9
View Replies !
View Related
[AS 2.0] Undefined From Onrelease Function
A bit embarrased guys but its been a while since i action scripted since i am project managing mostly now. ANy how could you guys look at my code and tell me why I am getting "undefined" in my out put when i run the onrelease function.
ActionScript Code:
navHolder_mc.histiory_btn.onRelease = function () {
//--------------------Get Undefined here--------
trace(aboutArray[i].firstChild.nodeValue);
};
I know it must be something dumb i am not doing right. All the code on the bottom. When I trace it in the for loop i get the correct text which should trace "history" but inside the function it is not calling it.
Thanks!
ActionScript Code:
var ifpc:XML = new XML();
ifpc.ignoreWhite = true;
ifpc.onLoad = function(success:Boolean) {
if (success) {
// Retrieve all names in the path xml/*/about.
var headerTitleArray:Array = XPathAPI.selectNodeList(this.firstChild, "/xml/page/about/headerTitle");
var aboutArray:Array = XPathAPI.selectNodeList(this.firstChild, "/xml/page/about/text");
var historyTitArray:Array = XPathAPI.selectNodeList(this.firstChild, "/xml/page/history/headerTitle");
// Retrieve Evetnt Calendar in the path xml/*/title date calendar
var eventArray:Array = XPathAPI.selectNodeList(this.firstChild, "/xml/page/events/item/title");
//
for (var i:Number = 0; i<aboutArray.length; i++) {
//about
trace(headerTitleArray[i].firstChild.nodeValue);
trace(aboutArray[i].firstChild.nodeValue);
//history
trace(historyTitArray[i].firstChild.nodeValue);
trace(eventArray[i].firstChild.nodeValue);
//title of page
headerGRN_mc.headerTitle_mc.headerTitle.autoSize = "left";
headerGRN_mc.headerTitle_mc.headerTitile.text = headerTitleArray[i].firstChild.nodeValue;
//loads text
aboutText_mc.aboutText.autoSize = "left";
aboutText_mc.aboutText.htmlText = aboutArray[i].firstChild.nodeValue;
//
navHolder_mc.histiory_btn.onRelease = function () {
//--------------------Get Undefined here--------
trace(aboutArray[i].firstChild.nodeValue);
};
}
} else {
trace("XML loading failed !!!");
}
};
ifpc.load("xml/ifpc.xml");
View Replies !
View Related
ListComp. OnRelease Function
I have this code from a friend of mine... but I don't really know how to make onRelease function so when I click on the movieClip "imgPlace" to get an url from the xml file
I have tried some things but I had bad results
Here is the code:
Code:
stop();
var listBox:mx.controls.List;
listBox.iconFunction = function(item) {
if(item.icon.indexOf("photoshop")!=-1) return "photoshopIcon_mc";
if(item.icon.indexOf("illustrator")!=-1) return "illustratorIcon_mc";
if(item.icon.indexOf("flash")!=-1) return "flashIcon_mc";
}
var listListener:Object = new Object();
listListener.change = function(eventObject:Object) {
var urlToGO:String = eventObject.target.value;
unloadMovie(imgPlace);
loadMovie(urlToGO,imgPlace);
};
listBox.addEventListener("change", listListener);
listBox.iconField = "icon";
var lBox:XML = new XML();
lBox.ignoreWhite = true;
lBox.onLoad = function() {
var input:Array = this.firstChild.childNodes;
for (i=0;i<input.length;i++) {
listBox.addItem({ data:input[i].attributes.link,
label:input[i].attributes.beschrijving,
icon:input[i].attributes.icoon
});
}
}
lBox.load("data.xml");
View Replies !
View Related
Help Making My Thumbs Scroll Button
First off hello everyone this is my first post here, this site has quickly become one of my favorite to come to for to tutorials articles and information its has been a very helpful site so I'm hoping someone can help me beat my code into working for me lol.
Im making a little flash gallery and Its been going good so far and hit my first real snag. I got my thumbs to load and all and I created two buttons to move them left and right but my logic seems to be out of wack either the thumbs move and disappear or some move to much leaving big gaps between the thumbs that should be there.
Here are the facts I know each thumb is 100 pixels wide with a spacer of 125 so there the total between thumbs is 125. I also know the first thumb is loaded in at the x position of 0 and the last in this case has an x position of 500. so for now this my range to work with later it will be stored in variables to work with more thumbs but for now this is what Im working with.
Like I said when I click the next button the do slide 125 pixels to the left but as the slide off the either add an extra 125 pixels between the last two thumbs or as they slide they they seem to disappear. Here is the last code I been working with to see if anyone can help me with my logic.
Code:
import gs.TweenMax;
import gs.easing.*;
/**************************************************
***************************************************
Initial variables
***************************************************
***************************************************/
var FilePath:Array = [];
var urlVar = "gallery.xml";
var totalFiles:Number;
var c:Number = 0;
var xSpacing:Number = 125;
var xs:Number = 0;
// function to load data from xml files
loadTheXML();
/**************************************************
***************************************************
load Data Code
***************************************************
***************************************************/
function loadTheXML() {
var xmlURLLoader:URLLoader = new URLLoader();
var xmlURLRequest:URLRequest = new URLRequest(urlVar);
xmlURLLoader.load(xmlURLRequest);
xmlURLLoader.addEventListener(Event.COMPLETE, sortTheXML);
function sortTheXML(event:Event):void {
var theXMLData:XML = new XML(xmlURLLoader.data);
var a:Number = theXMLData.file_path.length();
totalFiles = a;
var b:Number = 0;
// loop to load the data in to the arrays
while (b < a) {
FilePath.push(theXMLData.file_path[b]);
b = b + 1;
}// end while loop
// call loadTheThumbs function
loadTheThumbs();
}// End sortTheXML function
}// End loadTheXML Function
/**************************************************
***************************************************
load Thumbs Code
***************************************************
***************************************************/
function loadTheThumbs() {
var thumbLoader:Loader = new Loader();
var thumbRequest:URLRequest = new URLRequest(FilePath[c]);
thumbLoader.load(thumbRequest);
thumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,whenThumbsLoad);
function whenThumbsLoad(event:Event):void {
var thisThumbLink:String = FilePath[c];
thumbLoader.x = (xs * xSpacing);
xs = xs + 1;
// clickable thumbs
thumbLoader.addEventListener(MouseEvent.CLICK,loadMainPic);
function loadMainPic(event:MouseEvent):void {
thumbLoader.removeEventListener(MouseEvent.CLICK,loadMainPic);
clickTest_txt.text = thisThumbLink;
thumbLoader.addEventListener(MouseEvent.CLICK,loadMainPic);
}// end loadMainFunction
// end clicable thumbs
addChild(thumbLoader);
thumbLoader.height = 100;
thumbLoader.width = 100;
TweenMax.to(thumbLoader, 3, {x:0 + thumbLoader.x, y:275, bezierThrough:[{x:475, y:200}], ease:Quint.easeOut});
c = c + 1;
if (c < totalFiles) {
loadTheThumbs();
} else {
xs = 0;
c = 0;
}
// Navigation Button Code
nextBtn.addEventListener(MouseEvent.CLICK,moveNext);
function moveNext(event:MouseEvent):void{
if(thumbLoader.x > 0){
thumbLoader.x = thumbLoader.x - 125;
}
}
}// End whenThumbsLoad function
}// End loadTheThumbs Function
This is my entire codealthough it might not be needed sorry if its too much to look through but does anyone have a good way for me to code my next and previous buttons to slide my thumbs left and right?
Thanks in advance for all those who have input to my problem
View Replies !
View Related
How To: Change 'next.onRelease = Function()' To Delay
The below script functions perfectly to load .JPG's into an MC from an XML file.
However I would like to change the: next.onRelease = function()
to a delay of 10 seconds and then advance to the next image instead of using a next button.
can some one show me how to do this?
thanks
NYC.
info.text = "Loading...";
my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.load("images02.xml");
my_xml.onLoad = function(status)
{
if (status)
{
info_xml = this.firstChild.firstChild.childNodes;
// Create New Movie Clip
createEmptyMovieClip("mc", 1);
// Load picture into new MC
loadMovie(info_xml[0].attributes.source, "mc");
// Positioning
stageWidth = 700;
stageHeight = 420;
setPicture(mc);
}
else
{
}
};
next.onRelease = function()
{
// Next image
if (image < info_xml.length - 1)
{
image++;
loadMovie(info_xml[image].attributes.source, "mc");
info.text = info_xml[image].attributes.title;
setPicture(mc);
}
else if (image == info_xml.length - 1)
{
image = 0;
loadMovie(info_xml[image].attributes.source, "mc");
info.text = info_xml[image].attributes.title;
setPicture(mc);
}
};
/////////////
function setPicture(theMC)
{
this.onEnterFrame = function()
{
if (mc._width > 0)
{
mcWidth = mc._width;
mcHeight = mc._height;
mc._x = (stageWidth - mcWidth) / 2;
mc._y = (stageHeight - mcHeight) / 2;
// Text field with picture name
info.text = info_xml[0].attributes.title;
delete my_xml;
delete this.onEnterFrame;
}
};
}
View Replies !
View Related
Php Feedback Form Onrelease Function
Once the submit button is clicked for the feedback form, I want the form to be sent and then the form mc to go to and play the next frame in the scene. The form works fine but I cannot get it to play the next frame and make the form go away. Here is what I have for the button actionscript. Thanks!
on (release) {
if (!Email.length || Email.indexOf("@") == -1 || Email.indexOf(".") == -1) {
EmailStatus = "Invalid eMail";
} else if (!FirstName.length) {
EmailStatus = "Invalid Name";
} else if (!ToComments.length) {
EmailStatus = "No comments recorded";
} else {
loadVariablesNum ("form.php", "0", "POST");
EmailStatus = "Thank you.";
}
gotoAndStop ("Scene 3", 71);
}
View Replies !
View Related
[F8] Change OnRelease Function After Release?
Hi everyone,
I'm not really a actionscript expert, but I know this can be 'easily' done;
When clicking a button, a submenu slides out, using the tween classes.
I want the classes to revert when clicking the same button again.
How do I change the onRelease function of the button when it's clicked once?
This is my AS (on timeline) so far:
PHP Code:
stop();
producten_submenu.setMask(mask_producten);
import mx.transitions.Tween;
import mx.transitions.easing.*;
producten_but.onRelease = function() {
// Wegwijzer
var Wegwijzer:Tween = new Tween (_root.wegwijzer_mc,"_y",Regular.easeInOut,36,155,16,false);
// Zoeken
var Zoeken:Tween = new Tween (_root.zoeken_mc,"_y",Regular.easeInOut,77,204,16,false);
// Masker Submenu
var Maskproducten:Tween = new Tween (mask_producten,"_yscale",Regular.easeInOut,0,80,16,false);
producten_but.onRelease = function() {
Wegwijzer.onMotionFinished = function() {
this.reverse()
};
Zoeken.onMotionFinished = function() {
this.reverse()
};
Maskproducten.onMotionFinished = function() {
this.reverse()
};
}
}
Any help is very welcome!
Thanks
View Replies !
View Related
OnRelease Function To A Dynamic Movie
Hello there,
I have this problem:
I have a number of images dinamically loaded from XML file into the swf. The names of the newly created mc are also dinamically created. All this happens in a for(i=0;......) cycle. So far so good.
But I need to be able to click on those images so that the visitor can see a larger version of them. I tried to do this by the following cycle (because the number of images in the XML varies) but it doesn't seem to work. If I try to trace the array image[i] inside the onRelease function it outputs undefined ?? If I trace it outside the onRelease function it is traced ok. Do you have any idea how could I make this to work ??
for (i=1; i<total; i++) {
bar3["container"+i+"_mc"].onRelease = function() {
vewer_mc.loadMovie(image[i], "img"+i+"_mc", i+70);
vewer_mc._xscale = 100;
vewer_mc._yscale = 100;
};
}
On the other hand if I replace the image[i] with image[0] or so it works fine.
It seems that the variable i is not transfered in the onRelease function because the function is invoked on an event......
image[] is an array with the urls of the images in itself.
total contains the total number of urls in the XML.
The images are inside another mc called bar3
vewer_mc is an empty mc.
Thanks in advance.
Eva
View Replies !
View Related
OnRelease Stop The Function? Options?
Hey guys, i have a pressing issue here was wondering if anyone could help me with.
I have a small movie that basically is a mask that when you click on it it follows the mouse to reveal the other image under it. I dont want a circle bit of a mask, i want the mask to be 1/2 the stage size and only scroll on the x plane. I have this setup and working more less except for the fact i cant "uncall" (yes i just made that up) the function. heres my code
ActionScript Code:
var speed = 5;
MovieClip.prototype.follow = function() {
this.onEnterFrame = function() {
this._x += (_root._xmouse-this._x)/speed;
if (Math.abs(_root._xmouse-this._x)<1 && Math.abs(_root._ymouse-this._y)<1) {
delete this.onEnterFrame;
}
};
};
//drag the mask
mask.onPress = function() {
mask.follow();
};
as you can see the mask when pressed gets the follow function attatched, but i cant get it to stop moving when you release. I have tried all manners of onRelease to no avail...what can i do?
I would use the startDrag function but i love the easing (and i dont know how to constrain start/stopDrag to the X axis)
Any help would be great!
Thanks
--][--
View Replies !
View Related
|