Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Autoloading A Url After .swf Plays Finish



how should i go abt doing this?

by using geturl() ?
i tried to insert geturl() @ the last frame . but the url load b4 the flash finish.... then i tried to insert
geturl() after the last frame ...sadly...it wont load =(



FlashKit > Flash Help > Flash ActionScript
Posted on: 09-18-2002, 03:26 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Autoloading A Picture From Out
Can anyone help!!
I'm trying to make an auto load image inside of a simbol from
out side " meaning from theserver i'll be running the website "
so this one can be updated on the movie flash everytime it loads.

;( please help asap

How Can I Make A Autoloading CD For My Switch Presentation
I am looking for help on taking my Swish Presentation and putting it on CD so that it will autorun when the cd is inserted.

Multiple LoadMovie Commands Causes Autoloading?
Hello all:

I have a unique issue. I have created a preloader that will preload multiple jpegs but for some reason once I hit more than three files at one time, Flash seems to take over and begin to fire the loadMovie commands prematurely. Is there a limit to how many files you can preload?

Thanks,

John

Multiple LoadMovie Commands Causes Autoloading?
Hello all:

I have a unique issue. I have created a preloader that will preload multiple jpegs but for some reason once I hit more than three files at one time, Flash seems to take over and begin to fire the loadMovie commands prematurely. Is there a limit to how many files you can preload?

Thanks,

John

Multiple LoadMovie Commands Causes Autoloading?
Hello all:

I have a unique issue. I have created a preloader that will preload multiple jpegs but for some reason once I hit more than three files at one time, Flash seems to take over and begin to fire the loadMovie commands prematurely. Is there a limit to how many files you can preload?

Thanks,

John

MP3 Player On Website-Plays Approx. 5-10 Seconds Of Song Then Restarts And Plays Thru
Hello,

I have an MP3 player that I have tweaked and modified on a website of mine for a friend.
Everything works fine--but it seems it will load a song and start playing 5-10 seconds of the song then restarts the song and plays it in full. Anyone have any idea why this would be happening?
The MP3 player is at www.peeler.ca and will start as soon as you get inside the website.
Could someone have a look and listen and see if you have any ideas?
I imagine it is some redundant code or something small. It is very annoying....

Thanks in advance...

MP3 Player On Website-Plays Approx. 5-10 Seconds Of Song Then Restarts And Plays Thru
anyone have any ideas as to why my player would play like 5 seconds of a tune....then restart it and play thru completely?
I was told maybe interval coding....but not sure what I am looking for....nothing appears to jump out at me.

I will upload the .fla source code and maybe someone will see something I dont- Or you can check out what it is doing on the website www.peeler.ca the player will start on its own as soon as you get in the main page of the website.

Any help is appreciated...I am stumped!

[MX04] Rollover One Movie Clip Plays It, And Plays Another. How?
Alright, so I've got two movie clips.
I have one, called fade_mc, which will play on rollover, and then play in reverse on rollout.
Here's the code for that, placed on a separate layer in the MC.

PHP Code:



stop();

this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}

this.onRollOver = function(){
rewind = false;
play();
}

this.onRollOut = function(){
rewind = true;
}




What I would like to do is add to this so that, upon rollover of this MC, other movie clips will play in a similar fashion, and play backwards upon rollout.
In this case it is a MC called dark_mc that I would like to have play.


Posted this in the newbie section to no avail, please help!

Rollover Plays Frames 1-5 Of Movieclip, Rollout Plays 6-10
Need help on this, i'm sure it's the most basic thing, but haven't found my answer thru the help files, etc !

I have a button which on rollover i need to play one of my movie clip animations from frame 1-5 (i have a stop action on frame 5), and on rollout i need it to play the rest of the animation (6-10).

at this point, i simply dropped the animation onto the 'over' state of the button, but don 't know where to go from here, if not back to the drawing board.

the button is called 'button1' and the movie clip is 'animation'.

if it's better to do this with an external movie clip, i'd be cool with that, too.

thanks for the help

ROLL_OVER Plays A MC And ON_CLICK Plays A MC?
I would like to have a series of buttons that onrollover play a MC on
stage and onclick play another MC on stage. I am currently using the
following code provided in another thread to make the movie clip play
onrollover:


function showGraphic(event:MouseEvent):void {
mSymbol.visible = true;
}

function hideGraphic(event:MouseEvent):void {
mSymbol.visible = false;
}

btn.addEventListener(MouseEvent.ROLL_OVER, showGraphic);

btn.addEventListener(MouseEvent.ROLL_OUT, hideGraphic);



I am also using the following code to hide the movie clip on load:

mSymbol.visible = false;


How can I modify this code to allow a user to also click on the button
and play a MC?

Thanks!!!!!

Clik Btn1,plays Some MC,Clik Btn2,hides & Plays MC
I'm trying to create a website with flash, and it has buttons and movie clips. What i want is, when i click on button1, it plays some movie clips, and when i click on button2, it hides the old movie clips and plays new movie clips.

i was trying variables and the "if" thing. but it wont work. hope you guys can help out. i've set the button1 with ' btn="album" ' and set some actions like ' if (btn="album) {play} ' but it wont work. please help me. maybe you guys can upload the flash file so i can understand easier.

(using flash 8)

Help - Flash Movie Plays Fast By Itself, But Plays Slow When Loaded Within Another Flash Movie
I have a flash website which I tried to update recently. In particular, I am updating my photo gallery which I load within another flash using loadMovie. Before updating it, everything worked fine. The update is not completed yet, but I notice that my photo gallery is playing extremely slow compared to before. I did add some new graphics such as fading in and stuff like that, but nothing serious. If I played the clip by itself, ie. typing in the actual photogallery.swf, it plays at full speed. When I run the photogallery through my regular website, meaning loading it through loadMovie, it plays very slow. The photogallery.swf is only 58k in size, so download speed shouldn't be the case. Nevertheless, I tried adding a IfFrameLoaded just in case but that didn't solve my problem. Anybody has any ideas why it might be playing slow when I'm using the loadmovie function and plays fine when I just reference it directly?

How To Finish This Job?
I want, that all my pictures acting like this one. SAMPLE What I must do next? Thanks!

Finish.tv
HI there,

Does anybody know where to start from in order to build something like www.finish.tv?

Thnx
Ll.

FINISH.TV
I was wondering if anybody has or has seen a tutorial for that kind of script (Seen on FINISH.TV) I'd like to replicate this effect! Any tips or help would be superb!

Need Some Help To Finish Off This Project.
Hello,

I was getting some help with this a few months back and juy
st wanted to finish the basic idea off so I can tart it up proper and get on with the flash stuff I can do.

Here's what needs to be accomplished.

1. Upon pressing the "Front" Button the object will spin and zoom to an enlarged front view on the object. I need to be able to press spin and get back into the rotational mode that the swf first loaded as. Basically play the Front zoom animation backwards and then jump to frame 1 of the spin animation. This also need to be done from the Rear Zoom View in the same fashion.

2. If the user is on either the Front Zoomed view or rear zoomed view i need to be able to make a smooth transition from one to the other. I.e Front Zoomed View -> Frame 1 of Spin animation -> Spin to Frame 19 (Rear View) and then play Rear Zoomed View animation. And then the same from the Rear view.

Im not great at all at action scripting so I can supply the fla for you to modify if you want. I would just like to get these 2 things operational so I can get on with the flash stuff I can handle

Here's the swf : http://www.btinternet.com/~adsr/ammonite3.swf

Drop me an email for the fla

Many thanks

Andy

Finish The Animation...
hi,
ive just started a game, i have it so that when u press the arrow keys, the character will walk and stop as soon as u let go of the keys, however, the same thing happens for his attacks, and i was wondering how to prevent it from happening (so that he does the whole attack animation)

ive added a rough example of what is happening
the keys are a,s,d,z,x,c,shift,and the arrow keys
('s' shows the best example of my problem)

Finish Frames
when i want to go to a specified frame i use a goto,

but when i click a button i first want to get other frames and after that play the asked frames.

how do i do this in actionscript

Need This To Finish Portfolio - Please Help
I'm just completing my new online portfolio and this is the very last thing I need to do. The portfolio has the main flash.swf, with each section being intro.swf, portfolio.swf, cv.swf and contact.swf. The buttons are on flash.swf and they load each subsequent swf into the movieclip "container".
On the portfolio, I have icons that represent each of my websites. When you click on one, a dark background slides to that position (basically so the icon you have selected has a dark border). In portfolio.swf, the sliding movieclip has the following Actionscript attached:

// ON the movieclip
onClipEvent (load) {
// Initial pos
_root.xpos=9.5
}

onClipEvent (enterFrame) {
// MOVING SCRIPT PART
var speed = 10;
var viscosity = 2;
xpos = _root.xpos;
//X Pos
difference = xpos-this._x;
xvelocity = (xvelocity+(difference)/speed)/viscosity;
this._x += xvelocity;
}

and on each of the buttons, I've put:

on (release) {
xpos=9.5;
}

(with different xpos for each button)

When I test this movie it works fine, but when I open flash.swf and click PORTFOLIO, the sliding box doesn't move. I am very new to ActionScript and would very much appreciate any help that could be given. Thanks in advance

Please Help Me Finish This Keyboard
See the attached file:

This keyboard is almost done thanks to the help of people on this forum, but I have a problem with it. It has two functions that I can't figure out how to code. the first is the "delete right" option, and the second is that on the machine that this emulates, the user is able to highlight the words with the stylus and hit delete right or delete left and all of the letters will delete.

Also, they can use the stylus to place the cursor anywhere in the text box. I can't figure out how to do these things...can someone please help? I've posted the file, if that helps. It was made in Flash 8.


Also, this is becoming quite urgent, as I have a deadline to meet Friday afternoon. Any help would be greatly appreciated.

Cant Finish Game
i have started to construct a racing game. i have the basic components, but i cant get it to that when u complete the 3 laps if goes to a new scene or frame stating that u won.

the coding for the lap counter looks like this:

onClipEvent (enterFrame) {
if (this.hitTest(_root.car) && once != 1) {
_root.lap++;
once = 1;
}
if (!this.hitTest(_root.car) && once == 1) {
once = 0;
}
}

.FLV On Finish, Gotoandstop
How do I detect when a flv has finished to do something???
Should be simple right?

Help Me Finish My Class
hi everybody.


I have set up a flash that scales my backgroundpicture proportionally, when the browser is resized.
check out an example here:
http://www.sharefemale.dk/Default.aspx?ID=4057

it works very nice.
my problem is, that I'm very inexperienced in making class'es, so all the code to scale the picture is in my first frame.
but I want this first frame coding to stop now

so I have tried putting the code from my .fla into an .as-file.
so far I managed the most of it:

here's the code in my .fla:

Code:
//imports
import ResizeableBackground;

var rb:ResizeableBackground = new ResizeableBackground("bw.jpg", stage.stageHeight, stage.stageWidth);

//init
stageInit();

function stageInit():void {
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.quality = StageQuality.BEST;
stage.frameRate = 30;
stage.showDefaultContextMenu = true;
stage.addEventListener(Event.RESIZE, onResize);
}

function onResize(e:Event):void {
myResize(stage.stageWidth, stage.stageHeight);
}

function myResize(_theWidth:Number, _theHeight:Number):void {
var _stageWidth:Number = _theWidth;
var _stageHeight:Number = _theHeight;

var ratio:Number = obj.width / obj.height;
if ((_stageWidth / ratio) >= _stageHeight) {
obj.width = _stageWidth;
obj.height = (_stageWidth / ratio);
}
else {
obj.height = _stageHeight;
obj.width = (_stageHeight * ratio);
}
}

var obj:Sprite = rb.getMovie();
addChild(obj);
and here is my class:

Code:
package {

import flash.display.MovieClip;
import flash.display.Sprite;
import flash.display.Stage;
import flash.net.NetStream;
import flash.net.URLRequest;
import flash.media.Video;
import flash.display.Loader;
import flash.events.Event;

public class ResizeableBackground extends MovieClip{

private var _netStream:NetStream;//
private var _video:Video;//
private var _loader:Loader;//loader to hold my picture
private var _scene:Sprite;

private var ratio:Number;//to make sure the picture and video is scaled correctly
private var duration:uint = 0;//duration of video
private var ready:Boolean = true;
private var listener:Object = new Object();
private var _theFeed:String;
private var _theHeight:Number;
private var _theWidth:Number;

private var _theKind:String = "";

trace("inside the AS");

function ResizeableBackground(theFeed:String, theHeight:int, theWidth:int){

_theFeed = theFeed;
_theHeight = theHeight;
_theWidth = theWidth;

trace("inside our as: _theFeed = "+_theFeed+" & _theHeight = "+_theHeight+" & _theFeed = "+_theWidth);

_scene = new Sprite();

var _videoOrNot:int = _theFeed.indexOf("flv");

if(_videoOrNot != -1) {
trace("it's a video!");
_theKind = "video";
setUpForVideo();//
} else {
trace("it's not a video");
_theKind = "picture";
setUpForPicture();//
}



}

function setUpForVideo():void {
trace("function setUpForVideo");
//set up the video
/*
var _netConnection:NetConnection = new NetConnection();
_netConnection.connect(null);
_netStream = new NetStream(_netConnection);
_netStream.client = listener;
_video = new Video(160, 120);
addChild(_video);
_video.attachNetStream(_netStream);
_netStream.play(_theFeed);

//eventListener
_netStream.addEventListener(NetStatusEvent.NET_STATUS, nsHandler);
*/
}

function setUpForPicture():void {
_loader = new Loader();
addChild(_loader);
_loader.load(new URLRequest(_theFeed));
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, pictureFullyLoaded);
}

function pictureFullyLoaded(e:Event):void {
trace("_loader.height = "+_loader.height+" & _loader.width = "+_loader.width);
ratio = _loader.width / _loader.height;

if ((_theWidth / ratio) >= _theHeight) {
_loader.width = _theWidth;
_loader.height = (_theWidth / ratio);
}
else {

_loader.height = _theHeight;
_loader.width = (_theHeight * ratio);
}

_scene.addChild(_loader);
trace("picture fully loaded");
}

public function getMovie():Sprite {
return _scene;
}
}
}
what I'd like from here is to have as little as possible in my .fla and as much as possible in my .as-file.. i. e. having a .fla-file that looks like this:


Code:
//imports
import ResizeableBackground;

var rb:ResizeableBackground = new ResizeableBackground("bw.jpg", stage.stageHeight, stage.stageWidth);
var obj:Sprite = rb.getMovie();
addChild(obj);
my problem is, that I cannot succesfully put the rest from the .fla into my .as-file. can anyone guide me to what to do from here?

picture, .as og .fla can be downloaded from here:
http://campjohn.dk/test/ResizeableBackground.zip


thanks, any help is very appreciated
felisan

I Cannot Finish This Function
I have several MC that move downwards. They all start with the same _y value and when they reach the "floor" I want them to go 20 pixels down all toghether with a continuous move. I'm stucked with this last action.

This is the code I have

ActionScript Code:
Movieclip.prototype.bounce = function(factor, posFinal, ratio) {    this.onEnterFrame = function() {        cont++;        this._y++;        if (cont>142) {            this.yPos = this.yPos*factor+(posFinal-this._y)*ratio;            this._y += this.yPos;            if (Math.abs(this._y-posFinal)<.1) {                delete this.onEnterFrame;                this._y = posFinal;            }        }    };};clip1.bounce(.7, 300, .55);clip2.bounce(.7, 300, .5);clip3.bounce(.7, 300, .455);clip4.bounce(.7, 300, .40);


So far, all the ways I tried make the MCs go 20 pixels down but not all at the same time.

Thanks.

Guestbook 89% Done.. Help Me To Finish It..
Guestboook.zip contains:
1.GuestBook.php //you need to initiate a mySQL Database Connection
2.install_guestbook.txt //SQL file
3.Guestbooook.swf
4.Guestbooook.fla

It's all working for me really nicely.. you can see it at www.schranz-com.org .. but it has a little bugs.. like for example after the Imput is sended the text boxes aren't clear.. or if it requireding valid name , e-mail adress the clear button just won't clear. Also I would like to ask how to import special characters from MySQL to text.. by special characters I mean for example "+" .. also if any of you know any tutorial or something on how to insert smilies..

AS for clear button:
on (release) {
yourname.text = "";
youremail.text = "";
yourcomments.text = "";
}

AS for submit button:
on(release) {
yourname = yourname.text;
youremail = youremail.text;
yourcomments = yourcomments.text;

// Check variable data
if (yourname eq "") {
gb_status.text = "Required: Name";
} else if (youremail eq "") {
gb_status.text = "Required: Email Address";
} else if (!youremail.length || youremail.indexOf("@") == -1 || youremail.indexOf(".") == -1) {
gb_status.text = "Required: Valid Email Address";
} else if (yourcomments eq "") {
gb_status.text = "Required: Comments";
} else {
gb_status.text = "Please wait...";
newEntry = new LoadVars()
newEntry.ref = this
newEntry.submit = "Yes"
newEntry.yourname = yourname
newEntry.youremail = youremail
newEntry.yourcomments = yourcomments
newEntry.sendAndLoad("GuestBook.php?action=write&r ="+random(999), newEntry, "POST")
newEntry.onLoad = function(success){
if(success){
gb_status.text = this.gb_status;
_parent.read.loadEntries("Default", 10);
yourname.text = "";
youremail.text = "";
yourcomments.text = "";
}
}
}
}

Moustly it's gonna be a path problem.. I have a hard time with that.. thnx

When The Flv Is Finish I Want To Load Another Swf
I will try to explain better what i want to do.

I have made a flv from Swift3D. It´s 20 frame long. I render out the 3D from Swift from frame 1 to 19 in a hard compressed format. The last frame (20) is in better compressed format. So the first swf (with the flv in it) load 1-19 frames. So how can i in the right time load the swf with frame 20 in it. Is it possible to use AS and cue point to unLoad and LoadMovies.

Please Help!


//Grebigcon

How To Know That FLV Finish Playing?
Good Day!

is some body help me how to know that the FlV file is finish playing?

I imported a Progressive video in my stage.. i just want to know if there is a function that will know that this flv finish in playing?

Hope some body will help me.. im stuck

Thanks

FLV // Need To Finish Some Code
Hi!, this is my first post, i hope i can from here be part of this community, ok here is my question:

im using a FLV as intro for a webpage, so, i want to preload or do the buffering and then start to run, im using this code

buffer_txt.html = true;

var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
stream_ns.setBufferTime(15);
myPlayer.attachVideo(stream_ns);
stream_ns.play("http://www.feedbackestudio.com/2m/demo4.flv");

var buffer_interval:Number = setInterval(checkBufferTime,100, stream_ns);
function checkBufferTime(my_ns:NetStream):Void {
var bufferPct:Number = Math.min(Math.round(my_ns.bufferLength/my_ns.bufferTime*100), 100);
var output_str:String = "<textformat tabStops='[100,200]'>";
output_str += "Buffering "+bufferPct+"%";
output_str += "</textformat>";
buffer_txt.htmlText = output_str;
}

and it works well, but what i want is to do some action when the movie ends. somebody have the code to do that?

thanx for your help!, and excuse my english im from argentina we speak spanish here

I Cannot Finish This Function
I have several MC that move downwards. They all start with the same _y value and when they reach the "floor" I want them to go 20 pixels down all toghether with a continuous move. I'm stucked with this last action.

This is the code I have

ActionScript Code:
Movieclip.prototype.bounce = function(factor, posFinal, ratio) {    this.onEnterFrame = function() {        cont++;        this._y++;        if (cont>142) {            this.yPos = this.yPos*factor+(posFinal-this._y)*ratio;            this._y += this.yPos;            if (Math.abs(this._y-posFinal)<.1) {                delete this.onEnterFrame;                this._y = posFinal;            }        }    };};clip1.bounce(.7, 300, .55);clip2.bounce(.7, 300, .5);clip3.bounce(.7, 300, .455);clip4.bounce(.7, 300, .40);


So far, all the ways I tried make the MCs go 20 pixels down but not all at the same time.

Thanks.

Can Someone Pls Finish This Drawing?
im not a good drawer. can someone finish it. can you make the head ,legs and arms seperate?

Please Help Me Finish My Class
hi everybody.


I have set up a flash that scales my backgroundpicture proportionally, when the browser is resized.
check out an example here:
http://www.sharefemale.dk/Default.aspx?ID=4057

it works very nice.
my problem is, that I'm very inexperienced in making class'es, so all the code to scale the picture is in my first frame.
but I want this first frame coding to stop now

so I have tried putting the code from my .fla into an .as-file.
so far I managed the most of it:

here's the code in my .fla:

Code:
//imports
import ResizeableBackground;

var rb:ResizeableBackground = new ResizeableBackground("bw.jpg", stage.stageHeight, stage.stageWidth);

//init
stageInit();

function stageInit():void {
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.quality = StageQuality.BEST;
stage.frameRate = 30;
stage.showDefaultContextMenu = true;
stage.addEventListener(Event.RESIZE, onResize);
}

function onResize(e:Event):void {
myResize(stage.stageWidth, stage.stageHeight);
}

function myResize(_theWidth:Number, _theHeight:Number):void {
var _stageWidth:Number = _theWidth;
var _stageHeight:Number = _theHeight;

var ratio:Number = obj.width / obj.height;
if ((_stageWidth / ratio) >= _stageHeight) {
obj.width = _stageWidth;
obj.height = (_stageWidth / ratio);
}
else {
obj.height = _stageHeight;
obj.width = (_stageHeight * ratio);
}
}

var obj:Sprite = rb.getMovie();
addChild(obj);
and here is my class:

Code:
package {

import flash.display.MovieClip;
import flash.display.Sprite;
import flash.display.Stage;
import flash.net.NetStream;
import flash.net.URLRequest;
import flash.media.Video;
import flash.display.Loader;
import flash.events.Event;

public class ResizeableBackground extends MovieClip{

private var _netStream:NetStream;//
private var _video:Video;//
private var _loader:Loader;//loader to hold my picture
private var _scene:Sprite;

private var ratio:Number;//to make sure the picture and video is scaled correctly
private var duration:uint = 0;//duration of video
private var ready:Boolean = true;
private var listener:Object = new Object();
private var _theFeed:String;
private var _theHeight:Number;
private var _theWidth:Number;

private var _theKind:String = "";

trace("inside the AS");

function ResizeableBackground(theFeed:String, theHeight:int, theWidth:int){

_theFeed = theFeed;
_theHeight = theHeight;
_theWidth = theWidth;

trace("inside our as: _theFeed = "+_theFeed+" & _theHeight = "+_theHeight+" & _theFeed = "+_theWidth);

_scene = new Sprite();

var _videoOrNot:int = _theFeed.indexOf("flv");

if(_videoOrNot != -1) {
trace("it's a video!");
_theKind = "video";
setUpForVideo();//
} else {
trace("it's not a video");
_theKind = "picture";
setUpForPicture();//
}



}

function setUpForVideo():void {
trace("function setUpForVideo");
//set up the video
/*
var _netConnection:NetConnection = new NetConnection();
_netConnection.connect(null);
_netStream = new NetStream(_netConnection);
_netStream.client = listener;
_video = new Video(160, 120);
addChild(_video);
_video.attachNetStream(_netStream);
_netStream.play(_theFeed);

//eventListener
_netStream.addEventListener(NetStatusEvent.NET_STATUS, nsHandler);
*/
}

function setUpForPicture():void {
_loader = new Loader();
addChild(_loader);
_loader.load(new URLRequest(_theFeed));
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, pictureFullyLoaded);
}

function pictureFullyLoaded(e:Event):void {
trace("_loader.height = "+_loader.height+" & _loader.width = "+_loader.width);
ratio = _loader.width / _loader.height;

if ((_theWidth / ratio) >= _theHeight) {
_loader.width = _theWidth;
_loader.height = (_theWidth / ratio);
}
else {

_loader.height = _theHeight;
_loader.width = (_theHeight * ratio);
}

_scene.addChild(_loader);
trace("picture fully loaded");
}

public function getMovie():Sprite {
return _scene;
}
}
}
what I'd like from here is to have as little as possible in my .fla and as much as possible in my .as-file.. i. e. having a .fla-file that looks like this:


