Zurück   Flashforum > Flash > ActionScript > ActionScript 2

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 01-09-2011, 22:01   #1 (permalink)
anfänger würd ich sagen
 
Registriert seit: Jun 2001
Ort: Köln
Beiträge: 90
Altes AS2 Script funktioniert plötzlich nicht mehr

Hallo zusammen. Habe vor 2 Jahren mal ein Script für Videos zu laden benutzt. Das funktionierte einwandfrei. Jetzt wollte ich die fla noch mal öffnen und es funktioniert nicht mehr. Habe mitlerweile CS5.5. Hat sich da irgendwas getan? Kann das sein das dass Script auf einmal nicht mehr funktioniert?

PHP-Code:
/**
* Preloading FLVs with progressbar
*
* Actionscript developed by Bloom Media Ltd. | www.bloommedia.co.uk
* Contributors: Dominic Kelly
*/

// open a net connection
var nc:NetConnection = new NetConnection();
// null connection for progressive download
nc.connect(null);

// create a stream
myNetStream = new NetStream(nc);
myVideo.attachVideo(myNetStream);
// load video
myNetStream.play("video.f4v");
// pause video to hide it from the stage
myNetStream.pause();

// hide load progress
percentage._visible false;
percentage._visible false;

// resize video onload, based on meta data
myNetStream.onMetaData = function(obj)
{
    
myVideo._height obj.height;
    
myVideo._width obj.width;
    
// show load progress
    
percentage._visible true;
    
percentage._visible true;
};

// listen for the 'Stop' status event, and restart the video to loop it
myNetStream.onStatus = function(info)
{
    if (
info.code == "NetStream.Play.Stop")
    {
        
this.seek(0);
    }
};

// create a preload interval to check load progress every 1 millisecond
myInterval setInterval(checkBytesLoaded1myNetStream);

// preload loop progress
function checkBytesLoaded(mns)
{
    
// calculate percentage of video that has downloaded
    
pctLoaded Math.round(mns.bytesLoaded mns.bytesTotal 100);

    
// update textfield on the stage
    
percentage.text pctLoaded "%";

    
// update progress bar on the stage
    
progressBar._xscale pctLoaded;

    if (
pctLoaded >= 100)    {
        
// the video has fully downloaded
        
_root.percentage.text "loaded";
        
// play video from the beginning
        
mns.seek(0);
        
mns.play("video.f4v");
        
// clear interval
        
clearInterval(myInterval);
    }

Weis jemand Rat?
Meijestic ist offline   Mit Zitat antworten
Alt 02-09-2011, 08:20   #2 (permalink)
anfänger würd ich sagen
 
Registriert seit: Jun 2001
Ort: Köln
Beiträge: 90
Also ich hab es wieder hinbekommen das der Code läuft:

Hier ist er

PHP-Code:
stop();
var 
nc:NetConnection = new NetConnection
nc
.connect(null);

var 
ns:NetStream = new NetStream(nc);

// create a stream

theTrailer.attachVideo(ns);
// load video
ns.play("rz/Raum1_Aufbau.flv");
// pause video to hide it from the stage
ns.pause();

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

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

var 
videoInterval setInterval(videoStatus100);
var 
amountLoaded:Number;

function 
videoStatus(){
    
amountLoaded ns.bytesLoaded ns.bytesTotal;
    
loader.loadbar._width amountLoaded 380;
    
loader.scrub._x ns.time duration 380;
}

var 
scrubInterval;

loader.scrub.onPress = function() {
    
clearInterval(videoInterval);
    
scrubInterval setInterval(scrubit,100);
    
this.startDrag(false,0,this._y,380,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/380)*duration));
}

// hide load progress
percentage._visible false;
percentage._visible false;

//resize video onload, based on meta data
ns.onMetaData = function(obj)
{
    
duration obj.duration;
}

{

    
// show load progress
    
percentage._visible true;
    
percentage._visible true;
};


//listen for the 'Stop' status event, and restart the video to loop it
ns.onStatus = function(info)
{
    if (
info.code == "ns.play.stop")
    {
        
trace("Video zu ende");

    }
};


// create a preload interval to check load progress every 1 millisecond
myInterval setInterval(checkBytesLoaded1ns);

// preload loop progress
function checkBytesLoaded(mns)
{
    
// calculate percentage of video that has downloaded
    
pctLoaded Math.round(mns.bytesLoaded mns.bytesTotal 100);

    
// update textfield on the stage
    
percentage.text pctLoaded "%";

    
// update progress bar on the stage
    
progressBar._xscale pctLoaded;

    if (
pctLoaded >= 100)    {
        
// the video has fully downloaded
        
_root.percentage.text "loaded";
        
// play video from the beginning
        
mns.seek(0);
        
mns.play("rz/Raum1_Aufbau.flv");
        
// clear interval
        
clearInterval(myInterval);
        
    }


Jetzt möchte ich gerne, dass wenn das Ende des Videos erreicht ist irgendwas passiert. Das habe ich mit

PHP-Code:

//listen for the 'Stop' status event, and restart the video to loop it
ns.onStatus = function(info)
{
    if (
info.code == "ns.play.stop")
    {
        
trace("Video zu ende");

    }
}; 
probiert. Funktioniert aber nichts. Keine Reaktion. Was ist daran falsch??

Dankeschön
Meijestic ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
altes script funktioniert nicht mehr oasys Flash 8 6 19-10-2010 22:12
Altes Script funktioniert nicht mehr?! Che Flash 8 2 09-06-2008 13:43
Altes Script funktioniert nicht mit Flash 7... Euan Flash MX 2004 2 15-03-2004 12:08
plötzlich funktioniert Funktion nicht mehr geroon Flash MX 15 07-04-2003 21:29
Preloader funktioniert plötzlich nicht mehr dieter99 Flash 4 und Flash 5 3 17-12-2002 13:58


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:24 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele