Trying To Get GotoAndLearn's Vid Player Tutrl To Work In AS3
Hello,I'm trying to put together a Remembrance Sunday package, but I'm struggling to iron out some problems in the code, and wonder if someone can give me some pointers.The URL for my package can be found belowhttp://i.thisis.co.uk/274136/binaries/Remembrance9.flaEssentially, I'm trying to recreate something I've seen on the MediaStorm website http://mediastorm.org/0024.htm a scrolling banner of images, each of which acts like a button to click through to a video player that I've managed to find.Anyway, the way I've tried to do it is to create a series of nested movieclips; the first is a two-layered movieclip in the library (which I've called fence) containing all of the pictures as profiles on one layer, and then a second layer on which I've laid a button overlay.I've then set up event handlers for the various overlays which display rollovers and rolloffs to push the timeline to the video playing section.You will see that the first section works, to a point, but because of the nested videoclips of fence and doublefence that there are times when the buttons don't work. Also the buttons are opaque black when the package is run - which is not as I planned it.There are more problems in the second piece of code: The second piece of code is taken from the video player tutorial on http://www.gotoandlearnforum.com which although it works when the stop() function is taken off the first frame of actionscript, it throws out an error:TypeError: Error #1009: Cannot access a property or method of a null object reference.at Remembrance9_fla::MainTimeline/mouseOutkenBettany()I'm not sure what this means or how to fix it, can anyone help?Code: stop();var nc:NetConnection = new NetConnection();//this establishes a connection to the internetnc.connect(null);//this tells Flash that this isn't a Flash Communication Server projectvar ns:NetStream = new NetStream(nc);theVideo.attachNetStream(ns);ns.play("berrisford.flv");rewindButton.addEventListener(MouseEvent.MOUSE_DOWN,rewindBtn);function rewindBtn(event:MouseEvent):void { ns.seek(0); } playButton.addEventListener (MouseEvent.MOUSE_DOWN, playBtn);function playBtn(event:MouseEvent):void { ns.pause(); } 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*211.9; //211.9 px is the width of the loaderbar loader.scrub._x = ns.time/duration*211.9;}var scrubInterval;loader.scrub.onPress = function() { clearInterval(videoInterval); scrubInterval = setInterval(scrubit, 10); this.startDrag(false,1.8,this._y,209.8,this._y);};addEventListener(MouseEvent.MOUSE_DOWN,scrubVid);function scrubVid (event:MouseEvent):void{ }loader.scrub.onRelease = loader.scrub.onReleaseOutside=function () { clearInterval(scrubInterval); videoInterval = setInterval(videoStatus, 100); this.stopDrag();};function scrubit() { ns.seek(Math.floor((loader.scrub._x/211.9)*duration));}Cheers,
Actionscript 3.0
Posted on: Thu Oct 30, 2008 10:31 am
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Problem With Gotoandlearn Mp3 Player
Hi
I downloaded the mp3 player from gotoandlearn.com and the first part is workin correct,
but when I add the controll buttons it stops playing the songs continously.
It only play the first song and then stops.
Any one having the same problem, or knows a way to fix it?
thnx..
Problem With Gotoandlearn Mp3 Player
Hi
I downloaded the mp3 player from gotoandlearn.com and the first part is workin correct, but when I add the controll buttons it stops playing the songs continously. It only play the first song and then stops. Any one having the same problem, or knows a way to fix it?
thnx..
here's the code by the way:
// Setup sound object
var s:Sound = new Sound();
s.onSoundComplete = playSong;
s.setVolume(75);
// Array of songs
var sa:Array = new Array();
// Currently playing song
var cps:Number = -1;
// Position of music
var pos:Number;
// Load the songs XML
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes:Array = this.firstChild.childNodes;
for(var i=0;i<nodes.length;i++)
{
sa.push(nodes.attributes.url);
}
playSong();
}
xml.load("songs.xml");
// Play the MP3 File
function playSong():Void
{
s = new Sound();
if(cps == sa.length - 1)
{
cps = 0;
s.loadSound(sa[cps], true);
}
else
{
s.loadSound(sa[++cps], true);
}
playPause.gotoAndStop("pause");
}
// Pauses the music
function pauseIt():Void
{
pos = s.position;
s.stop();
}
// Pauses the music
function unPauseIt():Void
{
s.start(pos/1000);
}
// Music Controls
// Play/Pause Toggle
playPause.onRollOver = function()
{
if(this._currentframe == 1) this.gotoAndStop("pauseOver");
else this.gotoAndStop("playOver");
}
playPause.onRollOut = playPause.onReleaseOutside = function()
{
if(this._currentframe == 10) this.gotoAndStop("pause");
else this.gotoAndStop("play");
}
playPause.onRelease = function()
{
if(this._currentframe == 10)
{
this.gotoAndStop("playOver");
this._parent.pauseIt();
}
else
{
this.gotoAndStop("pauseOver");
this._parent.unPauseIt();
}
}
// Next Button
next.onRollOver = function()
{
this.gotoAndStop("nextOver");
}
next.onRollOut = next.onReleaseOutside = function()
{
this.gotoAndStop("next");
}
next.onRelease = function()
{
this._parent.playSong();
}
And in the xml:
<?xml version="1.0" encoding="UTF-8"?>
<songs>
<song url="chompSamba.mp3" />
<song url="cureForTheItch.mp3" />
<song url="sheLooksToMe.mp3" />
<song url="soWasRed.mp3" />
<song url="thisIsWar.mp3" />
</songs>
Gotoandlearn Mp3 Player Not Functioning
I successfully built the mp3 player from the Gotoandlearn.com tutorials. It works perfectly in a .swf player and when it's compiled in Flash, but the moment I try to play it in a browser... it doesn't connect. The textfield says undefined.
Being unknowledgeable of Flash, I have no idea why it can't connect to the files when it's being viewed from a browser.
Any ideas? Need to see the files? http://clay.bellmor.com/testsite/player
Also! Opening the player.swf file in Safari and FF doesn't work, but opening the player folder and then clicking on the .swf (so it loads the .swf by itself) works properly...
I'm 'guessing' there's something wrong with the class setting, maybe it doesn't know where to look...
Any help would be great!
-Clayton
[CS3] A Small Problem With The Mp3-player From Gotoandlearn
Hey guys!
Im posting because i have a (hopefully) simple problem! Ive been trying to use the mp3 player i created from the tutorial over at
gotoandlearn (http://www.gotoandlearn.com/play?id=39) as a tracklist player.
The absolute path of the a track in the list is _root.topmain.main.media.track1 and the mp3 player is in _root.topmain
So i did a small modifiation and added:
_root.topmain.main.media.track1.onRelease = function()
{
cps = 0; // song index
this._parent.playSong();
}
The original "next song" button looks like this:
next.onRelease = function()
{
this._parent.playSong();
}
Somehow it doesnt work! Flash tracks it as a clickable symbol but when i click it nothing happens.
It works if i put the button in the same level in the movieclip as the mp3 player.
Its been driving me nuts for days and I've tried to write the line in diffrent ways but i haven't got it to work yet.
Thanks in advance and I would really appreciate it if someone could help me out!
/Hzrdous
Mp3 Player Questions (based On GotoAndLearn Tutorial)
Good-day men,
first of all, compliments for your tutorials.. they are great!
I have some "stupid" questions, if you wanna help me:
- how can I start the player from the position "pause" (so without playing a song when I open the flash) (and so with the button in position "play")
- I would like to add the button "previous track".. what code I need to create into the "mp3player.as"? (I think the button is the same of next but with "negative image" and with different names..)
- for a button like "stop" what I have to do? (a button with a simple action like: stop(); or stopAllSounds(); ?) (I've tried but without success...)
thanks to peolple will help me!
Custom Video Player By GotoAndLearn Tutorial - Problems
Hey guys,
first: sorry for my bad english knowledge, hope you are able to understand me
Okay, i did the Video Basic Tutorials and the XML Playlist, because this was a chance to insert more than one videos. Altouhgh, i customized the skin of the Videoplayer.
When i'm finished, the videoplayer shoud look like this:
Okay, so i took the functions shown in the tutorial. So i've got an XML-Playlist, play/pause button, replay button, mute button.
But as you see in the screenshot there should be some more
First of all i want to stop the "Autoplay-system" and "Autoreplay-System". I want to show the preview-picture and if i klick on "play" i want the TV to start. If one video is finished, there should be the "screenshot" again.
Screenshots -> Because i want to use the player with a lot of movies, i want to write down screenshots next to the videourl (XML Datei), something like this
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<videos>
<video url="videos/rundengewinner08.flv" desc="Giga Homepage Award Runde 8" thumb="preview.jpg" />
</videos>
Than there are some "Arrowkeys" like this », so i want to switch between the screenshots to choose your video. Because i want this as "navigation", i don't need the Playlist next to the player (if i delete the layer i cannot use the player anymore).
Third: I would love the "minutes"-display (shown on the screenshot).
As faar as good... my problem is: I've got no knowledge about Flash/Actionscripts, so please explain "step by step". If there is someone who says "thats easy" i would give him the files (if it is easilier)
You can download the files from the tutorial at this link
I just eddited the Layout, nothing by the code
Thanks,
mr92
How To Make My Player 6 Code Work In Player 7?
hiya,
does anyone know if it's possible to change this code so that it works when exported as 7 instead of 6??
i have a thumbnail slider that brings in images from XML. the XML bit works in 7 so
i think it's all going wrong at the slider code below:
// MAKES THE THUMBAILS SLIDE USING NEXT & PREVIOUS BUTTONS
function SlideMenu() {
this._x += (newX - this._x + thumbWidth) / 5;
// stops the thumbs at the first one
if (menu_mc._x >= 116) {
menu_mc._x = 116;
// stops thumbs at the end.
} else if (menu_mc._x < -(imageCount) ) {
menu_mc._x = -(imageCount);
//trace ("imagecount: " + (imageCount - endThumbBox));
}
}
// This next line calls the funtion named SlideMenu
menu_mc.onEnterFrame = SlideMenu;
delete this.onEnterFrame;
// next & back buttons
previous_mc.onRelease = function() {
XNumber++ ;
newX =- XNumber * -580;
}
next_mc.onRelease = function() {
XNumber-- ;
newX =- XNumber * -580;
}
i'd really like it to work with 7 cos i've since figured out that css only works with player 7 & up...
hope that it's a simple problem to solve (i'm pretty new to this) & someone can help me out
cheers
naoimh
Gotoandlearn?
Hello, i was wondering if anyone had lee`s xml video playlist working, ive tryed his tutorial and it still isent working, if anyone has it could they post it.
Also if they have any other good tutoirals of xml menus for .flv video selection
Gotoandlearn.com In Mx
Hi i am doing the 3d carousel tutorial but am curious weather it works in mx?
I know mx does not have bitmap caching.
are there any vital classes that are not available in mx?
or is it just the bitmap caching?
Gotoandlearn.com
hey guys, im looking for a tut that can help me with the effect thats on lees site
when you hover over the buttons on the left, a little comment pops up, i tried to remeber what it was called, and i actually remember seeing a tut on it somewhere but cant find it at the moment. the thing thats so cool with his, its fluid movement, thanks please
XML Problem (gotoandlearn)
i was follow the xml tutorial of the slideshow, and my code dont ve errors, ( at least that says flash)
Code:
stop();
var x:XML = new XML();
x.ignoreWhite = true;
var miembros:Array = new Array();
var nombres:Array = new Array();
var nicks:Array = new Array();
var edades:Array = new Array();
var provincias:Array = new Array();
var profiles:Array = new Array();
var queFoto:Number;
x.onLoad = function() {
var photo:Array = this.firstChild.childNodes;
for (i=0; i<photo.length; i++) {
miembros.push(photo[i].attributes.miembro);
nombres.push(photo[i].attributes.nombre);
nicks.push(photo[i].attributes.nick);
edades.push(photo[i].attributes.edad);
provincias.push(photo[i].attributes.provincia);
profiles.push(photo[i].attributes.profile);
}
_root.fotos.loadMovie(miembros[0]);
nombre.text = nombres[0];
nick.text = nicks[0];
edad.text = edades[0];
provincia.text = provincias[0];
profile.text = profiles[0];
queFoto = 0;
};
x.load("http://www.smokedjaguars.com/miembros/miembros.xml");
ant.onRelease = function () {
if (queFoto > 0) {
queFoto--;
fotos.loadMovie(miembros[queFoto]);
nombre.text = nombres[queFoto];
nick.text = nicks[queFoto];
edad.text = edades[queFoto];
provincia.text = provincias[queFoto];
profile.text = profiles[queFoto];
}
}
sig.onRelease = function () {
if (queFoto < photo.length) {
queFoto++;
fotos.loadMovie(miembros[queFoto]);
nombre.text = nombres[queFoto];
nick.text = nicks[queFoto];
edad.text = edades[queFoto];
provincia.text = provincias[queFoto];
profile.text = profiles[queFoto];
}
}
Dont work, and i revisited again and again, but dont work
Gotoandlearn Related Q
Hello all, I'd like to know if the tutorial "Sending Mail with PHP" from gotoAndLearn.com can be used with FlashMX? I use the fore-mentioned and I haven't had the chance to compare it's actionscript with actionscript2. Thank you in advance.
Gotoandlearn Tutorials
does anyone here have the .fla file from gotandlearns tutorials? Im looking specifically for the "full browser" tutorial .fla. Can anyone help?
Can't Load Movies On Gotoandlearn.com
My computer loads most of the movies on www.gotoandlearn.com only for something like 20%, so I can't view the other 80%.
The only movies that I can view are these tutorials:
- all the video basics tutorials
- the 3d logo tutorial
- the running man tutorial
- video player interface
- XML video playlist
- PHP, MySQL and Flash
Does anyone has any idea why I can't view the tutorials and how I could solve that problem?
[CS3] [AS2] 3D XML Carousel Using GotoAndLearn Tutorial
I am slowly building up a small carousel based on the gotoandLearn videos, but I've reached a point that I'm stumped. This is the tutorial itself:
http://www.gotoandlearn.com/play?id=33
This is my code so far, first is the AS2, second XML:
Code:
var numOfItems:Number;
var radiusX:Number = 320;
var radiusY:Number = 90;
var centerX:Number = Stage.width/2;
var centerY:Number = Stage.height/3.2;
var speed:Number = 0.03;
var home:MovieClip = this;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
{
var t = home.attachMovie("icon","icon"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.icon.inner.loadMovie(nodes[i].attributes.images);
}
}
xml.load("icon.xml");
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s:Number = this._y / (centerY+radiusY);
this._xscale = this._yscale = s * 100;
this.angle += this._parent.speed;
}
this.onMouseMove = function()
{
speed = (this._xmouse-centerX)/9500;
}
Code:
<icons>
<icon images="icon1.png" tooltip = "Knowledge"/>
<icon images="icon2.png" tooltip = "Logic"/>
<icon images="icon3.png" tooltip = "Focus"/>
<icon images="icon4.png" tooltip = "Speed"/>
</icons>
It so far seems to be recognizing the XML file, when it loads there are four rotating "inner" objects... however, the actual .png files are not loading into place like they should. I've followed the tutorial near-exactly, leaving out a few things such as the reflection effect and tooltip which will not be used in my own final version. The outer movie is named "item" with an instance name of "icon", while the inner movieclip is named "inner" with an instance name of "inner" What is going on?
Carousel Effect On Gotoandlearn.com
I'm using Flash MX on a Mac - I downloaded the fla files off this site and they won't open. Any ideas? I'm assuming it's a version problem? Anyone have one that would work for me using MX?
Gotoandlearn Files Problem
Hi
I have downloaded the files used for gotoandlearn at flash blog site.
It seems to be a older version
Have tried to get it to work, but it wont.
Have tried this:
1: have changed:
//x.load("videos.xml");
x.load("videos.xml?cachebuster=" + new Date().getTime());
to
x.load("videos.xml");
//x.load("videos.xml?cachebuster=" + new Date().getTime());
2: Have tried to put flv files in a folder called flv (like at this site)
3: Have tried to put files i a file folder
4: Have tried to add <?xml version="1.0" ?> to the xml file
Nothing have worked.
See the result here:
http://www.techshop.dk/stream/player.swf
It seems like it found out that there are 2 videos in XML file. But it cant show or play them
Please help me
Gotoandlearn.com Source Files
Ok I went here http://theflashblog.com/?p=46 to get the source files that Lee has so kindly put up.
However I cant seem to get them to work.
Now I know on the link above various people could get it to work however I cant and have read this post many times.
Can someone explain what is I am required to do to get it to work.
I downloaded all files correctly
Thanks in advance
jmcall10
Flash Player 6 To Work In Player 7.0
I have a xml menu created in flash mx 2004 'AS 2.0' and while it seems to work fine in flash player 6.0 I need o get it working in flash player 7.0.
The main problem when it plays in Flash player 7.0 is that my positions for my created textfields which act as my buttons are all palced at different _x position, where they should all butt up against each other in a horizontal line placed at dfferent _xpositions depending on the length of each individual text position. as i said it all seems to work fine in flash player 6.0 but not in 7.0. I think its something to do with my TextFormat but not too sure can anyone help me please as this is becoming a nightmare!!
Code:
menu_fmt = new TextFormat("menu_font", 10, 0x000000, false, false, false, "", "", "center", 0, 0, 0, 18);
GenerateMenu = function (container, name, x, y, depth, node_xml) {
var curr_node;
var curr_item;
var curr_menu = container.createEmptyMovieClip(name, depth);
for (var i = 0; i<node_xml.childNodes.length; i++) {
// movieclip for each menu item
curr_item = curr_menu.attachMovie("menuitem_mc", "item"+(i+1)+"_mc", i);
// item properties assigned from XML
curr_node = node_xml.childNodes[i];
curr_item.action = curr_node.attributes.action;
curr_item.variables = curr_node.attributes.variables;
curr_item.createTextField("name_txt", 2000, curr_menu["item"+(i+1(i-1))+"_mc"].name_txt._width+curr_menu["item"+(i+1(i-1))+"_mc"].name_txt._x, 0, curr_item.name_txt._width=curr_item.name_txt.textWidth+20, 16), curr_item.name_txt.setNewTextFormat(menu_fmt), curr_item.name_txt.selectable=false, curr_item.name_txt.embedFonts = true, curr_item.name_txt.text=curr_node.attributes.name;
curr_menu["item"+(i+1(i-1))+"_mc"].name_txt._x
boxlength = curr_item.name_txt.textWidth+20;
curr_item.name_txt._width = boxlength;
btn_mc = curr_item.attachMovie("background", "bkgd"+(i+1)+"_mc", this.getNextHighestDepth(), {_x:i*50, _y:0});
btn_mc._x = curr_item.name_txt._x;
btn_mc._width = boxlength-1;
curr_item._y = 14;
curr_menu._y = 20;
curr_item._x = 10;
curr_item.trackAsMenu = true;
if (node_xml.childNodes[i].nodeName == "menu") {
// open a submenu
curr_item.node_xml = curr_node;
curr_item.onRollOver = curr_item.onDragOver=function () {
//var x = 10;
//var y = this._y+5;
trace(btn_mc);
GenerateMenu(curr_menu, "submenu_mc", x, y, 1000, this.node_xml);
var col = new Color(this);col.setRGB(0xcc9966);
};
} else {
curr_item.onRollOver = curr_item.onDragOver=function () {
curr_menu.submenu_mc.removeMovieClip();
var col = new Color(this);col.setRGB(0xcc9966);
};
}
curr_item.onRollOut = curr_item.onDragOut=function () {
var col = new Color(this);col.setTransform({ra:100, rb:0, ga:100, gb:0, ba:100, bb:0});
}
// any item, menu opening or not can have actions
curr_item.onRelease = function() {
Actions[this.action](this.variables);
CloseSubmenus();
};
}
// end for loop
};
// create the main menu, this will be constantly visible
CreateMainMenu = function (x, y, depth, menu_xml) {
// generate a menu list
GenerateMenu(this, "mainmenu_mc", x, y, depth, menu_xml.firstChild);
// close only submenus if visible durring a mouseup
// this main menu (mainmenu_mc) will remain
mainmenu_mc.onMouseUp = function() {
if (mainmenu_mc.submenu_mc && !mainmenu_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
CloseSubmenus();
}
};
};
// closes all submenus by removing the submenu_mc
// in the main menu (if it exists)
CloseSubmenus = function () {
mainmenu_mc.submenu_mc.removeMovieClip();
};
// This actions object handles methods for actions
// defined by the XML called when a menu item is pressed
Actions = Object();
//loads swf specified in xml doc into level1
Actions.loadswf = function(swfFile) {
loadMovieNum(swfFile, "1");
};
// load XML, when done, run CreateMainMenu to interpret it
menu_xml = new XML();
menu_xml.ignoreWhite = true;
menu_xml.onLoad = function(ok) {
// create main menu after successful loading of XML
if (ok) {
CreateMainMenu(0, 0, 0, this);
message_txt.text = "message area";
} else {
message_txt.text = "error: XML not successfully loaded";
}
};
// load first XML menu
menu_xml.load("scripts/menu1.xml");
[F8] GotoAndLearn Tutorial Won't Load Outside Of Flash
hello all. i attempted to follow the carousel video tutorials from gotoAndLearn.com. i got everything working inside of flash, but when i try to open the .swf file outside of the flash environment, all it did was load a blank screen that lagged my computer to he** and back. i thought it was something i was doing wrong in the code, so i downloaded the source files of the tutorial and i again, the same effect happens.
any ideas on how to fix this?
Thanks!
Question About Carousel Tutorial On GotoAndLearn
there is a three part series tutorial on building a sleek carousel withdrawing icons from xml file (Creating 3D Carousels III - http://www.gotoandlearn.com/download.php )
If you are familiar with this, the tutorial only covers showing text information along with the picture icon. What would be very cool is to have is show a movie clip when you clicked on an icon. Then is would be a full flash site, and a really cool one.
Here I am attaching the full action script that I got from the tutorial, so if you have an idea how to show a movie clip on clicking an icon, it would be great. I am a newbie to actionscript, so any help would be appreciated.
Code:
import mx.utils.Delegate;
import mx.transitions.Tween;
import mx.transitions.easing.*;
var numOfItems:Number;
var radiusX:Number = 300;
var radiusY:Number = 60;
var centerX:Number = Stage.width/2;
var centerY:Number = Stage.height/2;
var speed:Number = 0.05;
var perspective:Number = 130;
var home:MovieClip = this;
theText._alpha = 0;
var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
tooltip._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for (var i=0; i<numOfItems;i++)
{
var t = home.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
t.content = nodes[i].attributes.content;
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.ref.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
}
}
function over()
{
home.tooltip.tipText.text = this._parent.toolText;
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2.5;
home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
home.tooltip._alpha = 100;
}
function out()
{
delete home.tooltip.onEnterFrame;
home.tooltip._alpha = 0;
}
function released()
{
home.tooltip._alpha = 0;
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home["item"+i];
t.xPos = t._x;
t.yPos = t._y;
t.theScale = t._xscale;
delete t.icon.onRollOver;
delete t.icon.onRollOut;
delete t.icon.onRelease;
delete t.onEnterFrame;
if(t != this._parent)
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,100,0,1,true);
}
else
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,100,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,200,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,100,1,true);
var tw5:Tween = new Tween(theText,"_alpha",Strong.easeOut,0,100,1,true);
theText.text = t.content;
var s:Object = this;
tw.onMotionStopped = function()
{
s.onRelease = unReleased;
}
}
}
}
function unReleased()
{
delete this.onRelease;
var tw:Tween = new Tween(theText,"_alpha",Strong.easeOut,100,0,0.5,true);
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home["item"+i];
if(t != this._parent)
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,0,t.theScale,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,0,t.theScale,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,0,100,1,true);
}
else
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,100,t.theScale,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,100,t.theScale,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,t.xPos,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,t.yPos,1,true);
tw.onMotionStopped = function()
{
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home["item"+i];
t.icon.onRollOver = Delegate.create(t.icon,over);
t.icon.onRollOut = Delegate.create(t.icon,out);
t.icon.onRelease = Delegate.create(t.icon,released);
t.onEnterFrame = mover;
}
}
}
}
}
function moveTip()
{
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2.5;
}
xml.load("icons.xml");
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s:Number = (this._y - perspective) / (centerY+radiusY-perspective);
this._xscale = this._yscale = s * 100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
}
this.onMouseMove = function()
{
speed = (this._xmouse-centerX)/10000;
}
The Missing GotoAndLearn.com Mp3player Code
Hello there,
I was wondering if anyone here happens to have the supplementry .zip file found on gotoAndLearn.com, that accompanied the last Mp3player tutorial before the site was pulled and the content rendered unavailable.
its a bit of a long shot, but i'd thought i'd ask. I just can't find it anywhere on the web, not even http://theflashblog.com/ .
thanks Cam
Object Oriented ScrollBar At Gotoandlearn
I've been a total fan of http://www.gotoandlearn.com for a long time now. I learned about it in the first place from these forums here, quite some time ago, too. Now that Lee Brimelow is getting into Actionscript 3.0, the site just keeps getting better. Yesterday I watched the two topmost tutorials there (the Object Oriented ScrollBar ones); I even watched the second one twice. I was kind of awestruck. The guy is a genius, and he's a great teacher. It was an eye-opener about OOP for me (not that I've "arrived" yet).
So here's the deal: I have been getting into programming with classes more and more, but I don't have any OOP background or training, except for self-teaching. So you can know how to make classes and packages and how all that works, but then the question becomes what kind of classes of objects should you make so that they are reusable and work together well. Also, what kind of division of labor should you use, like, what should ideally be the responsibilities of each class.
These two video tutorials seem like they've filled a gap in my knowledge and skill set. For one thing, they explain how to create a custom event class and make the scroll bar class use it to broadcast the position of the thumb so that outside code can use it. Now I understand better the role of the event object, even how the existing flash classes implement it.
I just thought I'd pass this along. This is sure to help someone, somebody needs this...
Gotoandlearn Basics Of Papervision3D Tutorial
Hi,
I apologize in advanced if this is in the wrong forum or if this has already been posted. I tried searching but couldn't find anything relevant to my problem.
I'm trying to complete the Basics of Papervision3D tutorial here and I'm running into a compiling problem. I'm fairly new to Flash so I'm not sure if this is just a really stupid error that I'm overlooking or not.
The error is :
InteractiveSceneManager.as, Line 38 1046: Type was not found or was not a compile-time constant: XrayLog.
I'm pretty sure I've set up my class path right, being C:usersmeDesktopActionscript. Within there is com, livePreview, et al.
Here's my actionscript code just in case.
Code:
import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.materials.*;
var container:Sprite = new Sprite();
container.x = stage.stageWidth * 0.5;
container.y = stage.stageHeight * 0.5;
addChild(container);
var scene:Scene3D = new Scene3D(container);
var camera:Camera3D = new Camera3D();
camera.zoom = 5;
var bam:BitmapAssetMaterial = new BitmapAssetMaterial("FlashIcon");
bam.oneSide = false;
bam.smooth = true;
for(var i:uint=0; i<50; i++)
{
var p:Plane = new Plane(bam, 90, 90, 2, 2);
scene.addChild(p);
p.x = Math.random() * 1000 - 500;
p.y = Math.random() * 1000 - 500;
p.z = Math.random() * 1000 - 500;
p.rotationY = Math.random() * 360;
}
scene.renderCamera(camera);
Any help would be greatly appreciated
GotoandLearn.com Source Code Question....
I have downloaded the source code for the FLA of this site...and by the way THANKS...what a great starting point to jump off into a cool world of design from...
But here is my quick question....
I have a series of flvs to play in a certain order....
I would like for the player, when finished to play the next one in the sequence...
I found all the code to do this...
but it looked like it wanted to repeat the same one...
I am loading everything from an xml file....in fact four different XML files load according to a pushed button...
So say I pushed button 1...got xml1 to load and clicked the first list item that loaded...that video plays and I want it to play the second on and so on...
but if the person clicks the third item on the list, i want it to play the fourth from there...
So if I do series of ++ codes to get it to work, then the user clicks around it could scary...
I could hard code a variable number that each of the 30 flvs are...
like video1 = 1
video 2 = 2 and so on...
then load that variable into a container variable to hold it...
and then just add one to that number I guess...
Basically, my question is
within the gotoandlearn code....what is the easiest way to assign the next video to be played?
Changing The Gotoandlearn Interface To A Swf Viewer
Hi I'm experimenting with changing the interface for the gotoandlearn.com site into a SWF movie viewer rather than FLV - the zip file has been posted here in the past - although today I did have to decompile it in order to view the file. Not trying to steal the work - but as Lee had it posted at one time I figured it was ok to use it as the basis for some experimentation.
As written the .fla requires FLV files in order to populate the movie viewer - and SWFs won't play as it utilizes the Video class, etc.
Anybody have any idea how to switch out the movie box for a swf loader instead - keeping the XML reading intact? The relevant code appears to be here:
function playtime(who)
{
ns.play(who + ".flv");
loadInt = setInterval(loadFunction, 50);
buffclip._visible = true;
} // End of the function
function loadFunction()
{
var _loc1 = ns.bytesLoaded / ns.bytesTotal;
if (_loc1 < 1)
{
pl._x = ld._x + ld._width - 20;
pl.perload.text = Math.round(_loc1 * 100) + "%";
pl._visible = true;
ld._width = swidth * _loc1;
}
else
{
pl._visible = false;
ld._width = swidth;
clearInterval(loadInt);
} // end else if
} // End of the function
function videoUpdate()
{
var _loc1 = ns.time / dur;
pr._x = -2.585000E+002 + swidth * _loc1;
} // End of the function
function rewind()
{
ns.seek(ns.time - 30);
if (ns.time == 0)
{
clearInterval(rewInt);
ns.pause(false);
} // end if
} // End of the function
function ff()
{
if (ns.time / dur < 9.500000E-001)
{
ns.seek(ns.time + 1);
}
else
{
clearInterval(ffInt);
} // end else if
} // End of the function
function scrubba()
{
var _loc1 = (pr._x - pstart) / swidth;
ns.seek(_loc1 * dur);
} // End of the function
function voller()
{
var _loc2 = (controlBar.vol._x - (startxs - 2)) / 74;
sou.setVolume(Math.ceil(_loc2 * 100));
_root.tooltip.datext.text = " " + sou.getVolume() + "% Volume";
_root.tooltip._x = Math.round(_root._xmouse);
_root.tooltip._y = Math.round(_root._ymouse);
_root.tooltip._visible = true;
} // End of the function
function showTip(datext)
{
ti = getTimer();
_root.tooltip.datext.text = datext;
_root.tooltip.onEnterFrame = function ()
{
var _loc3 = getTimer();
if (_loc3 - ti > 500)
{
delete _root.tooltip.onEnterFrame;
this._x = Math.round(_root._xmouse);
this._y = Math.round(_root._ymouse);
_root.tooltip._visible = true;
this.onMouseMove = function ()
{
this._x = Math.round(_root._xmouse);
this._y = Math.round(_root._ymouse);
_root.tooltip._visible = true;
};
} // end if
};
} // End of the function
function removeTip()
{
_root.tooltip._visible = false;
delete _root.tooltip.onEnterFrame;
delete _root.tooltip.onMouseMove;
} // End of the function
stop ();
_global.codeBase = this;
var zips = new Array();
var decs = new Array();
var files = new Array();
var isFirst = true;
var nc = new NetConnection();
nc.connect(null);
var ns = new NetStream(nc);
ns.setBufferTime(1.000000E-001);
theVideo.attachVideo(ns);
_root.createEmptyMovieClip("vidsound", _root.getNextHighestDepth());
vidsound.attachAudio(ns);
var sou = new Sound(vidsound);
sou.setVolume(0);
ns.onStatus = function (obj)
{
if (isFirst && obj.code == "NetStream.Buffer.Full")
{
buffclip._visible = false;
ns.pause(true);
_root.controlBar.plabel.gotoAndStop(2);
sou.setVolume(75);
ns.setBufferTime(5);
ns.seek(0);
isFirst = false;
}
else if (!isFirst && obj.code == "NetStream.Buffer.Full")
{
buffclip._visible = false;
} // end else if
if (obj.code.indexOf("Stop") != -1)
{
pr._x = pstart;
ns.seek(0);
} // end if
if (obj.code == "NetStream.Buffer.Full")
{
buffclip._visible = false;
} // end if
if (obj.code == "NetStream.Buffer.Empty")
{
buffclip._visible = true;
} // end if
};
var x = new XML();
x.ignoreWhite = true;
var vidArr = 0;
x.onLoad = function ()
{
var _loc2 = this.firstChild.childNodes;
for (i = 0; i < _loc2.length; i++)
{
tl.addItem(_loc2[i].attributes.title, "http://216.174.107.224/flv/" + _loc2[i].attributes.earl);
decs[i] = _loc2[i].attributes.info;
files[i] = _loc2[i].attributes.files + ".zip";
++vidArr;
} // end of for
np.title.text = tl.getItemAt(0).label;
np.info.text = decs[0];
if (files[0].indexOf("***") == -1)
{
np.files.htmlText = "<a href="http://216.174.107.224/files/" + files[0] + "">Download Tutorial Files</a>";
}
else
{
np.files.htmlText = "<font color="#000000">No Files Available</font>";
} // end else if
playtime(tl.getItemAt(0).data);
tl.selectedIndex = 0;
};
x.load("videos.xml?cachebuster=" + new Date().getTime());
np.dlo.onRelease = function ()
{
getURL(zips[tl.selectedIndex], "");
};
var scr = _root.controlBar.scrubber;
var pr = scr.progres;
var ld = scr.loader;
var cb = _root.controlBar;
var pl = scr.perload;
var swidth = scr.back._width;
var pstart = pr._x;
var dur;
ns.onMetaData = function (obj)
{
dur = obj.duration;
np.timetext.text = Math.floor(dur / 60) + " minutes, " + Math.round(dur % 60) + " seconds";
};
_root.onEnterFrame = videoUpdate;
var loadInt = setInterval(loadFunction, 50);
cb.replayer.onRollOver = function ()
{
showTip(" Replay Video");
};
cb.replayer.onRollOut = cb.replayer.onPress = function ()
{
removeTip();
};
cb.replayer.onRelease = function ()
{
ns.seek(0);
ns.pause(false);
cb.plabel.gotoAndStop(1);
};
var rewInt;
cb.rewinder.onRollOver = function ()
{
showTip(" Rewind");
};
cb.rewinder.onRollOut = function ()
{
removeTip();
};
cb.rewinder.onPress = function ()
{
rewInt = setInterval(rewind, 200);
ns.pause(true);
removeTip();
};
cb.rewinder.onRelease = cb.rewinder.onReleaseOutside = function ()
{
clearInterval(rewInt);
ns.pause(false);
};
cb.player.onRollOver = function ()
{
showTip(" Play/Pause");
};
cb.player.onRollOut = cb.player.onPress = function ()
{
removeTip();
};
cb.player.onRelease = function ()
{
ns.pause();
cb.plabel.play();
};
cb.stopper.onRollOver = function ()
{
showTip(" Stop Video");
};
cb.stopper.onRollOut = cb.stopper.onPress = function ()
{
removeTip();
};
cb.stopper.onRelease = function ()
{
ns.seek(0);
ns.pause(true);
cb.plabel.gotoAndStop(2);
};
var ffInt;
cb.fforwarder.onRollOver = function ()
{
showTip(" Fast Forward");
};
cb.fforwarder.onRollOut = function ()
{
removeTip();
};
cb.fforwarder.onPress = function ()
{
removeTip();
ffInt = setInterval(ff, 200);
};
cb.fforwarder.onRelease = cb.fforwarder.onReleaseOutside = function ()
{
clearInterval(ffInt);
};
pr.scrubba.onPress = function ()
{
_root.onEnterFrame = scrubba;
pr.startDrag(false, -2.585000E+002, pr._y, -2.585000E+002 + ld._width - 4, pr._y);
};
pr.scrubba.onRelease = pr.scrubba.onReleaseOutside = function ()
{
_root.onEnterFrame = videoUpdate;
pr.stopDrag();
removeTip();
};
var tl = tutorialList.tutList;
tl.setStyle("color", 0);
tl.setStyle("rollOverColor", 14082283);
tl.setStyle("backgroundColor", 16777215);
tl.setStyle("textRollOverColor", 0);
tl.setStyle("textSelectedColor", 0);
tl.setStyle("selectionColor", 14082283);
tl.setStyle("fontFamily", "standard 07_56");
tl.setStyle("fontSize", 8);
tl.setStyle("embedFonts", true);
var lsound = new Sound();
var csound = new Sound();
lsound.attachSound("been");
csound.attachSound("click");
var il = ipod.ilist;
il.setStyle("color", 0);
il.setStyle("rollOverColor", 14082283);
il.setStyle("backgroundColor", 16777215);
il.setStyle("textRollOverColor", 0);
il.setStyle("textSelectedColor", 0);
il.setStyle("selectionColor", 14082283);
il.setStyle("fontFamily", "standard 07_56");
il.setStyle("fontSize", 8);
il.setStyle("embedFonts", true);
var ilist = new Object();
ilist.itemRollOver = function (obj)
{
if (obj.index < il.length)
{
lsound.start();
} // end if
};
ilist.change = function ()
{
csound.start();
_root.feeback.text = il.getItemAt(il.selectedItem).data;
getURL(il.getItemAt(il.selectedIndex).data, "");
};
il.addEventListener("itemRollOver", ilist);
il.addEventListener("change", ilist);
tl.iconFunction = function (item)
{
return ("flashIcon");
};
var listlist = new Object();
listlist.itemRollOver = function (obj)
{
if (obj.index < vidArr)
{
infoTip.info.text = decs[obj.index];
infoTip._x = _root._xmouse;
infoTip._y = _root._ymouse;
infoTip._visible = true;
infoTip.onMouseMove = function ()
{
this._x = _root._xmouse;
this._y = _root._ymouse;
};
lsound.start();
} // end if
};
listlist.itemRollOut = function ()
{
delete infoTip.onMouseMove;
infoTip._visible = false;
};
listlist.change = function ()
{
csound.start();
if (tl.selectedIndex < vidArr)
{
ns.close();
np.timetext.text = "Loading File...";
playtime(_root.tutorialList.tutList.getItemAt(_root.tutorialList.tutList.selectedIndex).data);
np.info.text = decs[_root.tutorialList.tutList.selectedIndex];
np.title.text = _root.tutorialList.tutList.getItemAt(_root.tutorialList.tutList.selectedIndex).label;
if (files[_root.tutorialList.tutList.selectedIndex].indexOf("***") == -1)
{
np.files.htmlText = "<a href="files/" + files[_root.tutorialList.tutList.selectedIndex] + "">" + "Download tutorial files" + "</a>";
}
else
{
np.files.htmlText = "<font color="#000000">No Files Available</font>";
} // end else if
cb.plabel.gotoAndStop(1);
} // end if
};
tl.addEventListener("itemRollOut", listlist);
tl.addEventListener("itemRollOver", listlist);
tl.addEventListener("change", listlist);
updater.notes.onRollOver = function ()
{
showTip(" Video Updates");
};
updater.notes.onRollOut = updater.notes.onPress = function ()
{
removeTip();
};
updater.notes.onRelease = function ()
{
requester.gotoAndStop(1);
other.gotoAndStop(1);
downloads.gotoAndStop(1);
removeTip();
if (updater._currentframe == 1)
{
updater.gotoAndPlay("on");
}
else
{
updater.gotoAndPlay("off");
} // end else if
};
updater.theMenu.submiter.onRelease = function ()
{
trace ("farter");
if (updater.email.text != "" && updater.email.text.indexOf("@") != -1)
{
loadVariables("updates.php?email=" + updater.email.text, _root);
updater.gotoAndStop(1);
}
else
{
getUpdates.em.borderColor = 16711680;
} // end else if
};
getUpdates.em.onChanged = function ()
{
getUpdates.em.borderColor = 0;
};
about.notes.onRollOver = function ()
{
showTip(" About Me");
};
about.notes.onRollOut = about.notes.onPress = function ()
{
removeTip();
};
about.notes.onRelease = function ()
{
updater.gotoAndStop(1);
requester.gotoAndStop(1);
other.gotoAndStop(1);
downloads.gotoAndStop(1);
removeTip();
if (about._currentframe == 1)
{
about.gotoAndPlay("on");
}
else
{
about.gotoAndPlay("off");
} // end else if
};
downloads.notes.onRollOver = function ()
{
showTip(" FLV Downloads");
};
downloads.notes.onRollOut = dl.notes.onPress = function ()
{
removeTip();
};
downloads.notes.onRelease = function ()
{
updater.gotoAndStop(1);
requester.gotoAndStop(1);
other.gotoAndStop(1);
about.gotoAndStop(1);
removeTip();
if (downloads._currentframe == 1)
{
downloads.gotoAndPlay("on");
}
else
{
downloads.gotoAndPlay("off");
} // end else if
};
requester.notes.onRollOver = function ()
{
showTip("Suggest a Topic");
};
requester.notes.onRollOut = requester.notes.onPress = function ()
{
removeTip();
};
requester.notes.onRelease = function ()
{
updater.gotoAndStop(1);
about.gotoAndStop(1);
other.gotoAndStop(1);
downloads.gotoAndStop(1);
removeTip();
if (requester._currentframe == 1)
{
requester.gotoAndPlay("on");
}
else
{
requester.gotoAndPlay("off");
} // end else if
};
other.notes.onRelease = function ()
{
updater.gotoAndStop(1);
about.gotoAndStop(1);
requester.gotoAndStop(1);
downloads.gotoAndStop(1);
removeTip();
if (other._currentframe == 1)
{
other.gotoAndPlay("on");
}
else
{
other.gotoAndPlay("off");
} // end else if
};
other.notes.onRollOver = function ()
{
showTip(" Get Some Help");
};
other.notes.onRollOut = other.notes.onPress = function ()
{
removeTip();
};
forum.onRelease = function ()
{
getURL("http://gotoandlearn.com/forum", _blank);
};
forum.onRollOver = function ()
{
showTip("The Community");
};
forum.onRollOut = forum.onPress = function ()
{
removeTip();
};
var startxs = controlBar.vol._x;
controlBar.vol._x = startxs + 5.250000E+001;
controlBar.vol.onPress = function ()
{
this.startDrag(false, startxs - 2, this._y, startxs + 72, this._y);
_root.tooltip._x = Math.round(_root._xmouse);
_root.tooltip._y = Math.round(_root._ymouse);
this.onEnterFrame = voller;
};
controlBar.vol.onRelease = controlBar.vol.onReleaseOutside = function ()
{
this.stopDrag();
removeTip();
delete this.onEnterFrame;
};
getUpdates.updates.onRollOver = function ()
{
showTip(" Submit Form");
};
getUpdates.updates.onRollOut = removeTip;
getUpdates.updates.onRelease = function ()
{
if (getUpdates.em.text != "" && getUpdates.em.text.indexOf("@") != -1)
{
loadVariables("updates.php?email=" + getUpdates.em.text, _root);
removeTip();
getUpdates.gotoAndStop(2);
}
else
{
getUpdates.em.borderColor = 16711680;
} // end else if
};
getUpdates.em.onChanged = function ()
{
getUpdates.em.borderColor = 0;
};
infoTip._visible = false;
var ti;
_root.tooltip._visible = false;
hosting.onRelease = function ()
{
getURL("http://www.2advanced.net", "_blank");
};
hosting.onRollOver = function ()
{
this.gotoAndPlay("over");
};
hosting.onRollOut = function ()
{
this.gotoAndPlay("out");
};
Font In The ActionScript Editor At GotoAndLearn
What is the font Lee is using in the ActionScript editor, for example in this video: http://www.gotoandlearn.com/player.php?id=64 ?
I don't know if it is a default font on OSX since I'm using Windows. The font is clearly a monospaced one, and very good looking. I found some similar ones, but not the exact match (for example "i" wasn't matching).
GotoAndLearn Preloader Tutorial Question
Can anyone help me fingure out something that's probablly really easy to explain? I did Lee's preloader tut. and the only change I made was instead of the grey bar moving it's width along with the bytes loaded I created a mask over some text...making the mask move to it's maximum width (so it appears that the text is slowly changing color from right to left).
When I take the mask off and just move the regular box it works! Can I not apply the code provided in the tutorial to a mask? Thanks![/i]
Gotoandlearn Carousel / Limit Reaction Area
hello
i'm tweaking the well known carousel from gotoandlearn v3 flash 8/as2 as a navigation.loading external mc's onto stage.
i searched the forum but couldn't find a post on my problem:
is there a way to restrict the carousel movement e.g. when the cursor moves a certain distance away from the carousel ?
it's slightly disturbing when you load something onto stage and the carousel keeps moving
thx for reading
fla attached ( flash 8 )
Flash Player 6 Code Doesn't Work In Flash Player 7 Or Grater
Hi flashers,
I think some of you know this page http://www.levitated.net
There you can download open source scripts that are quite cool. When I publish on of those codes with the flash player 7 or grater, they doesn't work anymore. Does anyone know why?
thanks
-Tukinu
Loader.close Doesn't Work In Flash But Does Work In Flash Player
When testing a movie in flash with simulate download the Loader.close() function doesn't seem to work when trying to cancel a load but it does work in a browser! You'll need to try to load a movie that has sound. The loader looks as if it stops but then the sound that's in the loaded movie will play, proving it hasn't stopped loading
add a button with instance name btnCancel
Attach Code
function onClickbtnCancel(e) {
// damn thing doesn't work in Flash but works online
ldr.close();
/* this stuff isn't even needed
ldr.contentLoaderInfo.removeEventListener(Event.COMPLETE, onCompleteHandler);
for (var i:uint=0; i < container.numChildren; i++) {
if (container.getChildAt(i) is DisplayObjectContainer && container.getChildAt(i).name == "movieclip loader") {
container.removeChildAt(i);
}
}
*/
}
btnCancel.addEventListener(MouseEvent.CLICK, onClickbtnCancel);
var container = new Sprite();
var ldr = new Loader();
ldr.name = "movieclip loader";
container.addChild(ldr);
var urlReq = new URLRequest("file.swf");
function onCompleteHandler(e) {
addChild(e.currentTarget.content);
}
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
ldr.load(urlReq);
stop();
//--------------------On another note. Anyone know why I can't add text format styles to List components?
import fl.managers.StyleManager;
// set style for all components such as the List
var tf = new TextFormat();
tf.color = 0x000000;
tf.font = "Verdana";
tf.size = 14;
//StyleManager.setStyle("textFormat", tf); // <- this works but that's not the point
StyleManager.setComponentStyle(List, "textFormat", tf); // this works fine for a TextArea, just not a List??
Edited: 07/11/2008 at 10:08:19 AM by Cine-Med
Mp3 Player Can't Get It To Work.
i'm trying to make a small music player in flash 8 with bu i just can't stop it so when i press play again it will play from the beginning again i have tried using some logic but it doesn't seem to work
here are the code i'm using:
//Create Sound Object
s = new Sound();
var check = setInterval(locationP,10);
var position:Number = 0;
function locationP(){
position = s.position;
}
var stoped:Number = 1;
buttons.pauseBtn. _visible = false;
buttons.playBtn.onRelease = function(){
if (stoped == 1) {
s.loadSound("musik/sang1.mp3",false); //load sound file, ture = is streaming
s.stop(); //stop the loaded song from playing till you hit play
s.start(0,1);
set (stoped,0)
}
else {
s.start(position/1000,0);//start playing at positon in ms, /1000 to convert to seconds and loop 1
}
buttons.playBtn._visible = false;
buttons.pauseBtn._visible = true;
}
buttons.pauseBtn.onRelease = function(){
buttons.playBtn._visible = true;
buttons.pauseBtn._visible = false;
s.stop();
}
buttons.stopBtn.onRelease = function(){
stopAllSounds();
buttons.playBtn._visible = true;
buttons.pauseBtn._visible = false;
stoped = 1;
}
Can't Get Mp3 Player To Work. Plz Help
When I open the player .fla, it works even though I've adjusted the xml files asociated with it etc. It publishes to the same folder that website .fla is in.
Then I go to convert the .fla player to a MC so that I can add it into the website timeline, since everything works fine. When I do that then I get these error message, when I ctrl-enter.
description
1120: Access of undefined property randomNumber.
Source
tracksArr[i] = tracksArr[randomNumber = Math.round(Math.random()*(totalTracks-1))];
description
1120: Access of undefined property randomNumber.
Source
tracksArr[randomNumber] = tmpArr;
Please Help Thank you
Can't Get Mp3 Player To Work. Plz Help
When I open the player .fla, it works even though I've adjusted the xml files asociated with it etc. It publishes to the same folder that website .fla is in.
Then I go to convert the .fla player to a MC so that I can add it into the website timeline, since everything works fine. When I do that then I get these error message, when I ctrl-enter.
description
1120: Access of undefined property randomNumber.
Source
tracksArr[i] = tracksArr[randomNumber = Math.round(Math.random()*(totalTracks-1))];
description
1120: Access of undefined property randomNumber.
Source
tracksArr[randomNumber] = tmpArr;
Please Help Thank you
Mp3 Player Won't Work Right
If you go to my site
click here
and go to mp3 area you will see that unless time shows beside the song it takes forever to load. It has to load the whole song. It sucks.
Yet at this site: here http://www.thenewtonbrothers.com/
if you to portfolio > music
there playlist plays simply as you click on it. Simple progress bar. It basically loads like QT movies progressively. I bought mine on flashden and it blows.
Does This Player Work?
I've been fixing a website (mostly PHP, though now running into some Flash), and well... I'm stuck.
Anyway here is the problem, this player doesn't seem to work and I traced it back (after hours of searching through the code) to the player itself. The other player that DOES work, has a lot more code, and actually references to the path of the files being played; this one doesn't! So I figure it's either incomplete, dependent on another file, busted, or, well, I don't know.
I've included the flv file as a download in the link below, any help would greatly be appreciated.
http://24.71.170.190/flashplayer/
MP3 Player Will Not Work
I have been following Lee's tutorials for the MP3 player. After the first tutorial everything seemed fine but after the second I have some problems. Firstly I do have the Webdings font on my PC and I can add it to the stage but when I play the movie it does not show, it shows the letter I typed to create the symbol. Secondly I just cannot get the buttons to work. I have gone over the second tutorial three times now and I still have had no luck at getting it ALL to work.
I have attached all the player files! If you could have a look and see where I went wrong that would be great!
Thanks
Ash
Can't Get Mp3 Player To Work. Plz Help
When I open the player .fla, it works even though I've adjusted the xml files asociated with it etc. It publishes to the same folder that website .fla is in.
Then I go to convert the .fla player to a MC so that I can add it into the website timeline, since everything works fine. When I do that then I get these error message, when I ctrl-enter.
description
1120: Access of undefined property randomNumber.
Source
tracksArr[i] = tracksArr[randomNumber = Math.round(Math.random()*(totalTracks-1))];
description
1120: Access of undefined property randomNumber.
Source
tracksArr[randomNumber] = tmpArr;
Please Help Thank you
WHY? My Flash Player Does Not Work
for some reason, when i open an exported swf, the movie will not load. all that is shown is the white box, and if you right click on it, it says the movie is not loaded! when i test the movie in in the Flash program, it works fine, but when i export it, it will not work! i can make swf from swift 3d, they work fine, but when i export it from flash, all that is shown is a white box!!! i tried reinstalling flash player, but it didn't help, what is the deal?!!!
here is a pic of the desktop
Mp3 Player Doesnt Work In IE
Hey,
I have created an mp3 player, that works fine in flash, works fine when exported to swf. But once I load it via an html page, all movies load, all looks great, but it wont play the songs. the html file is in the same dir as teh swf file that works. How is this possible?
Thnx.
P.S. I do have the newest player.
Why Will This Only Work In Flash Player 7
I have created a simple popup box that gets its text from a function call. It works great in Flash Player 7, but not Player 6. I can't seem to find any functionality that shouldn't work with player 6.
Could someone please take a look and see if they can spot where I have gone wrong. I need this to work with player 6.
Thanks.
_t
Cant Work Out The Bugs With This Car Player.
What I am doing is making a game that you can point and click the "player" (mc) and when he walks to the side of the car (mc) he gets in and it activates the Cars actions. This all works fine. I can make it drive but when I want the character to get out (to disable the cars driving actions and make an arrow appear again to show you can drive.) the car goes to where it started on the movie unless I make it not go back in the car movie clip and just have the player become visible again. If i do that than the play just appears where he got into car and if I use attach player mc to the car mc it attaches to the spot the car first was. Please help me out if you can thanks alot in advance if anyone can help me!
MP3 Player Will Not Work Online
I have made a flash mp3 player and when i use it on my hard drive with the xml file, swf file and mp3 files all in one folder, it works fine.
I have tried uploading them all in the same folder (as it was on my hard drive) to a website but when i had done that the mp3 player comes up but no mp3s will load.
I also tried using
code: <?xml version="1.0" ?>
<songs>
<song display="Song Name" url="Song URL" />
</songs>
in the xml file while it and the swf file were still on the hard drive but with the mp3 uploaded but it will not work like that either.
I would greatly apreciate any advice you could give me.
If you have any questions about the player feel free to ask.
Thank you for your help.
[F6] Getting A Audio Player To Work
Hello all,
I have recently been dabbling around with my first baby steps into action script and I am trying to make a website... It started off really well, but then as it got more advanced I slowly started breaking everything. I can ask about the buttons later. but right now my question is getting my audio player to work. The buttons dont work even though I added up/over/down/hit and the music starts even before you hit the buttons!!!
Any help would be fantastic.
Here is the link to the website WARNING: The music will start when you goto the site!! Its nothing bad, its music from a bugs bunny cartoon. But still if your volume is cranked at work or something its probably not cool to open it.
www.madoverlordstudios.com
Thanks
EDIT: If anyone needs me to send them the code let me know I didnt know what to post here
Flv Player No Work In Safari
hello,
i am using a scroll panel to load swf files into my main page. These swfs all contain flvplayers and scroll panels themselves. In Safari, when i click back and forth between the thumbnails, the swfs load but eventually, in as little as 5 clicks, the player stops appearing. This seems to happen randomly on different thumbnails, at different times. Once this happens, there is no way to reload the player in the swfs unless i refresh the web page. This problem does not appear in firefox. Any ideas?
thanks,
nikolai
Why Doesn't This Work In Player 7 Or 8?
I've got this simple movement script:
ActionScript Code:
onClipEvent(enterFrame) {
var accx;
var friction = -0.11; // set friction value
var graphicX = this._x; // get current x position
var targetX = -53; // set target position
var ax = (targetX-graphicX)/100; // get difference between current position and target, divide by 100
var accx = accx+ax; // set acceleration
var dragx = friction*accx; // set drag
var accx = accx+dragx; // reset acceleration
this._x = this._x+accx; // set new position
}
It works perfectly under player 6 publish settings, but doesn't do anything under player 7 or 8.
Any ideas why?
Flash Player Will Not Work In My IE7
After successfully installing IE7 I went to a site normally using a lot of flash and I got the message to install it. Which I did. However, IE7 for some reason either will not acknowledge it or there is an issue with the new Manage Add-On's section. I checked out the permissions and all of the security features and there seems to be no reason for Flash not to work. I went to the new IE7 site with no luck.
Any of you got any ideas?
|