Code:
//imports
import ResizeableBackground;

var rb:ResizeableBackground = new ResizeableBackground("bw.jpg", stage.stageHeight, stage.stageWidth);
var obj:Sprite = rb.getMovie();
addChild(obj);
my problem is, that I cannot succesfully put the rest from the .fla into my .as-file. can anyone guide me to what to do from here?

picture, .as og .fla can be downloaded from here:
http://campjohn.dk/test/ResizeableBackground.zip


thanks, any help is very appreciated
felisan

After Flv Finish Open New Swf
Last edited by grebigcon : 2007-01-10 at 14:23.
























if(info.code == "Netstream.Play.Stop") {
_root.container_3.loadMovie("supermarket_entre_10.swf");

---------------------------------------------------------------
The code above is the problem. How can i do to be able to open "supermarket_entre_10.swf"
I mean without me pushing some button. Can anybody help me .
--------------------------------------------------------------------
var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);

ns.setBufferTime(3);
ns.onStatus = function (info) {
if(info.code == "Netstream.Buffer.Full") {
bufferClip._visible = false;
}
if(info.code == "Netstream.Buffer.Empty") {
bufferClip._visible = true;
}
if(info.code == "Netstream.Play.Stop") {
_root.container_3.loadMovie("supermarket_entre_10.swf");

}
}



