Flash Button Actionscript
can anyone plz help me code my flash buttons in a drop down
menu, a basic flash button in order to link my pages within
dreamweaver.
now this website has the drop down menu if you look at the
top, i know how to create everything buttons,dropdown menus in
flash but somehow i cannot get the buttons to link to my webpage
within dreamweaver i tried
the actionscrip
On(Rollover)}
getURL("Page")}
but it doesn't work for my webpages but it does work to
external pages like google.com
noW, i know there is way to create this drop down menu or
button thats why this page has it, im trying to make my website for
my school and i would love to know how to code it. plz
help..thanks
unless your publishing for flash 6 or earlier, flash is
case-sensitive and your code is incorrect. that should be:
on(rollOver){
getURL("Page.html"); // assuming Page.html is correct.
}
Similar Messages
-
Help with flash buttons actionscript 2.0
Help please, I am not sure what I am doing wrong here. Each button has this script
on (release) {
getURL("http://www.mysite.com/index.html");
Once they work I want to import them to dreamweaver.Do you happen to have any kind of rollover code tied to anything that is containing the buttons? I don't see the sense in having Flash buttons unless you have some form of animation associated with them, possibly triggered by rollover interactions. If so, the rollover may be blocking access to the on(release) interaction.
-
I am just getting back into using Captivate 2.0 to create
some online training and I need some assistance using
JavaScript/ActionScript in Flash buttons. I created a series of
buttons that are part of a single Flash .swf file. I'm using these
buttons as kind of a "main menu" and I would like each of the
individual buttons in the exported Flash .swf file to perform one
of the following functions:
- Open another Captivate project in the same (parent) browser
window, or...
- Jump to a specific slide in the current project
I layed out all the buttons in a single .swf file so I
wouldn't have to import individual buttons into my Captivate
project. So how do I define the ActionScript for each button in
Flash to achieve these functions?
Any help is greatly appreciated.
BrianHey Brian,
You can easily open another .HTM file using Javascript, but
doing so generally won't allow you to do any tracking of results.
Successful results tracking pretty much requires that an LMS is
launching each file. That said, opening a new file requires only
the following line of Javascript, where the path can be either
relative or absolute:
window.location.href = "<path to new file>";
As for jumping to a specific slide in a given file, Adobe
Community Expert Paul Dewhurst contributed to a discussion topic in
these forums that references using an undocumented internal
Captivate array to navigate to a specific slide via Actionscript.
You can check it out here:
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=67&catid=464&threadid =1149498&highlight_key=y&keyword1=variable -
How do i actionscript my flash button to play the sound while being transfered to another url?
Hi!
As the title says:
How do i get my flash button to play my sound when i click on
it while being transfered to another url?
I did get it to work, but only when i set the script to
"_BLANK". When i clicked the button then it played the sound and
opened the url in a new window. I want it to be in the same window
and still play the whole sound.
Now i get just 1 or 2 sec then when im transfered, it stops
playing the sound.
I hope this explains it..... if any typo....its because im
Swedish =)
Thanks in advance!If you are jumping to another URL using the same window you
cannot have a sound start on the press of a button and that sound
to continue on.
Reason
You are removing all trace of the sound and the swf that
contains that sound file.
Work arounds
1.Take a look at "frames". This way you are keeping the
container page and opening another page inside of that page.
2. Div's. again you are importing a page into a particular
area yet keeping the swf, with the sound playing, in the parent
frame. -
Stop and Play All Child MovieClips in Flash with Actionscript 3.0
I am stuck with the ActionScript here. I have a very complex animated flash movie for eLearning. These contain around 10 to 15 frames. In each frame I am having multiple movie clip symbols. The animation has been created using a blend of scripting and also normal flash animation.
Now I want to create pause and play functionality for the entire movie. I was able to create the pause function but when i try to play the movie it behaves very strange.
I was able to develop the pause functionality by refering to the below mentioned links:
http://www.unfocus.com/2009/12/07/stop-all-child-movieclips-in-flash-with-actionscript-3-0 /
http://www.curiousfind.com/blog/174
Any help in this regard is highly appreciated as i am approaching a deadline.
I am pasting the code below:
import flash.display.MovieClip;
import flash.display.DisplayObjectContainer;
import flash.utils.Timer;
import flash.events.TimerEvent;
import fl.transitions.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
import flash.events.Event;
import flash.events.MouseEvent;
stop();
// function to stop all movieclips
function stopAll(content:DisplayObjectContainer):void
if (content is MovieClip)
(content as MovieClip).stop();
if (content.numChildren)
var child:DisplayObjectContainer;
for (var i:int, n:int = content.numChildren; i < n; ++i)
if (content.getChildAt(i) is DisplayObjectContainer)
child = content.getChildAt(i) as DisplayObjectContainer;
if (child.numChildren)
stopAll(child);
else if (child is MovieClip)
(child as MovieClip).stop();
// function to play all movieclips
function playAll(content:DisplayObjectContainer):void
if (content is MovieClip)
var movieClip:MovieClip = content as MovieClip;
if (movieClip.currentFrame < movieClip.totalFrames) // if the main timeline has reached the end, don't play it
movieClip.gotoAndPlay(currentFrame);
if (content.numChildren)
var child:DisplayObjectContainer;
var n:int = content.numChildren;
for (var i:int = 0; i < n; i++)
if (content.getChildAt(i) is DisplayObjectContainer)
child = content.getChildAt(i) as DisplayObjectContainer;
if (child.numChildren)
playAll(child);
else if (child is MovieClip)
var childMovieClip:MovieClip = child as MovieClip;
if (childMovieClip.currentFrame < childMovieClip.totalFrames)
//childMovieClip.play();
childMovieClip.play();
function resetMovieClip(movieClip:MovieClip):MovieClip
var sourceClass:Class = movieClip.constructor;
var resetMovieClip:MovieClip = new sourceClass();
return resetMovieClip;
pauseBtn.addEventListener(MouseEvent.CLICK, onClickStop_1);
function onClickStop_1(evt:MouseEvent):void
MovieClip(root).stopAll(this);
myTimer.stop();
playBtn.addEventListener(MouseEvent.CLICK, onClickPlay_1);
function onClickPlay_1(evt:MouseEvent):void
MovieClip(root).playAll(this);
myTimer.start();
Other code which helps in animating the movie and other functionalities are as pasted below:
stage.addEventListener(Event.RESIZE, mascot);
function mascot():void {
// Defining variables
var mc1:MovieClip = this.mascotAni;
var sw:Number = stage.stageWidth;
var sh:Number = stage.stageHeight;
// resizing movieclip
mc1.width = sw/3;
mc1.height = sh/3;
// positioning mc
mc1.x = (stage.stageWidth/2)-(mc1.width/2);
mc1.y = (stage.stageHeight/2)-(mc1.height/2);
// keeps the mc1 proportional
mc1.scaleX <= mc1.scaleY ? (mc1.scaleX = mc1.scaleY) : (mc1.scaleY = mc1.scaleX);
stage.removeEventListener(Event.RESIZE, mascot);
mascot();
this.mascotAni.y = 100;
function mascotReset():void
// Defining variables
var mc1:MovieClip = this.mascotAni;
stage.removeEventListener(Event.RESIZE, mascot);
mc1.width = 113.45;
mc1.height = 153.85;
mc1.x = (stage.stageWidth/2)-(mc1.width/2);
mc1.y = (stage.stageHeight/2)-(mc1.height/2);
// keeps the mc1 proportional
mc1.scaleX <= mc1.scaleY ? (mc1.scaleX = mc1.scaleY) : (mc1.scaleY = mc1.scaleX);
var interval:int;
var myTimer:Timer;
// function to pause timeline
function pauseClips(secs:int, myClip:MovieClip):void
interval = secs;
myTimer = new Timer(interval*1000,0);
myTimer.addEventListener(TimerEvent.TIMER, goNextFrm);
myTimer.start();
function goNextFrm(evt:TimerEvent):void
myTimer.reset();
myClip.nextFrame();
myTimer.removeEventListener(TimerEvent.TIMER, goNextFrm);
// function to pause timeline on a particular label
function pauseClipsLabel(secs:int, myClip:MovieClip, myLabel:String):void
interval = secs;
myTimer = new Timer(interval*1000,0);
myTimer.addEventListener(TimerEvent.TIMER, goNextFrm);
myTimer.start();
function goNextFrm(evt:TimerEvent):void
myClip.gotoAndStop(myLabel);
myTimer.removeEventListener(TimerEvent.TIMER, goNextFrm);
MovieClip(root).pauseClips(4.5, this);
// function to fade clips
function fadeClips(target_mc:MovieClip, next_mc:MovieClip, from:Number, to:Number):void
var fadeTW:Tween = new Tween(target_mc, "alpha", Strong.easeInOut, from, to, 0.5, true);
fadeTW.addEventListener(TweenEvent.MOTION_FINISH, fadeFinish);
function fadeFinish(evt:TweenEvent):void
next_mc.nextFrame();
fadeTW.removeEventListener(TweenEvent.MOTION_FINISH, fadeFinish);
// function to fade clips with speed
function fadeClipsSpeed(target_mc:MovieClip, next_mc:MovieClip, from:Number, to:Number, speed:int):void
var fadeTW:Tween = new Tween(target_mc, "alpha", Strong.easeInOut, from, to, speed, true);
fadeTW.addEventListener(TweenEvent.MOTION_FINISH, fadeFinish);
function fadeFinish(evt:TweenEvent):void
next_mc.nextFrame();
fadeTW.removeEventListener(TweenEvent.MOTION_FINISH, fadeFinish);
// function to show screen transitions
function screenFx(target_mc:MovieClip, next_mc:MovieClip):void
//var tweenTW:Tween = new Tween(target_mc,"alpha",Strong.easeInOut,0,1,1.2,true);
var tranFx:TransitionManager = new TransitionManager(target_mc);
tranFx.startTransition({type:Iris, direction:Transition.OUT, duration:1.2, easing:Strong.easeOut, startPoint:5, shape:Iris.CIRCLE});
tranFx.addEventListener("allTransitionsOutDone",doneTrans);
function doneTrans(evt:Event):void
next_mc.nextFrame();
tranFx.removeEventListener("allTransitionsOutDone",doneTrans);
// function to show screen transitions inverse
function screenFxInv(target_mc:MovieClip, next_mc:MovieClip):void
var tweenTW:Tween = new Tween(target_mc,"alpha",Strong.easeInOut,0,1,1.2,true);
var tranFx:TransitionManager = new TransitionManager(target_mc);
tranFx.startTransition({type:Iris, direction:Transition.IN, duration:2, easing:Strong.easeOut, startPoint:5, shape:Iris.SQUARE});
tranFx.addEventListener("allTransitionsInDone",doneTrans);
function doneTrans(evt:Event):void
next_mc.nextFrame();
tranFx.removeEventListener("allTransitionsInDone",doneTrans);
// function to zoom in
function zoomFx(target_mc:MovieClip):void
//var tweenTW:Tween = new Tween(target_mc,"alpha",Strong.easeInOut,0,1,1.2,true);
var tranFx:TransitionManager = new TransitionManager(target_mc);
tranFx.startTransition({type:Zoom, direction:Transition.IN, duration:3, easing:Strong.easeOut});
//tranFx.addEventListener("allTransitionsInDone",doneTrans);
/*function doneTrans(evt:Event):void
next_mc.nextFrame();
// Blinds Fx
function wipeFx(target_mc:MovieClip):void
var tranFx:TransitionManager = new TransitionManager(target_mc);
tranFx.startTransition({type:Wipe, direction:Transition.IN, duration:3, easing:Strong.easeOut, startPoint:9});
// Blinds Fx Center
function fadePixelFx(target_mc:MovieClip):void
var tranFx:TransitionManager = new TransitionManager(target_mc);
tranFx.startTransition({type:Fade, direction:Transition.IN, duration:1, easing:Strong.easeOut});
tranFx.startTransition({type:PixelDissolve, direction:Transition.IN, duration:1, easing:Strong.easeOut, xSections:100, ySections:100});This movie is an animated movie from the start to end. I mean to say that though it stops at certain keyframes in the timeline it stops for only a certain time and then moves on to the next animation sequence.
Its not an application where the user can interact.
On clicking the play button i want the movie to play normally as it was playing before. If the user has not clicked on the pause button it would anyhow play from start to finish.
Is there anyway where i could send in the fla file? -
How to SHOW/HIDE a dreamweaver layer from a flash button?
I have almost 2 weeks tying to find a solution for this. Please help...
-How can you SHOW/HIDE an thml-dreamweaver layer from a flash movie button.
My html layer name is LAYER1, and my FlashMC botton name is FLBOT1
Now, what is the actionscript that im suppouse to place in the flash button?
Please respond, ThanksAdobe removed Flash Text and Flash Buttons from CS4 for accessibility reasons. Flash buttons aren't web friendly. And if you use this approach, you'll need to work in Flash because DW doesn't write Action Script for you.
That said, you could do something similar without Flash.
Pure CSS Disjointed Menu Rollovers
http://alt-web.com/DEMOS/CSS-Disjointed-Menu-Rollover.shtml
Pure CSS Disjointed Text Rollovers
http://alt-web.com/DEMOS/CSS-Disjointed-Text-Rollover.shtml
Show/Hide Layers with DW behaviors:
http://www.cbtcafe.com/dreamweaver/showhidelayers/index.html
Walter Zorn's Tooltips
http://www.walterzorn.com/tooltip/tooltip_e.htm
FloatBox Demos
http://randomous.com/floatbox/demo
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
www.alt-web.com/
www.twitter.com/altweb
www.alt-web.com/blogspot.com -
Popup Window- Button Actionscript
Does anyone have the code that combines actionscript w/ java
in order to create a popup window from a flash button? I couldn't
get this to work- on (release) {
getURL
("javascript:NewWindow=window.open('index.html','newWin','width=400,height=300,left=0,top =0,toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No');
NewWindow.focus();void(0);");ggshow, I tried your component, but I can't figure out where
to place the
my_btn.onPress = function() {
my_popup.openWindow("
http://www.ggshow.com",
"my_window");
I would be very happy if you, or anyone else could solve this
trivial problem for me
thanks
/magnus -
Hi All,
I am looking to attach this code to a flash button on click
<form method="POST">
<P><Input type="submit" value="table lamp on"
name="run_event"></P>
</form>
the code above sends a command to run an event to my home
automation server
thanks in advanceYou cannot apply links to Flash elements using HTML. All
interactivity in
such elements MUST be done in Flash Actionscript.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"dirtymurt" <[email protected]> wrote in
message
news:frdutu$124$[email protected]..
> Hi All,
>
> I am looking to attach this code to a flash button on
click
>
> <form method="POST">
> <P><Input type="submit" value="table lamp on"
name="run_event"></P>
> </form>
>
> the code above sends a command to run an event to my
home automation
> server
> thanks in advance
> -
Hi
I am quite new to actionscript but when building a simple app
that calculates amounts when you press on a button it only works if
I use a library button and not my customised one. I have checked
that the button is a button symbol and has four states but whenever
I use my own customised button I get error message...the library
button works fine with the actionscript.
Here is the error message I get with my custom button - any
idea why?
thanks
Em
**Error** Scene=Scene 1, layer=buttons, frame=1:Line 2:
Invalid mouse event specified.
on(click) {
**Error** Scene=Scene 1, layer=buttons, frame=1:Line 3:
Statement must appear within on handler
with(_parent){
**Error** Scene=Scene 1, layer=buttons, frame=1:Line 6:
Unexpected '}' encountered
Total ActionScript Errors: 3 Reported Errors: 3Know the type of button:
1. Button Symbols made in library:
on (press)
on (release)
on (rollOver)
This appears the one you are deploying.
See
http://livedocs.macromedia.com/flash/8/main/00001752.html
2. The Flash Button Component:
... where there is a click event handler
http://livedocs.macromedia.com/flash/8/main/00003114.html
3. Custom buttons created with a MovieClip Symbol.
Use Actionscript and the methods for responding to events for
example onRelease -
http://livedocs.macromedia.com/flash/8/main/00002499.html -
Flash button link AS 3.0
I have a flash button link using actionscript 3.0. The animation is a fade in of a logo. The problem is that the button is only a link during the animation, ie. when the logo has fully faded in it stops becoming a link. Here is the actionscript code i am using, does anyone know where i am wrong? Thank you so much.
import flash.events.MouseEvent;
myButton.addEventListener(
MouseEvent.CLICK, myButtonFunction);
function myButtonFunction(event:MouseEvent):void {
var request:URLRequest = new URLRequest("http://flightswitch.com/home.html");
navigateToURL(request, "_self");Hi,
If the logo animation is completely fade then the link is not enabled?
Is it?
Disable the logo button after it fade.
Saransoft -
How can I change the function of a flash button?
Hello,
Not sure if this should go in the Flash forum or Captivate forum, but does anyone know how where to find ActionScript 3 commands for Captivate?
I downloaded a pre-made Flash button (source file) for Adobe Captivate that was originally made to make a video go to the next slide, when pressed. It does that fine, but I wanted to know how to use the ActionScript code in Flash Professional CS5 to have the button JUMP to a specific slide in Captivate, instead of just go to the NEXT slide. I know generally how code works, but have never really used it, and don’t know the specific command to make that happen. Currently the relevant part of the code in the Flash button reads:
function clicked(e:MouseEvent):void{
var myRoot:MovieClip = MovieClip(root);
var mainmov:MovieClip = MovieClip(myRoot.parent.root);
mainmov.rdcmndNextSlide = 1;
I suspect that I just have to change the last line to something else and it should work, but I would need the command. Can anyone tell me what needs to be changed in the above code to make that happen?
The full code is below. Thanks.You are awesome. Thank you. That was extremely helpful. Michael also gave me a list of variables to use. However, when I use:
cpCmndGotoSlide = 5
It always jumps to slide 9, regardless of the value I put in the place of the '5'. So it does jump to a slide, but I can't yet get it to jump to the slide I want. In other words,
cpCmndGotoSlide = 7
or
cpCmndGotoSlide = 13
or
cpCmndGotoSlide = 44
etc,
produces the same result: jump to slide 9. I followed the same format... Any idea why it wouldn't be working?
Here is the full script:
this.stop();
// Set up event listeners
main.btn2_mc.addEventListener (MouseEvent.MOUSE_OVER, over);
main.btn2_mc.addEventListener (MouseEvent.MOUSE_OUT, out);
main.btn2_mc.addEventListener (MouseEvent.MOUSE_DOWN, clicked);
// functions for eventlisteners
function over(e:MouseEvent):void{
main.button1_mc.gotoAndPlay("s1");
function out(e:MouseEvent):void{
main.button1_mc.gotoAndPlay("s2");
function clicked(e:MouseEvent):void{
var myRoot:MovieClip = MovieClip(root);
var mainmov:MovieClip = MovieClip(myRoot.parent.root);
mainmov.cpCmndGotoSlide = 5; -
Putting Hyperlinks into Flash Button Symbols
Hi there,
I just wanted to know how to put Hyperlinks into Flash Button
symbols
For example;
I have a button which is named Home, and i have the UP, OVER,
DOWN and HIT stages and wanted to put a
Hyperlink to lets say Google so www.google.com.au and wanted
it to open in the same page not a new tab.
And if possible would like to know how to put multiple
Buttons as one Flash File and have them all Hyperlinked to
DIFFERENT Pages.
I know very little Actionscript, but know what it is and
other basics on it.
I am using Adobe CS3 Flash 9 and would prefer a simple
answer, Thank YouHi,
There is a video tutorial for this on my website below.
Hope this helps.
Thanks
Alan -
Flash button that controls breeze play button
Is it possible to create a flash button that is scripted to
control the play and pause button on the breeze playbar? What I am
looking for is a way to have a button that would start a slide
again after it has stopped and is waiting for the user to start
again.Hi!
If you want to control the viewer with a Flash button you've
embedded in a powerpoint slide (prior to using presenter to convert
it) try this:
(1) Make your button in Flash, and add this Actionscript to
the first slide (replace [btnName] with the name of your button
instance:
btnName.onRelease = function () {
_root.m_controlBar.m_slideNextBtn._onRelease();
(2) Insert your button's swf in the PPT presentation and
compile with Presenter. Now, when the user clicks the button, it
will simulate pressing the "next slide" button in the viewer's
control bar.
Here are some of the other button names; to use these
instead, just replace "m_slideNextBtn" in the above code:
Play/pause button "m_playBtn"
Next slide button "m_slideNextBtn"
Previous slide button "m_slideBackBtn"
View changer button "m_viewChangeBtn"
Attachment Button "m_attachmentsBtn"
Volume Button "m_volumeBtn"
Hope that helps!
~Marc B -
Flash button to show html layer
I have embedded a Flash menu into an html doc with a hidden
layer called player. I want a button in the Flash menu to show that
layer. I used the instructions on this website:
http://www.bestflashanimationsite.com/tutorials/1/2/
But it doesn't work. I made a link on the html page that
shows the layer, so the Dreamweaver MM_showHideLayers function is
there in the html head. I tried this in the button actionscript:
on(press) {
getURL("javascript:MM_showHideLayers('player','','show')");
I also tried writing a custom function in the html which does
work from a button in the html:
function showPlayer() {
MM_showHideLayers('player','','show')
and then putting this in the Flash button:
on(press) {
getURL("javascript:showPlayer()");
Which does not work. (following are the Dreamweaver
functions)
Please help!!!!!I use externalInterface (instead of getURL). Its a great way
to call javascript functions from flash and vice-versa.
http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveD ocs_Parts&file=00002200.html
There are some links to examples in the comments below the
description. -
Importing Flash buttons into Flash
I've created a nice button as a movie clip in Flash 10 CS4
Actionscript 3 so that the button changes with mouse_over and it
all works fine, both with Test Movie and separately playing the swf
file. The problem is I want to use this button in a variety of
Flash applications. I thought all I would have to do was to export
the button as swf and then import it into the new Flash program as
a button symbol and add the ActionScript code for mouse_click etc.
I didn't expect to be able to edit the button in the new program,
but I thought it would run OK. What happens is that the button
appears, but all the movie clip behaviour is missing -- it's just a
static object that doesn't respond to mouse_over. I've tried
importing it as a button and as a movie clip -- neither works.
Given my primitive experience of ActionScript and Flash, the only
work around I can think of is to put all the ActionScript code for
the button in each application. This will be a big task, as various
layers and scripts are involved.
There must be something simple that I am missing, but I can't
seems to find this problem addressed anywhere. Most people seem to
want to use their Flash buttons in non-Flash applications like html
web pages. Help, please, from someone who can make Flash sing and
dance (or at least more than I can) ...You can copy and paste any item in the Library of one movie
to the Library of a second movie. If you do that, you can get the
button into your new movie. You will still need to bring the
actionscript over from one movie to the other. You can do this in a
similar copy and paste manner.
Maybe you are looking for
-
WebLogic 10.3.0.0 vs 10.3.1.0 (11gR1)
Hi, I've now seen 10.3.1.0 (11gR1) is out and downloadable. Can anyone directed me to the page which mentions the fixes/improvements between 10.3 and 10.3.1? (Is there any?) Regards, Alistair.
-
Backup caused contacts to disappear. Why can I not get them back?
I was asked for my apple password to complete a backup. After I entered the password my contacts disappearred and I am unable to get them back on my iPhone from either the Verizon website or from the Apple iCloud site. How can I get them back without
-
I've noticed a little problem with arranging my music library by album. Say you've got three albums titled "Greatest Hits". iTunes doesn't automatically arrange the album by artist, so all your Greatest Hits albums are jumbled. Sure, you could change
-
Hello Is there any workflow template for the following: Credit controller proposes an amount to written of on customer open items. Depending on amount the authorised person is looked up in an authorisation matrix (table) This person gets a message in
-
Having trouble signing in to FaceTime
Having trouble signing in to second copy of FaceTime on second computer using same account, one ay work , one at home. Any thoughts? Using iMacs Intel Core Duo with 10.6.8