[F8] Flash Ignores Stop
Hi all,
This is my first post so please excuse my ignorance.
My problem is I have created a flash with roll over buttons that have a command at the end that goes to Labels on the main time line which are different pages of the website.
this.onRelease = function() { _root.gotoAndPlay("WHATEVER PAGE");
Everything works fine and the pages stop as they should when going in the time line order but once the button goes to a Label (contact to home) that directs it to go to another Label (home) that is positioned before it, it will go there but after 10 secs it ignores all stop action scripts and goes right through the whole timeline.
HOME CONTACT CONTACT TO HOME ECT *-------------------*----------------------*----------------------*------
Its driving me nuts as im new to all this and do not understand why a simple Stop action does not work? Its completely thrown a spanner in the works. I have done this before on another flash file that works perfectly fine. Is there something wrong with the initial file setup such as linking buttons or movies to actionscript?
If anyone can shed some light it would be fantastic
Cheers.
FlashKit > Flash Help > Flash ActionScript
Posted on: 06-28-2008, 04:14 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Flash Ignores Stop();
Hi, I am creating a Flash site.
- I have a home.swf that has a link to Movie A.
- There is a link from Movie A to Movie B
When I click on link from home.swf to go to Movie A and then click on the link from Movie A to go to Movie B it all works perfect.
From Movie B, when I try to go back to Movie A the movie keeps on looping, ignoring the Stop(); commands.
- In my home.swf I have the home page on frame 5.
- I have Movie A as an external movie loaded into frame 10 of home.swf.
- I have Movie B as an external movie loaded into frame 15 of home.swf.
- Movie A and Movie B have their own preloader on their frame 1 and 2.
- Movie A and Movie B links uses _level0.gotoAndStop("frame name"); to tell the main timeline, which is home.swf to go to the "frame name"
This is the code I use for the links in Movie A and Movie B:
Code:
//Mouse release function - Disappear all page contents and
//saturate blur background. Then delay load the requested movie.
function onRelease(){
_parent._parent.page_contents._visible = 0;
_parent._parent.frost_panel._visible = 0;
_parent._parent.btn_navigationMenu._visible = 0;
_parent._parent.ani_background_transition.gotoAndPlay("background_blur");
delayLoad = setInterval(wait, 1000);
}
//Wait function - Delay loading of movie by 1000ms as
//commanded by mouse release function.
function wait() {
_level0.gotoAndStop("frame_contactus");
clearInterval(delayLoad);
}
Frame 5, 10 and 15 of home.swf have Stop(); commands.
So what I'm basicly trying to do is navigate back and forth on the frames on home.swf where Movie A and Movie B is externally loaded into. Instead, when I navigate back to frame 10 from frame 15 it loops back to frame 15 and then to 10 and repeats like that. Then for a split second I also see frame 5 and it does the loop of frame 15 and back to 10 and keeps repeating.
I'm not really sure why it doesn't stop at the frame it is told. Could it be because something is still forcing it to gotoAndStop at either frame 5, 10 or 15?
How do I stop it from looping?
Flash 8 As2.0 Suddenly Ignores Stop();
Hello everybody. This is my first post and I'm starting with a good one!
I'm creating a database viewer using php to generate xml to load into flash. Works great until suddenly, out of the blue, it doesn't anymore.
This is really what is going on: I'm coding, I'm running, coding, running, coding, running. And suddenly it started with my hairlines turning into strokes.
Couldn't fix it, not even with creating a new hairline in its place.
Then I ADD a square box to see if it also becomes a stroke en suddenly both are back to hairlines again... Ok, so far it worked so I delete the square box and run my fla. All is well...
Now a day later (working on a different machine even) I'm adding more code, running, everything is fine and then suddenly my stop(); commands are ignored! Which is after adding code like " t = 6 " or some other meaningless thing...
I'm thinking it's a flash 8 bug but can't find anything in forums or google..
Anyone familiar with this problem?
You help is greatly appreciated!
A Layer That Ignores The Stop(); Action?
hi i was wondering if there is any code to allow a singler layer to not be affected by stop(); command, im having a video play in the background of my flash production and it stops when it hits a certain frame and i want it to play til the correct frame. cheers in advance
Firefox Ignores Stop() On Embedded Movies?
Hi, I am publishing my first movie and I've had a terrible time dealing with an issue I'm having with Firefox. The problem I'm having is that firefox seems to ignore the stop() commands I have on embedded programs in my main program. So, when a button is pressed that opens these embedded programs, they just keep looping. I have tried putting stop() commands for these programs on the main timeline, but then the event listeners for the embedded programs are ignored. The strangest thing is that I've tested four seperate computers with the exact same version of flash (9) and firefox (2.0.0.11) and only two of the computers had the problem, while the other two worked fine (all computers with IE worked fine as well). To make things even weirder, the looping only occurs when the tabs in the main program are pressed in a specific order (open the climate change tab, close the climate change tab and both reactiver nitrogen and water connections loop). Please help!
Website:
http://wri-stage.eas.cornell.edu
FLA:
http://www.savefile.com/files/1337886
Loaded Movie Ignores Stop(); Action
Hi there
I'm loading and external swf file into my main movie. It's an animation that lasts about 100 frames and at the end of the external movie there is a stop(); action. when tested independently the movie plays and then stops at the end. when loaded into my main movie though, it plays through and then loops back to the beginning and ignores the stop(); action on it's final frame.
anyone have any ideas of what i'm doing wrong?
there is a stop(); action on the first frame of the main movie which is where the swf is loaded into.
cheers
e
Flash4 Ignores "stop()" In The First Frame Of A MovieClip
Hello,
Here you can see my current little flash project:
http://www.soulspring.de/temp/worldflash2/worldflash2.htm
or direct:
http://www.soulspring.de/temp/worldflash2/worldflash2.swf
A worldmap is displayed and when you move over the countries
another movie will zoom this country on the right side !
The problem is: With Flash5 the movie works fine !
But with Flash4 all movies for every country are playing from beginning
and loop, however I wrote in every "zoom" movie a stop() in the first frame
(and last frame) and call a gotoAndPlay(2) from the main movie.
How could this be ? What I do wrong ?
Here is the FLA of my project (I use Flash 5.0):
http://www.soulspring.de/temp/worldflash2/worldflash2.fla
Bye
Mario
Flash Ignores Everything
I am working on a website with a flash toolbar.
At first I thought that flash was simply not loading to the iframe, but its simply not respongding to commands at all. All of the animation work but even a simple... "getURL("www.example.com")" is not working.
It just doesn't do anything. Strange thing is when i am testing my movie within flash, up pops a window with www.example.com in it. So why the hell won't it work within my webpage ?
Flash 8 Ignores Registration Point
when i apply rotation (_rotation) to a movieclip with actionscript, i find that it totally ignores the registration point, while if i do it the motion->rotation blah blah way it works ok (the rotation is relevant to the registration point)... any ideas? Its really frustrating not to be able to rotate with actionscript...
Mac IE/Safari Ignores Flash Id / Name Property
Folks, hope someone may help me out on this one ...
I have a audioplayer like this ...
<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="585" HEIGHT="307" id="flashmovie" name="flashmovie">
<PARAM NAME=movie VALUE="pop/hotsite.swf?cd=<%=cd%>">
<PARAM NAME=menu VALUE=false>
<PARAM NAME=quality VALUE=best>
<PARAM NAME=bgcolor VALUE=#EEEEEE>
<EMBED id="flashmovie" name="flashmovie" src="pop/hotsite.swf?cd=<%=cd%>" menu="false" quality=best bgcolor=#EEEEEE WIDTH="585" HEIGHT="307" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
And a IFRAME on same file forces the Flash to reload on a new CD code ...
<script language="JavaScript">
function mpb(cod) {
parent.document.flashmovie.movie = "pop/hotsite.swf?cd="+cod;
parent.window.scrollTo(0,0);
}
</script>
<a href="javascript:mpb(15)" class="top-nav">Click</a>
The problem is on Windows works perfectly but no good for Mac ... it doesn't seem to recognize the Flash object ...
Grateful for ANY help.
Flash Ignores Parameter Play = False In Dreamweaver
I have a flash file that is completely ignore the parameter play=false. I've tried everything and it just plays as soon as the page loads. I've unclicked the autoplay option in dreamweaver. Any suggestions?
It Ignores My Commands
Ok guys so I have on my frame 45 and 89 this command
stop()
setInterval(play, 5000)
It does fram 45's command but it ignores frame 89's
Can anyone help me out?
HTML Ignores The <img> Tag
my text field does not show the <img> tag. please help me.
ActionScript Code:
scrll_bar._visible = false;
scrll_up._visible = false;
scrll_down._visible = false;
project_XML = new XML();
project_XML.ignoreWhite = true;
project_XML.load("projects.config");
project_XML.onLoad = function()
{
txt_projects.html = true;
txt_projects.htmlText = "";
var amount_of_prj = project_XML.firstChild.attributes.projects;
var counter = 0;
scrll_bar._height = scrll_bar._height * (2/amount_of_prj);
scrll_bar._y = 175 + (scrll_bar._height/2);
for (counter = 0; counter < amount_of_prj; counter++)
{
txt_projects.htmlText += "Project Name : " + project_XML.firstChild.childNodes[counter].firstChild.firstChild + "<br>Project Logo : <img src='" + project_XML.firstChild.childNodes[counter].childNodes[4].firstChild + "' height="50" width="100"><br>Project Website : <a href="" + project_XML.firstChild.childNodes[counter].childNodes[6].firstChild + "">" + project_XML.firstChild.childNodes[counter].childNodes[6].firstChild + "</a><br><br>" + project_XML.firstChild.childNodes[counter].childNodes[5].firstChild + "<br><hr color="#FFFFFF"><br>--------------------------------------------------------------------------------------------------------------<br><br>";
}
};
SwapDepths Ignores Layers?
Can someone tell me if this is true.. - it look like it is. When i use swapdepths, mc's move to the front, ahead of anything on upper layers... quite strange, i didn't think it would work like that...
TextField Ignores _alpha
I'm having trouble getting transparent textfields, even embedding the font doesn't work.
This code is from Adobe:
Code:
//aText.embedFonts = true;
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "Arial";
// where 'my font' is the linkage name of a font in the Library
this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 100, 22);
my_txt.border = true;
my_txt.embedFonts = true;
my_txt.text = "Hello World";
my_txt.setTextFormat(my_fmt);
my_txt._alpha = 50;
Slight alterations but from here:
http://livedocs.macromedia.com/flash...=00000809.html
Why the hell won't it work on my machine? It obviously can't find the font - how do I help Flash find it?
Actionscript Ignores Layers...
I have a movie that I created using actionscript that I want to fade in...
I created a fade in movie clip on a layer above the actionscript....
The fade in works (background images fade in) but everything that was created using actions doesn't....
Is there a way to fix this problem? (using a this.onTopOfAllActionscript haha)
Thanks
Edited: 02/21/2007 at 04:48:50 PM by mbrellisford
Swf Ignores Scenes, Buttons Dont Like It
Hi,
I have created a flash movie and I have 3 scenes. The first scene is the "intro" part of the site, the second scene is where the navigation is (currently a group that has a button in it), and scene 3 has the content part. When my button has the code goto and play scene 3 frame 1 it ignores the scene 3 and just goes to frame 1 of the movie. I previewed it in flash and found that frame 1 scene 3 is frame 416, so I changed the go and play to frame 416 and it loaded. Anyone have any idea why it ignores the scene 3 and basically combines all the scenes? I have a ton of content to add so it would be a really big pain to have to do it all in "one" scene.
You can view it here:
http://www.designsbybrandon.com/djm2/
Click on Event Services in the nav, it's the only one up so far.
Any help would be greatly appreciated!
Mc Ignores The X And Y Position If Its Set On The Main Timeline
Using FlashMX (y have to download the fla to understand the problem... theres no other way)
OK, lets go!
the question is: i have a lot of MC that are placed on stage like:
setProperty(i, _x, 30+random(width-60)
it works.......
the MC moves like:
meuX += anda * Math.cos(angle* rad);
where:
meuX = this._x;
anda = speed (set on the main timeline).
If i set meuX = 2*myRadius+random(_root.width-4*myRadius) they move OK
If i set meuX = this._x theres a bug: the MC paste to each untill the collision test goes false.
the problem is that i cant set the x and y position as a random number, because the MC cant overlap. I got a script that places the ball ok on stage (not overlapping), but it has to run on the main timeline, otherwise the program gets too busy.
This code is for my masters degree on Human Factors, its a software wich simulates the chemical reaction between H2 + I2 to 2HI, so its very important. Any help will be published on the papers about this software
Gabi
Mc Ignores The X And Y Position If Its Set On The Main Timeline
Mc ignores the x and y position if its set on the main timeline
Using FlashMX (y have to download the fla to understand the problem... theres no other way)
OK, lets go!
the question is: i have a lot of MC that are placed on stage like:
setProperty(i, _x, 30+random(width-60)
it works.......
the MC moves like:
meuX += anda * Math.cos(angle* rad);
where:
meuX = this._x;
anda = speed (set on the main timeline).
If i set meuX = 2*myRadius+random(_root.width-4*myRadius) they move OK
If i set meuX = this._x theres a bug: the MC paste to each untill the collision test goes false.
the problem is that i cant set the x and y position as a random number, because the MC cant overlap. I got a script that places the ball ok on stage (not overlapping), but it has to run on the main timeline, otherwise the program gets too busy.
This code is for my masters degree on Human Factors, its a software wich simulates the chemical reaction between H2 + I2 to 2HI, so its very important. Any help will be published on the papers about this software
Gabi
Nested Movie Ignores Stops
howdy,
im having a bit of an issue with a nested movie.
basically, when i call nested_mov.GotoAndPlay(frame); from another movie.
the nested movie plays, but ignores all the stop();
in the nested movie.
is this normal behavior or am i perhaps setting up my stops in the wrong manner.
more detail...
i have a clip that rotates 360 degrees.
the timeline has a stop every 12 frames (1/4 turn)
instance name circle_mov
that movie is placed in another movie that contains the controls
the controls are a next and back button
code for the next button
Code:
on(release) {
if(count > 48) {
count = count - 48;
}
circle_mov.gotoAndPlay(count);
count = count + 12;
trace(count);
}
_rotation Ignores Registration Point?
Hi.
Does _rotation ignore the MC's registration point? If so, how do I get around this? I have a MC that I set the registration point to the top right hand corner. And on the MC I have this code:
PHP Code:
onClipEvent(enterFrame) {
this._rotation += 5;
}
and it rotates, you guessed it, around the top left hand corner!!! Is there any way to make it NOT ignore where the registration point is set?
Thanks,
~j.
External Img Src Ignores Align And
Tags?
I've got a dynamic picture of the day that displays a different pic on each day of the year. The only thing that is not working is the align tags. In my img src string I've got align='center' but its not working. Also, I am trying to get a heading to show up under the pic, but the text box is ignoring both <br> and
tags and is instead putting the text beside the pic. Below is my code:
var dDay : Date = new Date();
PictureOfDay_txt.htmlText = "<img align='center' src='pics/PictureOfDay/Random_" + dDay.getDay() + dDay.getMonth + ".jpg'>
Some Picture Description";
I've tried using <br> instead of
but the pic always aligns left and the text is beside the pic vs underneath. I've also tried not putting any text in the htmlText box, but the pic still aligns left.
IE7/Firefox Keep Looping In CS3 (ignores AS3 Cmds)
I created an index.html and index.swf and placed them with the AC_Runactivecontent.js on the server after they worked fine locally. Now they run fine on the latest Opera and IE6, but with Firefox (1.5 and 2) and IE7 (WinXp) the flash keeps looping forever and I cannot touch any of the buttons or controls (also seems to ignore the AS3 commands including stop();) ?! Please help as I am new to Flash and CS3 especially. Oh, and it also runs fine on Vista's IE7 You can check the results at www.alifcc.com
I'm using the UIScrollBar component, and following is the actionscript used:
stop();
function oncontactClick(evt:MouseEvent):void {
gotoAndStop("contact");
}
function onaboutClick(evt:MouseEvent):void {
gotoAndStop("about");
}
function onsolutionsClick(evt:MouseEvent):void {
gotoAndStop("solutions");
}
function onclientsClick(evt:MouseEvent):void {
gotoAndStop("clients");
}
contact_btn.addEventListener(MouseEvent.CLICK,oncontactClick);
about_btn.addEventListener(MouseEvent.CLICK,onaboutClick);
solutions_btn.addEventListener(MouseEvent.CLICK,onsolutionsClick);
clients_btn.addEventListener(MouseEvent.CLICK,onclientsClick);
Edited: 06/23/2007 at 09:47:55 PM by bbokhowa
Rounding Numbers, But It Ignores Zeros
This is really frustrating, trying to get a countdown going here showing minuites and seconds, ex 2.34 remaining
but when it counts down to for example 2.30 it shows 2.3 or 2.00 as 2..
spent a few hours on finding a solution now, cant crack this one..
Code:
function remaining() {
_root.tid = Number(_global.Behaviors.Sound.mySound.duration / 1000);
_root.pos = Number(_global.Behaviors.Sound.mySound.position / 1000);
_root.rem = ((_root.tid - _root.pos)+100)/100;
_root.remain = Math.round(_root.rem * Math.pow (10, 2)) / Math.pow (10, 2);
};
this.onEnterFrame = remaining;
Key.getAscii() Ignores Int'l Keyboard Mappings?
has anyone here experienced weird getAscii results using international keyboards? it seems that getAscii always returns codes for english/american keyboard layouts, no matter what keyboard you use. i am using a german keyboard, it has the " on shift-2 for example. getAscii returns 64, the code for @, instead of 34.
anyone?
gx.
claus.
Movie Clip Reverse Ignores My Actions- Plz Help?
OK- first post here. I had posted it in Newbie but no avail so I deleted it to post here- hope that is cool.
so...
I made a movieclip that is a series of images that tween into center stage and stop every 12 frames.
I have successfully used a script to place buttons in the clip to play forward and backward, so you can navigate each way through the images.
but...when the back button is pressed it ignores the stop actions on the frames.
code:
function reverseMe(){
_root.mcStreet.onEnterFrame = function(){
if(_root.mcStreet._currentframe > 1){
_root.mcStreet.gotoAndStop(_root.mcStreet._current frame - 1);
} else {
_root.mcStreet.onEnterFrame = null;
}
}
}
button code is:
on (press) {
_root.reverseMe();
}
Text Ignores WordWrap, After A Couple Of Paragraphs
I dont get why this is happening. Check it out here:
http://www.visible-form.com/ff/ff_bubble.html , in the profiles section.
After a couple of paragraphs, the text just decides to ignore the wordwrap. I have tried just about everything - text, htmlText, its still doing it
LocalToGlobal/globalToLocal Ignores _xscale/_yscale?
For one reason or another i have a map and some buttons residing on the same level. Inside the map i have some other markers. I'm trying to scale the map and keep the marker's positions matched - so the ones on the same level as the map match the ones inside the map.
i'm doing a localToGlobal transformation to get the position but when the map scales the positions don't change. Which suggests the the transformation isn't taking into account the relative size of the map.
can anyone suggest an alternative route around this problem? I've tried several solutions for a couple of days now and don't seem to be able to match them up. multiplying the x and y positions of the markers by the _xscale and _yscale of the map doesn't seem to work...
Attached Movieclip Ignores Frame Actions
i made a movie that contains a tween, a stop frame, another tween, and a final stop frame.
i export for actionscript and give it a linkage id.
whenever i attach the movie, it plays right through the stop frames ignoring the frame actionscript.
what is causing this?
Event That Ignores Targeted Sprite's Decendents?
Hi
I have a container sprite that contains multiple other sprites. I want to set up a CLICK event listener targeted at the container that triggers a function whenever the mouse moves over the container, but ignores all of the container's children... I tried to set up this behavior using a conditional statement: if (e.eventPhase == EventPhase.AT_TARGET), but that doesn't seem to work. Are the decendent sprites obstructing the container sprite? Is there a way to set up an event that ignores certain display list members? Here's my code:
ActionScript Code:
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
import flash.events.EventPhase;
import flash.utils.Timer;
public class ThumbScroller extends Sprite {
private var scroller:Sprite;
private var contents:Array;
private var total:uint = 15;
private var xPos:Number = 0;
private var padding:Number = 10;
private var speed:Number = 3;
private var timer:Timer;
public function ThumbScroller() {
scroller = new Sprite();
for (var i:uint = 0; i < total; i++) {
var item:Sprite = new Sprite;
item.graphics.lineStyle(0, 0xFF000000);
item.graphics.beginFill(Math.floor(Math.random() * 0xFFFFFFFF));
item.graphics.drawRect(0, 0, 70, 70);
item.graphics.endFill();
scroller.addChild(item);
item.x = xPos;
xPos += item.width + padding;
}
scroller.addEventListener(MouseEvent.CLICK, mouseOverListener);
addChild(scroller);
}
private function mouseOverListener(e:MouseEvent):void {
if (e.eventPhase == EventPhase.AT_TARGET) {
trace( "scroller clicked");
}
}
}
}
Thanks
Flashvars Succeeds; Movie Ignores Passed Var.
Hello.
I have a site with a number of sub-project html pages linked to from a flash intro front end myintro.swf. This swf has 3 scenes called loader, intro and fb in that order.
Each sub-project page has a flash back button which has the following actionscript on it - the 347 in this case is the frame of the scene fb in myintro.swf I want to move the playhead to from this particular sub-project:
on (release) {
<snip>
getURL("http://www.mysite.net/htdocs/launch.html?skipTo=" + 347);
}
The launch.html page uses php to get the value of the var skipTo from this call and uses flashVars to pass the value to myintro.swf.
I've set a dynamic text box in myintro.swf with it's value variable skipTo so I can see the different frame numbers passed from the different sub-project pages. From this I can see that this method is passing the integer successfully into myintro.swf.
Now. I have this code in frame 1 of the loader scene of myintro.swf:
if (skipTo != "") {
gotoAndPlay("fb", skipTo);
}
but this code is ignored, and the user has to go through the loader and intro and into (the wrong place in) fb. As is hopefully obvious from this code, on release of the back button from above, I should end up in myintro, shortcutting straight past the loader and intro scenes and into frame 347 of scene fb.
Have I got this code wrong as far as actionscript 1 is concerned? It seems the simplest thing but it's not working for me at the mo.
Can anyone tell me where I'm going wrong?
Many thanks IA
S
Eps Into Flash8 From Freehand Ignores Clipping Path
Hi,
Flash8 is seeing vector lines beyond the clipping path when its exported as an eps from Freehand9 or MX.
I have a map with roads etc drawn in FH9, I have placed a box over that part of the map I wish to export as eps and cut contents then paste inside box. I now see just the map within the box. Export as eps. (I do this all the time). Open it into photoshop, it sees just out as far as the box border. No problem
However File >Import to Library in Flash 8 , then drag drop to stage, sees all the artwork outside of the box, stuff I don't want. No difference if exported as eps from MX. Trimming hundreds of roads etc down to the edge of the box is impractical for every eps I need to make, as I need to export each bus route on the map as a separate eps, and there are many !
Envirographics
Lib-linkaged-BitmapData Ignores The Width And Height?
Well, I have a bitmap imported to my lib, and I linkaged it with a name "PNGBitmapData",
Then I can use new PNGBitmapData(WW,HH) to create this bitmap, it's very convenient. But as the constructor of "BitmapData" receives two parameters as width and height, i can specify the size of this PNG image.
But no matter what number i use, even (0,0), the bitmap is just shown there. Nothing is different.
So, are these numbers just ignored by the FlashPlayer ?
Firefox Ignores Local Shared Object?
I just hit a strange problem when trying to use local shared objects (LSO) to tell flash to go to a specific frame if the page has been visited before and everything is loaded into the browser's cache already. This way the visitor doesn't have to see the preloader every time they press back.
My code works fine within flash and in IE6 (and presumably IE7) but the LSO is totally ignored in Firefox and I don't understand why. I always get the preloader in FF.
I might have coded this in a really stupid way and if there is a better way you are more than welcome to show me.
This code is in my first frame:
ActionScript Code:
stop();
var SO = SharedObject.getLocal("siteSO");
this.onEnterFrame = function() {
if ((_root.getBytesLoaded() == _root.getBytesTotal()) && (SO.data.visitedAlready)) {
gotoAndPlay("end");
trace("end");
delete onEnterFrame;
} else {
SO.data.visitedAlready = true;
SO.flush();
gotoAndPlay("preloader");
trace("preloader");
delete onEnterFrame;
}
};
This code is in my "preloader" frame:
ActionScript Code:
stop();
preloader.bar._xscale = 0;
this.onEnterFrame = function() {
var loadedPercent:Number = Math.round((100/_root.getBytesTotal())*_root.getBytesLoaded());
preloader.bar._xscale = loadedPercent;
if (loadedPercent>=100) {
preloader._xscale = 100;
delete this.onEnterFrame;
gotoAndPlay("start");
}
};
Mc Ignores The X And Y Position If Its Set On The Main Timeline (2nd Time I Post It)
Mc ignores the x and y position if its set on the main timeline
Using FlashMX (y have to download the fla to understand the problem... theres no other way)
OK, lets go!
the question is: i have a lot of MC that are placed on stage like:
setProperty(i, _x, 30+random(width-60)
it works.......
the MC moves like:
meuX += anda * Math.cos(angle* rad);
where:
meuX = this._x;
anda = speed (set on the main timeline).
If i set meuX = 2*myRadius+random(_root.width-4*myRadius) they move OK
If i set meuX = this._x theres a bug: the MC paste to each untill the collision test goes false.
the problem is that i cant set the x and y position as a random number, because the MC cant overlap. I got a script that places the ball ok on stage (not overlapping), but it has to run on the main timeline, otherwise the program gets too busy.
This code is for my masters degree on Human Factors, its a software wich simulates the chemical reaction between H2 + I2 to 2HI, so its very important. Any help will be published on the papers about this software
Gabi
How To Make The Wings Of A Fly Stop When The Flash Movie Stop?
Hello,
I made a simple "Fly Flying" flash animation. The wings of the fly are moving up and down while the fly is flying from one location to the other. My problem is:
The wings of the fly are still moving up and down when the fly is landed on the ground. I tried to add a stop(); action script at the last frame. However the wings are still moving even the movie is stopped.
How can I make the wings stop moving when the flash movie is stop? Please download and take a look at my flash file (fly_flying.fla):
http://space.uwants.com/batch.download.php?aid=313219
Thanks and best regards
Alex
How Can I Stop Flash From Looping And Stop On The Last Frame
I am having a problem with looping. I created a flash file and published it. I only want it to play through once and stop on the last frame. I can't get it to stop, it keeps looping through and playing the movie.
I have tried to add a layer that has some script in it with a start and a last tag on frame 1 and frame 310 there is 315 frames total.
the action script was
<code>
// this was in the first frame
ifFrameLoaded ("last") {
gotoAndPlay("start");
}
//this was in the second frame
gotoAndPlay(1);
//this was in the last frame 315
stop ();
</code>
your help is greatly appreciated.
skj
Preloader Ignores Preload "load Movie" Action With More Than Swf.files Being Loaded?
Why does the "preloader" ignores preload "load movie" action with more than one swf.files being loaded?
I have a basic preloader (in frame one)
ifFrameLoaded ("main", 120) {
gotoAndPlay ("main", 1);
}
(in frame 10)
gotoAndPlay(1)
and the main scene is (120) frames.
In the main scene, I placed a "call" action in the a keyframe to to my scripts MC label with a load action:
loadMovie ("lb.swf", lb);
loadMovie ("rb.swf", rb);
loadMovie ("tls.swf", tls);
loadMovie ("rc.swf", rc);
loadMovie ("tb.swf", tb);
When I test movie with streaming, proloader is not loading the movie. Why? But plays right ok.
Help?
Preloader Ignores "some" Functions
Hi all.
In the first frame of my movie I have a preloader that "tries" to calculate (getBytesLoaded == getBytesTotal) but it misses something.
I have my content in the 3rd frame. The structure is like the following:
1. Create XML object
2. XML.onLoad --> makeArrays();
3. Definition of arrays (not in a function)
4. function makeArrays() --> I'm taking the values from the xml file
5. (in the last frame of makeArrays function) --> profExp();
6. function profExp():
--- a. createEmptyMovieClip action
--- b. createTextField action
--- c. loading text into fields...
--- d. scrollFunction();
7. function scrollFunction() --> creates the scroll bar and attaches it to the text fields
8. function setRecentInfo(id:String) --> creates text fields and loads their content from their arrays unless it's "prof". For this, it only moves the position of the mc created with profExp() into the stage.
Now.. What happens is when the page is loaded (preloader quits), if you press the "prof" button, t does not load anything, or at least it seems like that. You either have to wait for 1-2 secs in the beginning for its content to load (which actually is loaded offset of the scene with profExp() function), then press it and no problem, or you should spend time with some other button prior and eventually enough time will have passed.
My code is quite long (327 lines without comments). I thought this might be one of the reasons, but I'm sure there should be a workaround like to modify the order of functions, etc...
By the way, I have the following script in the first frame:
PHP Code:
stop();bytes_loaded = Math.round(getBytesLoaded());bytes_total = Math.round(getBytesTotal());if (bytes_loaded == bytes_total) { gotoAndStop(3);}
and have the animating mc in this frame.
I'm thinking, maybe it's because -although preloader tries to see what is loaded in the following frames- parsing the xml and the functions afterwards are not taken into account by the preloader.(?)
Any idea is appreciated. I'm stuck.
Include 'samp.as' Ignores Include Folder?
It seems that "include" only looks in the host FLA files folder. Back in 8, I recall placing files in your (and I paraphrase:) "%profile%localappdataflashenconfigInclu de" folder allowed centralized access to as files. I really need this, I can't have a few dozen copies of this file floating around the project structure when I need to make a change.
I see that an Include folder still exists, but I can't include anything that's in it, even the files that live there by default. Adobe help for CS3 indicates that this folder's function remains unchanged, but I just can't seem to make it go. Am I missing something here? This is a fresh load of Windows XP and CS4.
I know I can write a class that handles what I'm doing and just make it the document class; but I'd rather not. Any thoughts?
(I am also concerned that I'll just run into the same problem with the Class folder refusing to play ball...)
Stop Actionscript Function At A Specific Frame (stop Looping)
I want to stop an effect at a specific frame but I dunno how.
Do I have to put something in the code?
I'm confused.
Or just tell me how to stop it from looping.
Edit:
Is it possible to attach this to a movie clip? Then i can stop it or use onEnterFrame and then escape();
I actually have no idea what I am talking about. /Edit
Here is one of the code I borrowed:
MovieClip.prototype.placeInSpace = function(id) {
var ratio = this.focaldistance / Math.sqrt(this[id].z * this[id].z);
this[id]._x = this[id].x * ratio;
this[id]._y = this[id].y * ratio;
this[id]._xscale = this[id]._yscale = 1000 / this[id].z;
}
MovieClip.prototype.randomPlace = function(id) {
var radius = this.rmin + (this.rmax - this.rmin) * Math.random();
var polar = 2 * Math.PI * Math.random();
this[id].x = radius * Math.cos(polar);
this[id].y = radius * Math.sin(polar);
this[id].z = this.zmin + (this.zmax - this.zmin) * Math.random();
}
Here's the other code cause I can use two in my movie:
function mover() {
// Move the particle over time
this._y += this.speed;
this._yscale += 10;
this.speed++;
if (this._y>500) {
this._y = 0;
this.speed = Math.random()*10;
this._yscale = 100;
}
}
function starField(x, y, n) {
// Generate a starfield of specified dimensions with n stars
for (var i = 0; i<n; i++) {
var star = this.createEmptyMovieClip("star"+i, i);
var dot = star.createEmptyMovieClip("dot", 0);
star._rotation = Math.random()*360;
star._x = x;
star._y = y;
dot.lineStyle(0, 0xFFFFFF, 100);
dot.moveTo(0, 10);
dot.lineTo(0, 15);
dot.onEnterFrame = mover;
dot.speed = Math.random()*10;
}
}
starField(275, 200, 100);
[F8] Movie Plays > Stop > Reverse > Stop > Play
I am fairly new to involved action scripting. I have successfully scoured flashkit threads for years to get my answers but this one has been driving me crazy for the past couple days. I have tried numerous solutions but none of them do exactly what I am trying to do.
I am creating an online portfolio that I want to control with two buttons that will play forward on release and stop at every piece unless the user is pressing and holding down - I also would like the scrolling animation to play in reverse on press and stop at every piece unless press and hold which happens to be skateboards in this section. I am posting the .fla for this section. This is what I have been able to accomplish so far. I moved everything into the main timeline from a movie clip because I could not get that to work at all. Should I move it back to movie clip? I also want it to stop at the first board.
here is the code I was able to peice together that just plays continously without stops.
Empty movie clip on second frame.
PHP Code:
onClipEvent (enterFrame)
{
if (_root.goBack)
{
_root.prevFrame();
}
else
{
_root.nextFrame();
}
_root.frameNo = "Frame : " + _root._currentFrame;
}
Forward button.
PHP Code:
on (press)
{
_root.goBack = false;
}
Reverse Button.
PHP Code:
on (press)
{
_root.goBack = true;
}
I have only done basic stops; goToAndPLay, getURL and such I am a little out of my league here but I started the ball rolling and would like to make this work as I intended. Any help making this do anything close to what I am describing would be much appreciated
Cannot Stop Movie Clip - This.stop() Confusion
Hello,
In my pong game when someone scores a goal I want the ball to pause in the middle of the screen, wait xx seconds and then randomly move.
Code:
// Return to kick off position
this.stop();
this._y = 325;
this._x = 275;
a = 0;
var myInterval = setInterval(this, "wait", 30*1000);
This calls function wait that simply uses this.play(); to allow the ball to move again.(See below)
Code:
onClipEvent (load) {
this.wait = function() {
this.play();
clearInterval(myInterval);
};
}
However I cant EVER get the ball symbol to stop no matter what I do.
Ive included all the code attached to the clipevent for the ball below.
Im thinking it must be due to the nested loops or somethings, very very confused
Code:
onClipEvent (load) {
this.wait = function() {
this.play();
clearInterval(myInterval);
};
}
onClipEvent (enterFrame) {
//Kick Off, play whistle and select random direction from 4 diagonals
if (a == 0) {
_root.kickoffwhistle.start();
//Use variable to ensure random numbers are generated only once per game
var randNumber1:Number = Math.pow(-1, Math.floor(Math.random()*2));
//-1 ^1 or ^2 = 1 or -1
var randNumber2:Number = Math.pow(-1, Math.floor(Math.random()*2));
//move it on the y axis at -1 or 1 & //move it on the x axis at -1 or 1
this._y += this.randNumber1;
this._x += this.randNumber2;
++a;
//set a trigger to increment so only actioned once.
}
if (randNumber1>0) {
this._y += this.yspeed;
//move it on the y axis at the set speed
} else {
this._y -= this.yspeed;
//move it on the y axis at the set speed
}
if (randNumber2>0) {
this._x += this.xspeed;
//move it on the x axis at the set speed
} else {
this._x -= this.xspeed;
//move it on the x axis at the set speed
}
// Ball(this) collides with PL1 and ball travelling upwards then deflect off randomly {
if (this.hitTest(_root.P1footballman) && this.yspeed<0) {
// Define boundaries for collision detection
var pl1bounds:Object = _root.P1footballman.getpl1bounds(_root);
this._x = Math.round(Math.random()*(pl1bounds.xMax-pl1bounds.xMin))+pl1bounds.xMin;
//Revert direction of ball by using formula below
this.yspeed = this.yspeed*-1;
//Randomly play miss sound effect if ball in goal area
if (this._x>133 && this._x<450) {
var result = Math.round(Math.random()*2);
if (result == 0) {
_root.MissedGoal.start();
}
}
//play football kick & header sound
_root.footballkickorheader.start();
}
if (this.hitTest(_root.cpu) && this.yspeed>0) {
var cpubounds:Object = _root.P1footballman.getcpubounds(_root);
this._x = Math.round(Math.random()*(cpubounds.xMax-pl1bounds.xMin))+cpubounds.xMin;
this.yspeed = this.yspeed*-1;
if (this._x>133 && this._x<450) {
var result = Math.round(Math.random()*2);
if (result == 0) {
_root.MissedGoal.start();
}
}
//play football kick & header sound
_root.footballkickorheader.start();
}
//Roatation properties of the ball
i = getProperty(this, _rotation);
setProperty(this, _rotation, i+5);
//Rotate ball i degees per frame
_this.rotation = i;
//Player Scores routine
//If ball object is beyond defined CPU goal area
if (this._y<75 && this._x>133 && this._x<450) {
_root.goalcry.start();
_root.P1footballman.score++;
//add1 to the cpu score
_root.playertxt = 'PLY: '+_root.P1footballman.score;
//Play start whistle for KICKOFF
_root.kickoffwhistle.start();
//Return to kick off position
this._y = 315;
this._x = 275;
a = 0;
//Stop ball in correct position
this.stop();
//5 seconds then calls function "wait" to use this.play() to move ball
var myInterval = setInterval(this, "wait", 5*1000);
}
//CPU Scores routine
//If ball object is beyond defined Player goal area
if (this._y>470 && this._x>133 && this._x<450) {
_root.goalcry.start();
_root.cpu.score++;
//add1 to the cpu score
_root.cputxt = 'CPU: '+_root.cpu.score;
//Play start whistle for KICKOFF
_root.kickoffwhistle.start();
// Return to kick off position
this.stop();
this._y = 325;
this._x = 275;
a = 0;
var myInterval = setInterval(this, "wait", 30*1000);
}
if (this._x>620 || this._x<5) {
this.xspeed = this.xspeed*-1;
//if it hits an edge inverse the xspeed
_root.bounce.start();
//Play bounce side effect
}
if (this._y>470 || this._y<75) {
this.yspeed = this.yspeed*-1;
//if it hits the top or bottom of pitch inverse the yspeed
_root.bounce.start();
//Play bounce side effect
}
}
How To Stop Flash Movie Through Shockwave Flash Extern API
Hello, everyone!
I'm trying to to play flash movie and stop playing from a c++ application useing IShockwaveFlash interface. A movie can any movie including url or local file. I've succeeded to start movie play buf totally failed to stop. Any of the stop functions (including TStop*) do no seem to work. Here the peace of code attached.
What am I doing wrong? Have I understood anything totally incorrect?
Any answer whould be creately appriciated.
Attach Code
#import "PROGID:ShockwaveFlash.ShockwaveFlash" raw_interfaces_only, no_namespace
typedef CWinTraits<WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0> CFlashHostWindowTraits;
class CFlashHostWindow : public CWindowImpl<CFlashHostWindow, CWindow, CFlashHostWindowTraits>
{
public:
DECLARE_WND_CLASS(_T("JDS_FLASH_WINDOW_CLASS"))
CFlashHostWindow()
{
}
BEGIN_MSG_MAP(TaskbarWindow)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
MESSAGE_HANDLER(WM_COMMAND, OnCommand)
END_MSG_MAP()
LRESULT OnCreate(UINT, WPARAM, LPARAM, BOOL&)
{
RECT client_rect;
GetClientRect(&client_rect);
DWORD Style = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
_ControlWindow.Create(m_hWnd, client_rect, L"ShockwaveFlash.ShockwaveFlash", Style);
if (!_ControlWindow.IsWindow())
exit(0);
CComPtr<IShockwaveFlash> pFlash;
HRESULT hr = _ControlWindow.QueryControl<IShockwaveFlash>(&pFlash);
if (hr != S_OK)
exit(1);
//CComBSTR bstrMovie(L"http://xban.walla.co.il/banners/7/7/77105.swf");
CComBSTR bstrMovie(L"http://www.youtube.com/player2.swf?video_id=1G7Ll42IheA&l=277&t=OEgsToPDskLh4Fy8z6yXSM93r1mFuIJY&s=EC71CBEF1D1DDA58:53C662DC848F75CD");
hr = pFlash->put_Movie(bstrMovie);
return 0;
}
LRESULT OnDestroy(UINT, WPARAM, LPARAM, BOOL&)
{
::PostQuitMessage(0);
return 0;
}
LRESULT OnCommand(UINT, WPARAM wParam, LPARAM, BOOL&)
{
int MenuItem = LOWORD(wParam);
if (MenuItem == ID_FILE_STOP)
{
CComPtr<IShockwaveFlash> pFlash;
HRESULT hr = _ControlWindow.QueryControl<IShockwaveFlash>(&pFlash);
if (hr != S_OK)
exit(1);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// I've tried everything here, it does not seem to work, any help?
hr = pFlash->TStopPlay(bstrMovie);
hr = pFlash->Rewind();
hr = pFlash->Stop();
hr = pFlash->StopPlay();
hr = pFlash->Rewind();
hr = pFlash->put_FrameNum(0);
}
return 0;
}
private:
CAxWindow _ControlWindow;
};
Stop In Flash Mx
this is sorta to do with the advance rollover tutorial again...
http://www.kirupa.com/developer/flash5/advroll.asp
i was figuring out how to make the buttons, (it teaches you when you click the red thing that says 'for more information...click here')
so i'm reading it and in the first step, it says right click on the first frame and click actions. Then choose basic actions and stop.
So this is my quesiton, where do you find the stop in flash mx? thx for your help.
How Do I Stop Flash From Crashing?
Im trying to create a movie that will display about 150KB of text in a selectable text field.
Everytime i get to the frame/scene with the text on it, the movie freazes in the stand alone player, the browser or the Flash even application itself.
I've figured out that flash only seems to be able to show (or store) 65kb(approx) worth of raw text.
Can someone help and tell me a way that i'd be able to display more than that in the way im trying?
Can Flash 5 Handle this amount of text?
Any help would be much appreciated.
thanx
~phizm
Flash 5 - Stop Command
This should be easy. But it isn't.
I'm doing a preloader with the run protection (saw it in a tutorial somewhere on here and have the general idea just trying it out). However, I am just trying to make the movie stop using... stop;
So far I have two layers, one for an animation in the preloader, and one for main timeline.
The first fram does checks and things.
The second has the 'you cannot run this' (or will have)
The third onwards will be the rest of the preloader/movie.
I have put stop on the second frame and on the last fram yet when I check the 'publish preview' or press 'Ctrl+Enter' or 'Ctrl+Shift+Enter' it continues to loop.
I know it does because I have :
1) a test animation of the rest of the movie
2) a trace command which keeps printing
It has to be simple and I am wondering if someone can please point me in the right direction.
I'm just starting to use flash script more and have a background in VBA/VB coding.
Vince
Stop Zooming In Flash
Anyone has any idea how do I stop right click and zoom option in the exported swf file?
|