theVideo.attachVideo(ns);

ns.play("0214.flv")

playButton.onRelease = function() {
ns.pause();
}

rewindButton.onRelease = function() {
ns.seek(0);
}



var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;

ns["onMetaData"] = function(obj) {
duration = obj.duration;
}

function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * 257,2;
loader.scrub._x = ns.time / duration * 257,2;
}

var scrubInterval;
loader.scrub.onPress = function() {
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);
this.startDrag(false,0,this._y,252,this._y);
}

loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);
this.stopDrag();
}

function scrubit() {
ns.seek(Math.floor((loader.scrub._x/252) * duration));
}
ActionScript Code:
_root.container_3.loadMovie("supermarket_entre_10.swf");

Finish.tv Effect
finish.tv

I remember seeing the code for this pseudo 3d effect elsewhere. Does anyone know how to create this effect/style of navigation?

Thanks!

Please Help Me Finish My Class
hi everybody.


I have set up a flash that scales my backgroundpicture proportionally, when the browser is resized.
check out an example here:
http://www.sharefemale.dk/Default.aspx?ID=4057

it works very nice.
my problem is, that I'm very inexperienced in making class'es, so all the code to scale the picture is in my first frame.
but I want this first frame coding to stop now

so I have tried putting the code from my .fla into an .as-file.
so far I managed the most of it:

