Making a button go to a specific frame
I'm having trouble with this. I'm just practicing for the moment and not expert in flash code at all. I have a button on frame #1. On that frame, I used the following code I found on the web (which I tried using both AS2 and AS3):
stop();
function buttonClick(event:MouseEvent);void{
gotoAndPlay(2);
I get errors of varying sorts. What should I use? AS2 or AS3? And what code should I assign to the button (or that button's frame?) to get it to go to frame 2 once clicked?
The code you show is an incomplete/incorrect attempt to use AS3. For AS3 you need to assign an instance name to the button and then assign an event listener to the button using the instance name to target it. The code goes in the frame of the timeline that coincides with the button's frame (preferably on a separate layer for actionscript). So if you gave the button an instance name of "btn", the complete/correct code for it would be...
stop(); // this is a timeline command, not a button command
btn.addEventListener(MouseEvent.CLICK, buttonClick);
function buttonClick(evt:MouseEvent):void {
gotoAndPlay(2);
Similar Messages
-
Button link to a specific frame in time line
Ok I have created my buttons and the content for the specific
frames. I have named the button and given it an instance name. I
have also given my specific frame a name and set that label type to
Name.
Whats the code for turning getting my button to link to a
specific frame?
I've also done the stop() code in each frame as I want it to
stop at each frame until the button is clicked again.
I have more than one button and each will link to a different
frame.
Thanks.I've duplicated an FLA with exactly the assets you have in
the same places, with the code on the main timeline. And mine
didn't work, just the same problem as you had. The solution I
proposed above works, but it is not the only way (See #2 below).
On Frame 1, select the UIScrollbar. if you look in the
Parameters tab of your UIScrollbar component, you'll notice that
the
scrolltargetName refers to
Instance_0. This is a default instance name assigned by the
Flash compiler, because you did not give your dynamic textfield an
instance, and your UIscollbar is referencing that. Now go to Frame
4. You will find that your dynamic textfield has the same instance
name, and the UIScrollbar is referencing the same instance. Problem
is, you have more than one textfield on more than one frame using
and referencing the same instance name, your UIScrollbars will get
confused as to which textfield is actually "Instance_0". The moment
you click to another frame, you've confused the UIScrollbar(s), so
they never work again.
The solution is simple.
First, put a stop() action on the first frame, if you have
not already done so, so your timeline stays put until you click on
a button.
Then you can solve the problem in one of two ways:
Give your textfields different instance names, and make sure
the
scrolltargetName property of each UIScrollbar refers to its
respective textfield.
Or set the text dynamically, which after all is what a dynamic
textfield is for. Have only one textfield/UIscrollbar combo, on the
first frame, and place code on a keyframe for each section which
changes the
text or
htmlText property of the textfield.
That should work. It did on mine. -
Can you have a button play a specific frame in a different Edge Animate page?
I'd like to create a movie that can open other HTML files and go to a specific frame within those other pages. Is there any way to handle that inside of Edge Animate?
Thanks for the suggestion, but I'm looking for something a little different.
I'm looking to figure out a way to pass along some information from one movie to another.
For example. If I have a page (Movie1.html) that has Button A, Button B and Button C. Is there a way for me to open a different page (Movie2.html) AND point to a different frame based on what they clicked in Movie1.html?
So if they click Button A, it will open Movie2.html and go to frame label "IntroSection"
But if they click Button B, it will still open up Movie2.html, but this time it would jump to the label "AboutUs"
And if they click Button C, it will open up Movie2.html, it would jump to the label "End"
The idea is to have a few different files, but be able to point to specific frames or labels within an external movie.
Thanks!
Jeff -
Making a button rollover change a movie clip's frame
Hi again everyone,
I knew how to do this in AS2 but now I am having problems
with making a button on the stage goto a frame in a movie clip on
the stage.
I've attached a sample of my code below, hopefully you'll see
the error and be able to point it out to me?
I have a movie clip on the stage that has different
information in different frames. I want to make it so that when
someone rolls over the button, the movie clip fades in and goes to
the correct frame to display the information.
With this setup the way it is below, I keep getting "Warning:
3590: void used where a Boolean value was expected. The expression
will be type coerced to Boolean.
I know where the problem is happening, "function
XXX(event:MouseEvent):void {navigateToURL(XXXweb)}"
How can I write this differently and eliminate this problem?
Thanks,
JeremiahI'll give that a shot, thanks!
A follow up question to that one, is there a way to make it
so that I can have one rolled over function applied to several
buttons / frames in the movie clip? This movie clip has 50+ frames
in it and if I could reduce my coding, it would make life a lot
easier.
Thanks,
Jeremiah -
Using Actionscript 3, how do I code a button in a parent file to load another swf file at a specific frame?
You can either place the loading code in the desired frame of the parent file, or continuously monitor the currentFrame proiperty of the parent file and do the loading when the value matches the desired frame number.
-
Removing a Button Event Listener on a Specific Frame and Reactivating it on Next Frame
Hi , i am trying to develop a Slideshow where Next Button needs to behave in a certain way on a specific Frame , lets say a Specific Condition is met only then Next Button would work , I have been able to achieve that but problem is the Button Retains its Event Listener even on the next Frame , whereas i have already included removeEventListener on the next frame with a new Function for the button , but its doesnt take it like that.
Can anyone help please ?Hello Ned,
I have fixed the issue with few Frame , but where we have the conditions to be met on two consecutive frames , I am not able to achieve that.
here is the Code on my first Frame.
FRAME1
stop();
slidecounter.text = String(this.currentFrame - 1 + "/" + indexframe);
mc_prog.width = 0;
//LIBRARIES TO BE IMPORTED ///////////////////////////////////////////////////////////
import flash.events.MouseEvent;
//VARIALBLES INITIATED
var score:Number = 0;
var questions:Number = 0;
var qtotal:Number = 11;
var attempt:Number = 0;
var indexframe:int;
indexframe = this.totalFrames - 1;
var notes:Array = new Array();
var count:int;
count = 0;
var backcounter:int;
backcounter = 0;
var count2:int;
count2 = 0;
var backcounter2:int;
backcounter2 = 0;
var count3:int;
count3 = 0;
var backcounter3:int;
backcounter3 = 0;
// MOVIE CLIPS INITITATED ////////////////////////////////////////////////////////////////
var volbutton1:volcontrol;//VOLUME BUTTON ROLLOVER MOVIE CLIP
volbutton1 = new volcontrol();
var clist:courselist;//VOLUME COURSE LIST ROLLOVER MOVIE CLIP
clist = new courselist();
var pop1:Mc_slide9 = new Mc_slide9;
pop1 = new Mc_slide9;
var pop2:Mc_slide13 = new Mc_slide13;
pop2 = new Mc_slide13;
var pop3:Mc_slide17 = new Mc_slide17;
pop3 = new Mc_slide17;
//BUTTONS INITIATED
btn_nxt.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame);//NEXT SLIDE BUTTON
btn_bck.addEventListener(MouseEvent.CLICK, backbtn);//BACK BUTTON
btn_loc.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage); //LIST OF COURSES BUTTON
btn_notice1.addEventListener(MouseEvent.CLICK, loadnotice1);
pop1.closebtn.addEventListener(MouseEvent.CLICK, unloadbtn1);
btn_notice2.addEventListener(MouseEvent.CLICK, loadnotice2);
pop2.closebtn.addEventListener(MouseEvent.CLICK, unloadbtn2);
btn_notice3.addEventListener(MouseEvent.CLICK, loadnotice3);
pop3.closebtn.addEventListener(MouseEvent.CLICK, unloadbtn3);
//VOLUME BUTTON ROLL OVER FUNCTION EVENT LISTENERS ///////////////////////////////////////
btn_vol.addEventListener(MouseEvent.ROLL_OVER,vol);
btn_vol.addEventListener(MouseEvent.ROLL_OUT,volout);
btn_loc.addEventListener(MouseEvent.ROLL_OVER,coursel);
btn_loc.addEventListener(MouseEvent.ROLL_OUT,corlist);
// FUNCTIONS INITIATED /////////////////////////////////////////////////////////////////
function fl_ClickToGoToNextFrame(event: MouseEvent): void
nextFrame();
function backbtn(event:MouseEvent):void{
prevFrame();
function fl_ClickToGoToWebPage(event: MouseEvent): void {
navigateToURL(new URLRequest("https://www.onlineinduction.com/fmgl/courselist.php?ist=2&type=Vendor Employee Inductions"), "_self");
//VOLUME BUTTON ROLLOVER EFFECT FUNCTION
function vol(e:MouseEvent):void
addChild(volbutton1);
//popup_instance.width = 675;
//popup_instance.height = 300;
if(this.currentFrame == 2)
volbutton1.x = 150;
volbutton1.y = 528;
else{
volbutton1.x = 278;
volbutton1.y = 528;
function volout (e:MouseEvent):void {
removeChild(volbutton1);
function coursel(e:MouseEvent):void {
addChild(clist);
if(this.currentFrame == 2)
clist.x = 85;
clist.y = 532;
else if(this.currentFrame == 5){
clist.x = 115;
clist.y = 325;
else{
clist.x = 175;
clist.y = 532;
function corlist (e:MouseEvent):void {
removeChild(clist);
function loadnotice1(Event:MouseEvent):void//FRAME 9 FUNCTION FOR IMPORTANT NOTICE
if ( count == 1 && stage.contains(pop1))
removeChild(pop1);
if(count == 1)
nextFrame();
else
addChild(pop1);
pop1.x = 40;
pop1.y = 120;
count = 1;
trace("Counter Value:" + count);
function loadnotice2(Event:MouseEvent):void//FRAME 9 FUNCTION FOR IMPORTANT NOTICE
if ( count2 == 1 && stage.contains(pop2))
removeChild(pop2);
if(count == 2)
nextFrame();
else
addChild(pop2);
pop2.x = 40;
pop2.y = 120;
count2 = 1;
trace("Counter Value:" + count);
function loadnotice3(Event:MouseEvent):void//FRAME 9 FUNCTION FOR IMPORTANT NOTICE
if ( count3 == 1 && stage.contains(pop3))
removeChild(pop3);
if(count == 3)
nextFrame();
else
addChild(pop3);
pop2.x = 40;
pop2.y = 120;
count2 = 1;
trace("Counter Value:" + count);
function nextframe9(event: MouseEvent): void
if(count == 1 && stage.contains(pop1) )
removeChild(pop1);
if(count == 1)
nextFrame();
else
addChild(pop1);
pop1.x = 40;
pop1.y = 120;
count = 1;
function nextframe13(event: MouseEvent): void
if(count2 == 1 && stage.contains(pop2) )
removeChild(pop2);
if(count2 == 1)
nextFrame();
else
addChild(pop2);
pop2.x = 40;
pop2.y = 120;
count2 = 1;
function nextframe17(event: MouseEvent): void
if(count3 == 1 && stage.contains(pop3) )
removeChild(pop3);
if(count3 == 1)
nextFrame();
else
addChild(pop3);
pop3.x = 40;
pop3.y = 120;
count3 = 1;
function backbtnscript1(event:MouseEvent):void
if(stage.contains(pop1) )
removeChild(pop1);
backcounter = 1;
trace("back" + backcounter);
prevFrame();
function unloadbtn1 (e:MouseEvent):void {
removeChild(pop1);
function backbtnscript2(event:MouseEvent):void
if(stage.contains(pop2) )
removeChild(pop2);
backcounter2 = 1;
trace("back" + backcounter2);
prevFrame();
function unloadbtn2 (e:MouseEvent):void {
removeChild(pop2);
function backbtnscript3(event:MouseEvent):void
if(stage.contains(pop3) )
removeChild(pop3);
backcounter3 = 1;
trace("back" + backcounter3);
prevFrame();
function unloadbtn3 (e:MouseEvent):void {
removeChild(pop3);
//SLIDE COUNTER
and here is the Code on all the Frames where I need to call in specific Listeners
FOR EXAMPLE ON FRAME 8,9,10,
Here Is the Code ,
FRAME 8
stop();
slidecounter.text = String(this.currentFrame - 1 + "/" + indexframe);
count = 0;
backcounter = 0;
btn_nxt.addEventListener(MouseEvent.CLICK , fl_ClickToGoToNextFrame);
btn_bck.addEventListener(MouseEvent.CLICK, backbtn);
btn_bck.removeEventListener(MouseEvent.CLICK , backbtnscript1);
btn_nxt.removeEventListener(MouseEvent.CLICK , nextframe9);
pop1.closebtn.addEventListener(MouseEvent.CLICK, unloadbtn1);
//btn_notice1.addEventListener(MouseEvent.CLICK , loadnotice1);
FRAME 9
stop();
slidecounter.text = String(this.currentFrame - 1 + "/" + indexframe);
//POPUP FUNCTION
count = 0;
btn_nxt.removeEventListener(MouseEvent.CLICK , fl_ClickToGoToNextFrame);
btn_bck.removeEventListener(MouseEvent.CLICK, backbtn);
btn_bck.addEventListener(MouseEvent.CLICK , backbtnscript1);
btn_nxt.addEventListener(MouseEvent.CLICK , nextframe9);
btn_notice1.addEventListener(MouseEvent.CLICK , loadnotice1);
FRAME 10
stop();
slidecounter.text = String(this.currentFrame - 1 + "/" + indexframe);
count = 0;
backcounter = 0;
btn_nxt.addEventListener(MouseEvent.CLICK , fl_ClickToGoToNextFrame);
btn_bck.addEventListener(MouseEvent.CLICK, backbtn);
btn_bck.removeEventListener(MouseEvent.CLICK , backbtnscript1);
btn_nxt.removeEventListener(MouseEvent.CLICK , nextframe9);
pop1.closebtn.addEventListener(MouseEvent.CLICK, unloadbtn1);
I am repeating this Pattern on each frame set where I need these Listeners ,
Problem is with the next one where I have two consecutive frames have different conditions to meet, any ideas how would I disable and enable listeners respectively on these frames ?
I hope I am not confusing this very much ?;( -
GotoAndPlay specific frame in external swf from main swf
I have a main swf that loads 2 external swfs.
I click on button to see content of external swf #1 and see stuff. I do something that causes external swf to show other stuff (i.e. not at beginning state)
In the main swf I click on button to see content of external swf #2. External swf #1 content is made invisible and I see content of external swf stuff.
NOW, if I click on button to take me back to see external swf #1, I see it's content in current state. I want to force it to start over again at frame #1 which will reset content.
However, no matter what I try, I can't seem to control which frame to go to in external swf using gotoAndplay.
Here is code in frame #1 of main swf to load external swfs:
//load academic movie
var swfLoader1:Loader = new Loader();
container1.addChild(swfLoader1);
var url1:URLRequest = new URLRequest("academic.swf");
swfLoader1.load(url1);
//load wisdom movie
var swfLoader3:Loader = new Loader();
container3.addChild(swfLoader3);
var url3:URLRequest = new URLRequest("wisdom.swf");
swfLoader3.load(url3);
Here is code in frame 2 of main swf that checks button to see where to go in external swf:
//academic button clicked
function academicClick(event:MouseEvent){
container3.alpha = 0;
container3.visible = false;
container1.visible = true;
container1.gotoAndPlay(1); //this is where I am trying to force it to start at frame 1
container1.alpha = 1;
I don't want to reload the external movie to force it to start over.
Any help would be much appreciated.You can easily control this by making the external swf to load with your movieclip, The below is the code snippet that clear on accessing the specific frame on external swf.
//Loading clips content
var ldr:Loader;
var mcExt:MovieClip;
//Loading
loadswf("external.swf");
function loadswf(tmp:String):void{
unloadSwf();
ldr= new Loader();
ldr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener);
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
ldr.load(new URLRequest(tmp));
function progressListener (e:ProgressEvent):void{
ploader.visible=true;
function swfLoaded(e:Event):void {
mcExt = e.target.content as MovieClip;
ldr.contentLoaderInfo.removeEventListener(Event.COMPLETE, swfLoaded);
mcExt.addEventListener(Event.ENTER_FRAME,onEnterfn);
ploader.visible=false;
addChild(mcExt);
//UnLoading
function unloadSwf():void{
if (ldr!=null){
ldr.unloadAndStop();
removeChild(mcExt);
mcExt=null;
//Intervals (The part you work on the specific frame within the external swf
function onEnterfn(e:Event):void{
var num:int=mcExt.currentFrame;
if (num==1) mcExt.play();
if (num==9) {
mcExt.skipmc.addEventListener(MouseEvent.CLICK,skipfn);
function skipfn(e:MouseEvent):void{
mcExt.stop();
mcExt.removeEventListener(Event.ENTER_FRAME,onEnterfn);
gotoAndStop("help");
if (num==mcExt.totalFrames){
mcExt.removeEventListener(Event.ENTER_FRAME,onEnterfn);
gotoAndStop("help");
hope it solve -
Opening new page to a Specific frame
I am still learning Action Script but I have a problem with
writing the full script for combing navigate to new URL and
gotoAndPlay. More specifically what I want to do is use a button
which when clicked will open a new page and then start playing my
Flash movie at a certain frame on the Timeline. I have used buttons
to navigate to a new URL and used the gotoAndPlay ( ) ; command to
play a certain frame, both have been successful but when I combine
the two I run into trouble. What happens is the new page loads
correctly and goes to the specific frame but then opens the browser
in a new window with the movie playing from the beginning. The
correct sequence within the correct Webpage is playing but only if
I close the current page, in other words what I am trying to
achieve is running but in the background.
I have attached some of the code I have tried if that helps.
Many Thanks.How extensive are the corresponding text changes on the HTML
page? How many HTML pages are there? The reason I am asking is that
if HTML content is not big - your best bet may be to load all the
HTML content at once and hide/unhide parts of it based on the
commands that come from Flash.
But if you are sticking to your guns:
Your use case, as you described it, is:
1. user clicks a button on a column
2. the column clicked moves across the movie
3. the movie starts to play a different section
4. the text on the web page changes to match the new movie
sequence.
There is a problem here - No 4 requires browser reloading. I
believe user experience will not be all that good because of the
visual break (new html page loading) after all the animation
sequence after the click occurs. Perhaps a better experience can
be:
click --> load appropriate page --> perform animation
sequence.
As for the variables that you add to the request,
conceptually it is not different from appending url variables to
the url string:
You can do it this way:
var url:String =
"www.domain.com/mypage.html?myVariable1=something&myVariable2=somethingElse";
Or you can do it this way:
ar url:String = "www.domain.com/mypage.html";
var variables:URLVariables = new URLVariables();
variables.myVariable1 = "something";
variables.myVariable2 = "somethingElse";
var request:URLRequest = new URLRequest(url);
request.data = variables;
I hope you see the similarity. The result is the same - Flash
sends request with the variables.
You may perceive the second way as more cumbersome but there
are several advantages of doing it this way. One of the most
important is that Flash automatically makes variables values url
formatted which is critical when you send strings with special
characters. In addition, when you send many variables - it is much
more manageable than keeping track of the variable and making
assignments in one-line url string.
How you deal with it further depends on how good you are with
HTML and JavaScript OR server side processing.
Say you need to start your Flash movie from a certain frame
(say No 50). You may want to:
1. Load HTML page with a url that contains a frame number:
variables.startframe = 50;
2. You need to read this variable with JavaScript and write
an appropriate embed tag. There are several ways to do that. Read
about FlashVars. It could be (in the embed tag):
src="myMovie.swf?startframe=50" where 50 comes from browser
location string.
3. Inside Flash you will utilize LoaderInfo.parameters method
to extract the value of the variable startframe.
4. Write code that will perform and animation based on this
variable/parameter.
I guess a question is "How good are you at HTML and
JavaScript?" -
Going to a specific frame in a clip on another page
As may be self evident I am not an expert..... Is it possible
for a button (or series of buttons) on one page which, when
clicked, opens another html page with an embedded swf movie and
then goes to a specific frame in that movie ???
If that makes senseno - simply put, if the html page/SWF and frame isn't loaded
when button is pressed - there isn't a
way because it doesn't exist yet.
Chris Georgenes / mudbubble.com / keyframer.com / Adobe
Community Expert
LindnArden wrote:
> As may be self evident I am not an expert..... Is it
possible for a button (or
> series of buttons) on one page which, when clicked,
opens another html page
> with an embedded swf movie and then goes to a specific
frame in that movie ???
>
> If that makes sense
> -
Hello,
Form POST targeting to specific frame or dialog popped up via window.open() no longer works in IE11.
It worked fine in IE10 and all previous versions of IE.
Please see screenshot attached with simple test that reproduces this problem.
Direct Link to screenshot:
http://173.231.98.44/cgi/TestFolder/IE_11_widow_frame_targeting_BUG.jpg
Direct link to simple test page demonstrating this problem:
http://173.231.98.44/cgi/TestFolder/page2.asp
Note: IE11 doesn't report any errors, doesn't complain about anything, even when debugged via F12 developer tools. The only thing it complained initially was missing doc type declaration on top of page, but even after adding doc type definition, problem still
persists, makes no difference.
I tested this on fresh install of Windows 2012R2 while testing our web application with the new IE11.
I believe doing this on Windows 8.1 with IE11 will result in same bug/problem.
Our web application uses a technique whereby it launches a popup window via call to window.open(), passing blank URL and specifying a name for the new window. It then does a from post targeting the name of new dialog.
In IE11 this functionality has been broken and no longer works.
Problem is that IE11, instead of posting form to the newly created dialog, it launches a new instance of IE and then loads the requested form in this new instance of IE, while the dialog launched via window.open() remains on screen and is empty. If user repeats
launching same form post request (via button click for example), IE 11 keeps creating new empty dialogs and new IE instance for every form post executed. This totally breaks our application because we use many so called "wizards" that encapsulate
specific functionality in separate web page launched in a popup window.
Another related problem is that if a dialog is launched with window.open(), the java script code in the dialog can not target the parent frame that opened the dialog anymore. In our application, when a dialog is closed, it typically needs to trigger a refresh
of a specific frame within the parent window (again targeted by name) to reflect saved/updated info that user entered in the popup dialog. The result is that we can't refresh the parent frame after the pop up dialog closes. Instead, IE11 launches
a new instance of IE (not just a tab, but a whole new instance) and loads the parent frame in it.
The problem seems to be caused by broken frame name targeting mechanism in IE11.
Note that we force IE to compatibility mode 5, but even without specifying any compatibility, the problem remains.
Typical java script to reproduce this is:
<input type="button" onClick="Popup(this.form);" name="btn2" value="Popup Dialog">
function Popup(f){
window.open("","MyNewDialogName","width=200,height=150");
f.action = "page3.asp";
f.target = "MyNewDialogName";
f.submit();
Expected: IE11 should correctly post form to and load targeted page in the newly popped up dialog, without opening new IE instance and new tab. Repeatedly posting form to existing popup window should reuse that window, not keep on launching more popup windows
and then more IE instances.
Steps to reproduce the problem (include URL if applicable):
URL with sample page: http://173.231.98.44/cgi/TestFolder/page2.asp
1) Create page1.htm: <html><body>display "I'm in a popup window now ..."</body></html>
2) Create page2.htm with a button and onclick() event calling function to open dialog, and do form POST targeting new dialog calling page1.htm, like below.
<input type="button" onClick="Popup(this.form);" name="btn2" value="Popup Dialog"> function Popup(f){
window.open("","MyNewDialogName","width=200,height=150");
f.action = "page1.asp";
f.target = "MyNewDialogName";
f.submit();
3) Open IE11, navigate to page2.htm, click the "Popup Dialog" dialog button. IE 11 will popup the new dialog, but then it will also launch new instance of IE11 and display the page1.htm in it, instead of in the popup dialog.
Has anyone else encountered this problem?
Any insight or help is appreciated.
Regards
Peterthe default action of <input type="button" is submit. Note also that the default type of <button> elements is 'submit' also.
add a return false to the onclick inline event handler (which constructs the form submit attribues) to cancel the default form.submit behavior.
form elements have a target value with which you can specify the name window into which you want the form to open in.
<form action="process.aspx" target="popup">
you can use the window.open method with a query uri to achieve the same outcome.
window.open('process.aspx?s=search+term&foo=bar','popup',{features})
the outcomes of all scripted windows are affected by
your IE Popup blocker and tabbed browsing settings
which in turn is affected by your IE Security zone settings (for popup blocking handling)
and the settings of any third-party popup blocker you may have installed and enabled... it may not necessarily be visible on your browser toolbar.
The first step in troubleshooting web browser issues is to test in no-addons mode.
Use the Developer Tool to find out what documentMode the test page is opening in on your system. On Modal/Modeless popup windows use the f12 key to display the Developer tool positioned on the contentWindow.
Use File>Properties to find out what IE Security zone it maps to... there is a security setting to prevent navigation into zones of lower integrity.
Rob^_^ -
Can an swf movie be opened on a specific frame?
When I call up an Flash-generated swf movie in its own
browser window via a navigation bar button, it always open on its
first frame. Is there a way to tell the browser in conjunction with
the getURL command to open at a specific frame other than frame 1?
I can't find an Actionscript code sample that allows this while
using getURL. Or is there some other way -- e.g. appending the swf
file with frame number in its HTML page in some way, using
Javascript, FSCommand, etc?
JodyMaybe this will help
http://www.adobe.com/devnet/flash/articles/deep_linking.html -
Jumping to a specific frame in another movie
I'm wondering how to jump to a specific frame in an external
movie. I'm not using the loadmovie command so I don't think the
_level command will work. I just have two swf movies playing on the
same page. I need to have a button in Movie A when released will go
to a certain frame in Movie B. Thanks!well this certainly should work if the code is on the main
timeline, and there is nothing else. However when you say
'scrubber' do you mean that your 'testing' the movie by pressing
'enter' while in the IDE, so that you're actually 'seeing' the
playhead move? If this is the case, yes, no actions will execute.
To test the swf file, use Ctrl+Enter (or Command+Enter on Mac) to
run an actual 'test' -
How to play a soud at specific frame?
I have the loading audio file at frame one. However, I want to play the audio only at specific frame or frame lable. How do I do that? Below are my codes:
//start of sound section is for sound
var soundReq:URLRequest = new URLRequest("FlashFiles/audioFiles/mySoundmp3");
var sound:Sound = new Sound();
sound.load(soundReq);
sound.addEventListener(Event.COMPLETE, onComplete);
//end of sound section
function onComplete(event:Event):void
sound.play();
The above plays the sound as soon as the .swf file is loaded. But I want to play at certain point in time, say frame number or frame lable.Okay, here are my code in frame one:
//start of sound section is for sound
var soundReq:URLRequest = new URLRequest("FlashFiles/audioFiles/Alma Mater plus roc.mp3");
var sound:Sound = new Sound();
sound.load(soundReq);
//sound.addEventListener(Event.COMPLETE, onComplete);
//end of sound section
this.addEventListener(Event.ENTER_FRAME, playSound);
function playSound(e:Event)
if(e.currentLabel == "lblStartSound")
this.removeEventListener(Event.ENTER_FRAME, playSound);
sound.play();
this.btn_Skip.addEventListener(MouseEvent.MOUSE_DOWN, skipFlash);
function skipFlash(event:MouseEvent):void
gotoAndPlay("frm_Ending");
sound.stop();
Errors I got are:
1119: Access of possibly undefined property currentLabel through a reference with static type flash.events:Event.
Source: if(e.currentLabel = "lblStartSound")
1061: Call to a possibly undefined method stop through a reference with static type flash.media:Sound.
Source: sound.stop();
Eventually, if the user click the skip button, I want to stop the sound. -
Is it possible to load an external swf at a specific frame?
Hey! I've got a flash file which acts as the main menu for a
program I'm developing. Everything works fine from the main menu
however when you click to return to the main menu the whole main
menu file reloads. Is it possible to use loadMovieNum( ) to go to a
specific frame within the main swf file? If not, is there a way to
do this?
Here's the button code I'm using now:
on (release) {
unloadMovieNum(0); //unloads the current movie so we can
reload the main menu
loadMovieNum("DemoMainMenu.swf", 0); //reloads the main menu
Thank you for whatever help you can provide! :)mcommini wrote:
> Hey! I've got a flash file which acts as the main menu
for a program I'm
> developing. Everything works fine from the main menu
however when you click to
> return to the main menu the whole main menu file
reloads. Is it possible to
> use loadMovieNum( ) to go to a specific frame within the
main swf file? If
> not, is there a way to do this?
First let me clarify one thing with you. Level zero is the
main level on the flash
player. By loading things in level zero you will remove
current content and replace
it with the new one. This is not a good idea because it works
like purge, clears the
player and from there on you can't maintain any functionality
unless you reload the
whole html document over again. Also, do not unload and load
in the same time in the
same level. Flash can hold single SWF per level, once you
load content, whatever previously
loaded will be automatically replaced, so just the loadMovie
action and you all set.
Good practice is to have the main level (zero) an empty base
and than load and unload
things in above levels, 1 and so on...
> Here's the button code I'm using now:
> on (release) {
> unloadMovieNum(0); //unloads the current movie so we can
reload the main menu
> loadMovieNum("DemoMainMenu.swf", 0); //reloads the main
menu
> }
>
In regard to the load and go to. Yes it is possible but no
matter what frame you want to
go to,you need to load the whole movie first. I will come
back to that in a second.
While you execute the loadMovie action, you can set up a
variable, for example:
loadMovieNum("file.swf", 1);
Variable="mcommini_01";
Than in the loaded movie you have preloader which makes sure
that the movie is loaded before
playing and once done loading, make it jump to frame which
has IF ELSE condition in some kind
of loop, using setInterval or Enterframe. That condition
checks for the variable value and based
on it proceed to particular frame.
That's why I told you not to clear level zero, if you set
variable and load movie in that level
in the same time, all the information will be gone and you
have totally no reference point to
get the variable from.
You could as well use shared object which is native form of
Flash's cookies. Write SOL file into
user drive temp folder, than read it from the other file and
go to frame based on the given value.
Best Regards
Urami
Beauty is in the eye of the beer holder...
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami> -
Making a button appear dim after use
Hi,
I'm trying to work on a jeopardy game, and I pretty much suck
on coding. Anyhow, I was able to disable the button so that when
you go back to the board, the button no longer works, but I'd also
like to dim that button. Is there a way to do this? Or is there a
better solution out there?
Thanks!Nope, almost, but not quite. I get the dimming effect, but
only when I press on the button. My goal is to have that button
dimmed when I return to that frame.
This is what I'd like to have happen: I have the buttons on
my game board, when I click on a button I go to a specific frame
that houses the question, and on that frame I have a back button to
go back to the game board, and at that point, when you're back to
the game board, I want the button already pressed dim so that the
user knows not to click on it again.
Thanks for your help!
Maybe you are looking for
-
Firefox 3.6.3 fails to close itself, leaving an open instance in Task Manager of Windows 7 x64 each time the browser is closed. The instance needs to be closed manually in order to successfully start new browser session. This seems to happen in OEM v
-
Any help would be greatly appreciated.
-
Help needed in select statement
Hi gurus, I have a table with orderentry and ordertype case 1 : i want to get the set of records when ordertype =1 repeats case2: i want to get the set of records when there is no ordertype =1 CREATE TABLE test orderentry NUMBER, ordertype NUMBER INS
-
JSP compiler failure under Fedora Core 6
I recently upgraded a Linux Fedora Core 5 system to Fedora Core 6. I had a working JRun4 setup working perfectly under FC5 and it no longer works. I realize that this is an unsupported platform, but it seems like it is fairly close to working correct
-
Problem sending pdf files to convert to Word format
When I try to send a pdf file to be converted to Word format, I keep getting error message. "Unable to send" What's the problem?