here's the code in my .fla:
Code:

//imports
import ResizeableBackground;

var rb:ResizeableBackground = new ResizeableBackground("bw.jpg", stage.stageHeight, stage.stageWidth);

//init
stageInit();

function stageInit():void {
   stage.scaleMode = StageScaleMode.NO_SCALE;
   stage.align = StageAlign.TOP_LEFT;
   stage.quality = StageQuality.BEST;
   stage.frameRate = 30;
   stage.showDefaultContextMenu = true;
   stage.addEventListener(Event.RESIZE, onResize);
}

function onResize(e:Event):void {
   myResize(stage.stageWidth, stage.stageHeight);
}

function myResize(_theWidth:Number, _theHeight:Number):void {
   var _stageWidth:Number = _theWidth;
   var _stageHeight:Number = _theHeight;
   
var ratio:Number = obj.width / obj.height;
   if  ((_stageWidth / ratio) >= _stageHeight) {
      obj.width = _stageWidth;
      obj.height = (_stageWidth / ratio);
   }
   else {
      obj.height = _stageHeight;
      obj.width = (_stageHeight * ratio);
   }
}

var obj:Sprite = rb.getMovie();
addChild(obj);


and here is my class:
Code:

package {

   import flash.display.MovieClip;
   import flash.display.Sprite;
   import flash.display.Stage;
   import flash.net.NetStream;
   import flash.net.URLRequest;
   import flash.media.Video;
   import flash.display.Loader;
   import flash.events.Event;
   
   public class ResizeableBackground extends MovieClip{
            
      private var _netStream:NetStream;               //
      private var _video:Video;                     //
      private var _loader:Loader;                     //loader to hold my picture
      private var _scene:Sprite;

      private var ratio:Number;                     //to make sure the picture and video is scaled correctly
      private var duration:uint = 0;                  //duration of video
      private var ready:Boolean = true;               
      private var listener:Object = new Object();
      private var _theFeed:String;
      private var _theHeight:Number;
      private var _theWidth:Number;
      
      private var _theKind:String = "";
      
      trace("inside the AS");
   
      function ResizeableBackground(theFeed:String, theHeight:int, theWidth:int){
                  
         _theFeed = theFeed;
         _theHeight = theHeight;
         _theWidth = theWidth;
         
         trace("inside our as: _theFeed = "+_theFeed+" & _theHeight = "+_theHeight+" & _theFeed = "+_theWidth);
         
         _scene = new Sprite();
         
         var _videoOrNot:int = _theFeed.indexOf("flv");
         
         if(_videoOrNot != -1) {
            trace("it's a video!");
            _theKind = "video";
            setUpForVideo();                  //
         } else {
            trace("it's not a video");
            _theKind = "picture";
            setUpForPicture();                  //
         }
         
         
         
      }
      
      function setUpForVideo():void {
         trace("function setUpForVideo");
         //set up the video
         /*
         var _netConnection:NetConnection = new NetConnection();
         _netConnection.connect(null);
         _netStream = new NetStream(_netConnection);
         _netStream.client = listener;
         _video = new Video(160, 120);
         addChild(_video);
         _video.attachNetStream(_netStream);
         _netStream.play(_theFeed);
                  
         //eventListener
         _netStream.addEventListener(NetStatusEvent.NET_STATUS, nsHandler);
         */
      }
      
      function setUpForPicture():void {         
         _loader = new Loader();
         addChild(_loader);
         _loader.load(new URLRequest(_theFeed));
         _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, pictureFullyLoaded);
      }
      
      function pictureFullyLoaded(e:Event):void {
         trace("_loader.height = "+_loader.height+" & _loader.width = "+_loader.width);
         ratio = _loader.width / _loader.height;
         
         if  ((_theWidth / ratio) >= _theHeight) {
            _loader.width = _theWidth;
            _loader.height = (_theWidth / ratio);
         }
         else {

            _loader.height = _theHeight;
            _loader.width = (_theHeight * ratio);
         }         
         
         _scene.addChild(_loader);
         trace("picture fully loaded");
      }

      public function getMovie():Sprite {
         return _scene;
      }   
   }
}


what I'd like from here is to have as little as possible in my .fla and as much as possible in my .as-file.. i. e. having a .fla-file that looks like this:

Code:

//imports
import ResizeableBackground;

var rb:ResizeableBackground = new ResizeableBackground("bw.jpg", stage.stageHeight, stage.stageWidth);
var obj:Sprite = rb.getMovie();
addChild(obj);


my problem is, that I cannot succesfully put the rest from the .fla into my .as-file. can anyone guide me to what to do from here?

picture, .as og .fla can be downloaded from here:
http://campjohn.dk/test/ResizeableBackground.zip


thanks, any help is very appreciated
felisan

Flash CMS - Help Me To Finish It
Hello...i trying to create CMS for my flash site..I'm practising on this example: http://rapidshare.com/files/128512198/source1.zip.html
As you can see when you download it, flash read xml wich is conected wich reads html. I'll update that html with cutenews. What I want to know is how to put swf in my html file so my source flash can read it. I was trying with javascript or classic way but my main flash file wich read this html doesn't show that swf, also i can't put my picture above text in html.
I hope you understand me what I want. Every coment will be helpfull.

Left Click Plays NEXT Frame, Right Click Plays PREVIOUS Frame?
Dear all,

I'm writing a simple presentation in Flash MX for the Mac. How do I get the "left click" on the mouse to play NEXT frame, and teh "right click" to play the PREVIOUS frame?

My scripting isn't so good, so please make it simple!

Thanks a lot in advance

ONE LAST QUESTION THEN I CAN FINISH MY GAME
Hey, I need to know one last question concerining the game i constructed... Allright... As you may know in past posts i was tring to create an effect to make the ground scroll when you meet the half way mark going up, and i got that under great control.. But another very big issues is........OBJECTS.. ok i know that if I just tweened the objects it would work fine, and it does, but you know that wouldnt look very REALISTIC at all if you wherent pressing any buttons, the ground wasnt moving, but plain ol stiff trees where just floating by which would happen if you where to motion tween them.. So i began thinking it would be easier to make them come randomly.. which i already know how to do, but i want err.. NEED to know the code to make it so when you press the up button, the trees go up a little bit. meaning the trees are stiff. and they stay in one place, but when you move they go down the road, and when you stop they stop.. when you press the up button and go up the road.. they go down the road because you are moving away from them....

HERE IS MY CODE I USED FOR THE BACKGROUND TO HELP SCROLL IT UP.. MAYBE IT WILL HELP A LITTLE BIT??

Code:
onClipEvent (load) {
ground.duplicateMovieClip("ground2", 100);
ground2._y = ground._y-ground._height;
groundStartx = this._y;
groundSpeed = 0;
// groundSpeed=20;
}
onClipEvent (enterFrame) {
if (_root.car._y<(ground._height/2)) {
_root.car._y += _root.car.moveSpeed;
groundSpeed = 18;
} else {
groundSpeed = 0;
}
}
onClipEvent (enterFrame) {
this._y += groundSpeed;
if (this._y>=(groundStartx+ground._height)) {
this._y = groundStartx-groundSpeed;
}
}


That would be for the road...

please reply as soon as possible.. my new due date for the stie is wednesday!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!! And its going to be pretty hard because i have to create ALL 12 LEVELS, then some movies in between.......thanks for all your help in advance........................................... .................................................. ...................................!!!!!!!!!!!!!!! !!!!!!!

Finish Overstate Of Button
How do i finish my animation on the overstate of my button when the mouse is taken away? I don't want the animation to stop, I want it to finish. Any suggestions?

Best Way To Wait For A To Sound Finish?
What is the best way to keep on a frame until a sound is finished on the score?

I have an animation that flags by script when it is done so other events can take place. I don't want it to do so if the sound was lagging behind a little, the sound should finish.

Is there a setting for the sound instance itself I should use or should I use a looping script and check for some sort of sound property?

Thanks for the help!

Best Way To Wait For A Sound To Finish?
What is the best way to keep on a frame until a sound is finished on the score?

I have an animation that flags by script when it is done so other events can take place. I don't want it to do so if the sound was lagging behind a little, the sound should finish.

Is there a setting for the sound instance itself I should use or should I use a looping script and check for some sort of sound property? The sound is not streaming, it is preloaded.

Thanks for the help!

Finish Animation On Button
I have an animation on my button during the overstate. My ? is, does any1 know how to make the animation finish when the mouse moves away, instead of it just stopping?

MC Finish Before Scene Change
I'll admit that although I've been using Flash for quite some time, I've never really gotten into AS. I feel like I have to apologise because I think this seems like a really simple thing, but I just can't work it out.

All I want to do is (in Flash 5) tell a scene to wait for a movie clip to finish playing before it advances to the next scene.

I've done tutorials, read messages and tried everything. I promise I'll try to get my head around AS better if someone will just please point me in the right direction.

Cheers.

Waiting A Movie Finish To Run Other
Hello,

I got a problem trying to run my menus, i got 4 movies, each move is a menu,
when you click in a movie it expand and tell the others three movies to go
to bottom of the page, my problem is that all movies are running in
same time each move tell the others three to go down, like it:

movie1
tellTarget( _root.move4) { gotoAndPlay("goDown"); } //movie 4 to go to bottom of page
tellTarget( _root.move3) { gotoAndPlay("goDown"); } //movie 3 to go to bottom of page
tellTarget( _root.move2) { gotoAndPlay("goDown"); } //movie 2 to go to bottom of page
tellTarget( _root.move1) { gotoAndPlay("expand"); } //Open movie1

movie2
....

movie3
.....

movie4
......

There is a way to tell movieX to play and the others wait until it's complete
then run ? Like below

movie1

tellTarget( _root.move4) { gotoAndPlay("goDown"); } //movie 4 to go to bottom of page
waitingMovieFinishToRunNext
tellTarget( _root.move3) { gotoAndPlay("goDown"); } //movie 3 to go to bottom of page
waitingMovieFinishToRunNext
tellTarget( _root.move2) { gotoAndPlay("goDown"); } //movie 2 to go to bottom of page
waitingMovieFinishToRunNext
tellTarget( _root.move1) { gotoAndPlay("expand"); } //Open movie1

Thank You.

Finish Animation And Start A New One
Hi,
I am looking for answer to my question but because I don’t really know what to call it, I can’t really find it. Does anybody know how to do this, or what to look for?

I am building portfolio of pictures and want to have each picture appear in some animated way and stop. User will click on button and picture will appear and stop. Then the user can click on any other button and the current picture will leave with some animation and new picture will appear with the “opening” animation.

The problem is that I don’t know how to make the first picture finish the animation. Obviously the easiest way would be to click on button, which would trigger “go to” and start new picture animation but I want to finish at first the first animation and somehow make sure that the first one will be finished.

Any idea?

Thanks

Emil

Finish Animation Before Playing Next
I have a movie clip with buttons in it. When a button is rolled over I want an animation to plays and stops. But if another button is rolled over, I want the other animation to animate out, before the new one plays. How can I go about doing this?

Finish Animated Even After Mouse Off?
i need to make it so when you mouse over an object, it plays an animation, but i need that animation to continue even AFTER you take the mouse off, how do you do this?? i try creating a button, but the animation stops once the mouse moves off of it, i need it to finish animating!

please help

Finish The Scene, THEN Gotoandplay
i have a scene that i want to go to the end of before it goes to the next user-chosen scene. so, i have a scene, Home, with this actionscript on the Music button:

on(release){
Play;
}

but when it gets to the last frame, it needs to go to the scene called Music. is there some kind of if(frame==#) statement, or something along those lines, that i could use? i'm just not sure if that will work.

thanks guys, i really appreciate it.

-- Cm

Finish Anim Before New Starts?
I've searched the tutorials and couldn't find how to do this, or maybe I didn't know how to word it.

I'm creating a website where a button is released and a transition occurs before the next section is loaded. Say I'm in the "home" section and I click "contact". I want the "home" section to have an animation (transition) play before loading the "contact" section.

But I don't know how to do this. Any help, please?

Waiting For Function To Finish
Hey! is there any way to make flash wait for a certain function to finish before continuing its execution? thanks a lot!

Copyright © 2005-08 www.BigResource.com, All rights reserved