Search Amazon.com:
Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us $3,400 per month for bandwidth bills alone, and since we don't believe in shoving popup ads to our registered users, we try to make the money back through forum registrations.
«37 »
  • Post
  • Reply
The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

First off, I'm terrible novice when in comes to actionscript. I'm more of an html/css/litte javascript/php person.

I'm trying to make a custom video player (yes make, not using jwplayer). The kind where you can pass in the source of the mp4 video file in html through flashvars. However i have no idea how to accomplish this and days of searching have either not answered my question or done so while answering 700 other questions in the same tutorial so I can't make sense of the code.

Adbot
ADBOT LOVES YOU

5TonsOfFlax
Aug 31, 2001


Where are you getting stuck? And are you using AS2 or AS3? In AS3, flashvars are available from loaderInfo.parameters.

This page seems to have thorough instructions for showing video. I haven't looked that closely though.
http://www.adobe.com/devnet/flashpl...ash_player.html

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

5TonsOfFlax posted:

Where are you getting stuck? And are you using AS2 or AS3? In AS3, flashvars are available from loaderInfo.parameters.

This page seems to have thorough instructions for showing video. I haven't looked that closely though.
http://www.adobe.com/devnet/flashpl...ash_player.html
AS3

Like I said not too familiar with flash. I know in HTML I can have it say
code:
<param name="flashvars" value="file=hereisthemovie.mp4" />
But I don't know at all what to do on the Flash end.

5TonsOfFlax
Aug 31, 2001


The Merkinman posted:

AS3

Like I said not too familiar with flash. I know in HTML I can have it say
code:
<param name="flashvars" value="file=hereisthemovie.mp4" />
But I don't know at all what to do on the Flash end.

In the document class or main timeline, this will get you the value of file:
code:
var movieLocation:String = loaderInfo.parameters.file;

Boo This Man
Mar 25, 2008



I'm currently in a group for class. We have a project to do that involves updating an old website. It involves flash as well. How hard will it be to learn flash?

digital-entropy
Apr 21, 2002



Boo This Man posted:

I'm currently in a group for class. We have a project to do that involves updating an old website. It involves flash as well. How hard will it be to learn flash?

How quick of a learner are you?

fletcher
Jun 27, 2003

ken park is my favorite movie

Boo This Man posted:

I'm currently in a group for class. We have a project to do that involves updating an old website. It involves flash as well. How hard will it be to learn flash?

Yes

Physical
Sep 26, 2007

by T. Finninho


Boo This Man posted:

I'm currently in a group for class. We have a project to do that involves updating an old website. It involves flash as well. How hard will it be to learn flash?

If your familiar with timeline based products then it shouldn't take long. If you are completely new then I'm not sure, it might take you a while. When I first started using flash I didn't "get" how to use it correctly. I would put mostly everything on one layer and then be pissed why everything was moving instead of just the thing I tried to tween moved. I didn't spend alot of time in flash until somewhere in college and all of a sudden it clicked. Things don't happen until the timeline gets to its frame, and everything should get their own layer. Now I can make complicated websites that have hundreds of frames and animations or make a 2D game that has only one frame and I use my AS3 awesomeness to make poo poo happen.

Now I am combating my awful habit of putting ActionScript in library elements instead of putting it all in one layer (which I should call the "Actions" layer) and assigning instance names to everything and attaching the code to the object via the main timeline. However, embedding AS in library elements has its pluses, but when you go to debug you have to check everything, especially if you haven't looked at the document in a long while and forget what the gently caress you were trying to accomplish. Now I try to write stuff down.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

5TonsOfFlax posted:

In the document class or main timeline, this will get you the value of file:
code:
var movieLocation:String = loaderInfo.parameters.file;
But then how do I get that variable into the source of the FLV Playback in the component inspector?

nolen
Apr 4, 2004

butts.


The Merkinman posted:

But then how do I get that variable into the source of the FLV Playback in the component inspector?

1. Give the FLVPlayback component an instance name
2. In your actionscript, you say something like yourFLVPlayback.source = someStringHere;
3. Tada?

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

nolen posted:

1. Give the FLVPlayback component an instance name
2. In your actionscript, you say something like yourFLVPlayback.source = someStringHere;
3. Tada?
That did it, thanks!
Now on to making a custom skin, which I believe has much better documentation.

EDIT: Okay maybe it didn't
I get
code:
VideoError: 1004: Invalid source
    at fl.video::NCManager/connectToURL()
    at fl.video::VideoPlayer/http://www.adobe.com/2007/flash/flvplayback/internal::_load()
    at fl.video::VideoPlayer/load()
    at fl.video::FLVPlayback/doContentPathConnect()
    at fl.video::FLVPlayback/set source()
    at extplayer_fla::MainTimeline/frame1()
VideoError: 1004: Invalid source
    at fl.video::NCManager/connectToURL()
    at fl.video::VideoPlayer/http://www.adobe.com/2007/flash/flvplayback/internal::_load()
    at fl.video::VideoPlayer/load()
    at fl.video::FLVPlayback/doContentPathConnect()
in my timeline I have
code:
var movieLocation:String = LoaderInfo(this.root.loaderInfo).parameters.videoSource;

video.source = movieLocation;
video being the instance name of the FLVPlayback.


It did work before, maybe it still is and i can't see changes because of our stupid server caching?
Even still, I shouldn't have all those errors

The Merkinman fucked around with this message at Sep 22, 2010 around 20:12

Lamb-Blaster 4000
Sep 20, 2007



I'm working with a designer who has cs3 on a mac and I have cs4 on a PC. We've been swapping the same fla for the past couple weeks and funky things are starting to happen. The problems happen seemingly at random and can usually be solved by him saving the fla, giving it to me, I render the swf, save the fla and give it back and magically it works...

Has anyone encountered problems when working with someone on the same file between 2 versions of Flash before?

digital-entropy
Apr 21, 2002



Cross-posting this here. My company has an opening for a UI developer / engineering role. If you come from a strong technical background (i.e. CS degree or similar experience) and are skilled with Adobe Flex, I'd encourage you to check it out. We are located in San Francisco.

http://forums.somethingawful.com/sh...=#post382439977

Lamb-Blaster 4000
Sep 20, 2007



I'm sick and tired of Actionscript's utterly useless error messages. I know a lot of AS programmers say the Flash IDE is the worst for writing AS. So what's the best, and do the alternatives provide error messages that actually help me debug my projects?

Lamb-Blaster 4000 fucked around with this message at Sep 27, 2010 around 02:57

lostatsea
Oct 23, 2005

Set Yourself On Fire

Lamb-Blaster 4000 posted:

I'm sick and tired of Actionscript's utterly useless error messages. I know a lot of AS programmers say the Flash IDE is the worst for writing AS. So what's the best, and do the alternatives provide error messages that actually help me debug my projects?

You have "Permit debugging" checked in the Publish Settings section right?

iopred
Aug 14, 2005

Heli Attack!

Lamb-Blaster 4000 posted:

I'm sick and tired of Actionscript's utterly useless error messages. I know a lot of AS programmers say the Flash IDE is the worst for writing AS. So what's the best, and do the alternatives provide error messages that actually help me debug my projects?

I'm not sure about Flash IDE, but if you use FlashDevelop (free) or FlashBuilder (not free) you will get an improved dev environment, but I'm not really sure if the compiler error messages will get any clearer.

I've found them to usually be quite clear, which ones are you having difficulty with?

ChirreD
Feb 21, 2007
Dutch, baby!

This is a great document about getting good performance in Flash. I think it should be in the OP:
http://help.adobe.com/en_US/as3/mob...ing_content.pdf

Lamb-Blaster 4000
Sep 20, 2007



iopred posted:

I'm not sure about Flash IDE, but if you use FlashDevelop (free) or FlashBuilder (not free) you will get an improved dev environment, but I'm not really sure if the compiler error messages will get any clearer.

I've found them to usually be quite clear, which ones are you having difficulty with?

it's always the null pointer error, sure it gives me a stack trace, but when the function containing the null value is pretty big I'm stuck tracing out everything that could ever be null for one reason or another.

lostatsea posted:

You have "Permit debugging" checked in the Publish Settings section right?

Ya

ChirreD posted:

This is a great document about getting good performance in Flash. I think it should be in the OP:
http://help.adobe.com/en_US/as3/mob...ing_content.pdf

Just looking at the table of contents of that document, it looks really helpful!

iopred
Aug 14, 2005

Heli Attack!

Lamb-Blaster 4000 posted:

it's always the null pointer error, sure it gives me a stack trace, but when the function containing the null value is pretty big I'm stuck tracing out everything that could ever be null for one reason or another.


Ya


Just looking at the table of contents of that document, it looks really helpful!

If you have 'Permit Debugging' checked like previously mentioned, you should get line numbers for all your errors.

eg, I put some bad code on the first frame in the timeline and got this sucker:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Untitled_fla::MainTimeline/frame1()[Untitled_fla.MainTimeline::frame1:3]

You can easily see that the error is on frame1, line 3.

LP0 ON FIRE
Jan 25, 2006

Hey guys, GUYS! Check out my retina display movie theater made out of iPads!

In AS2 I'm trying to clear pixels that were drawn. drawLine is called on an interval. If an element in a array equals C it should clear it. I thought dispose() would be a good choice, but I can't get the program to continue drawing.

code:
function drawLine(){
	with(_root.line_mc){
		if(tI==0){
			lineStyle(1, 0x000000, 50, true, "normal", "square", "miter", 1);
			moveTo(coordX, coordY);
		}
		
		if(tI<codeArray.length){
			codeType = codeArray[tI].charAt(0);
	
			codeVal = codeArray[tI].substring(1,codeArray[tI].length);		
			
			if(codeType=="T"){
				drawAngle += parseInt(codeVal);
				radians = drawAngle* (Math.PI/180);		
			}
		
			if(codeType=="D"){
				DistIncrem = parseInt(codeVal);
				
				coordX += DistIncrem*(Math.cos(radians));
				coordY += DistIncrem*(Math.sin(radians));
			
				lineTo(coordX, coordY);	
				
				myBitmap.draw(_root.line_mc);
				
				removeMovieClip("line_mc");
				
				_root.createEmptyMovieClip("line_mc", 1);
				
				lineStyle(1, 0x000000, 50, true, "normal", "square", "miter", 1);
				
				moveTo(coordX, coordY);
				
				attachBitmap(myBitmap, 2);
				
				
			}
			if(codeType=="C"){
				myBitmap.dispose();

			}
			
			tI+=1;
		}else{
			clearInterval(drawLineInt);
		}
	
	}
}
After myBitmap.dispose(); it does not continue drawing. I tried adding:


var myBitmap:BitmapData = new BitmapData(Stage.width, Stage.height, true);

after dispose() to redefine it, still nothing.

PhonyMcRingRing
Jun 6, 2002


NOG posted:

In AS2 I'm trying to clear pixels that were drawn. drawLine is called on an interval. If an element in a array equals C it should clear it. I thought dispose() would be a good choice, but I can't get the program to continue drawing.

After myBitmap.dispose(); it does not continue drawing. I tried adding:


var myBitmap:BitmapData = new BitmapData(Stage.width, Stage.height, true);

after dispose() to redefine it, still nothing.

I don't know AS2, but I do have a question. Is myBitmap a Bitmap object that's on the stage?

If it is, then redefining the myBitmap instance isn't doing what you think it does. The original myBitmap references the object that's currently on the stage. When you set the myBitmap variable to a new Bitmap, you're only changing the reference the variable is pointing to. The original instance is still on the stage.

iopred
Aug 14, 2005

Heli Attack!

You don't want to dispose, dispose kills the bitmapData in memory and it becomes unusable - and recreating a new bitmapData every frame is inefficient.

Instead you should do something like:

myBitmap.fillRect(myBitmap.rectangle, 0xFFFFFF);

Which will simply fill the bitmapData with white.

LP0 ON FIRE
Jan 25, 2006

Hey guys, GUYS! Check out my retina display movie theater made out of iPads!

PhonyMcRingRing posted:

I don't know AS2, but I do have a question. Is myBitmap a Bitmap object that's on the stage?

If it is, then redefining the myBitmap instance isn't doing what you think it does. The original myBitmap references the object that's currently on the stage. When you set the myBitmap variable to a new Bitmap, you're only changing the reference the variable is pointing to. The original instance is still on the stage.

I'm pretty sure it's an object, and you're right. Thanks.


iopred posted:

You don't want to dispose, dispose kills the bitmapData in memory and it becomes unusable - and recreating a new bitmapData every frame is inefficient.

Instead you should do something like:

myBitmap.fillRect(myBitmap.rectangle, 0xFFFFFF);

Which will simply fill the bitmapData with white.


I've been trying to work on using this, but what happens is it just makes the lines darker and more pixelated. Doesn't make a fill.

EDIT: Actually if I clear the interval when that happens, it does make the screen white. But how in the world does it redraw all the lines the next interval and do a funky darkened effect with it?

EDIT 2: Here's a clue - any color I fill it with, it still becomes white afterward. Just thought I should add that.

EDIT 3: Sorry, it looks like it IS filling and clearing the rest of the lines on next draw, but still only white. My guess is to why the lines look like that, is because they no longer have anything transparent to create different alpha states.

LP0 ON FIRE fucked around with this message at Sep 29, 2010 around 04:08

LP0 ON FIRE
Jan 25, 2006

Hey guys, GUYS! Check out my retina display movie theater made out of iPads!

Solved the problem by attaching myBitmap to a movie clip, ( bitmap_mc.attachBitmap(myBitmap, 2); ) filling, and then removing both movie clips and creating new clips. Maybe not the best solution but works like a charm.

Complete code listing if anyone wants to play around with it. I'd like it to be faster if anyone has suggestions.

http://codepaste.net/jbazwf

edit: Setting the interval to 1 makes it go a ton faster. Not used to having <30 be better.

edit2: improved version can be viewed here: http://www.vectorsector.net/vectorDraw/vectorDraw.html

I'm going to go all out and make a simple language for it.

LP0 ON FIRE fucked around with this message at Sep 30, 2010 around 18:08

AxiomOnline
Aug 23, 2004


Hey gang,

I am working through the book "Foundation Game Design with Flash" and am having a problem with one of the projects. Since I am having no luck with the book forums, I thought I'd pester the SA forums with my question...

I keep getting this error
1046: Type was not found or was not a compile-time constant: bomb.

I checked to make sure that bomb has an instance name and that the .fla class is pointing to the .as file. but those two are set correctly.

Any insight on this?

http://www.filefactory.com/file/b3b...Playground2.rar

Lamb-Blaster 4000
Sep 20, 2007



swf runs swimmingly on in Windows, fucks up on mac.

I've been passing an fla back and forth with a designer. When I run the swf on my Windows 7 machine at home it works perfectly, but when we run it on his OSX machine it fucks up.

The main issue revolves around a couple parts that rely on a event listener. It almost seems like when it runs in OSX the event doesnt always fire?

Initially he had CS3, but upgraded to CS5 and the same problems stayed. Any known problems like this? Crossposting this in the Adobe forums as well.

here's the code that sets the listener (sorry for the formatting, it was this or crazy wide from working on a wide screen monitor)

code:

trace("========================");
var portLoader:Loader = Loader(parent.parent['portLoader']);

var theSite:MovieClip;

portLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
										function(e:Event)
{
theSite = MovieClip(Loader(parent.parent['portLoader']).content);

trace('the site is ' + theSite.name);

var theNav = theSite['customNav'];

theNav.addEventListener('draw',onRedraw);
}
)
trace("========================");

var redrawingNav:Boolean = false;

function onRedraw(e:Event)
{
	trace('redraw');
	redrawingNav = false;
}
and here's the code that throws the event- just a function that draws a set of thumbnails by looping over some xml and creating a bunch of custom classes. There's nothing there that would cause the function to return before the event is dispatched.

code:
public function draw():void
		{
			//var images:XMLList = album.children();
			var images:XMLList = xml.album[currentAlbum].img;
			var album:XML = xml.album[currentAlbum];//new XML(xml.album[0]);
			var curPos:int = 0;
			
			if(numChildren > 0)
			{
				for(var xx:int = numChildren - 1; xx >= 0; xx--)
				{
					removeChildAt(xx);
				}
			}
			for(var i:int = 0; i < images.length(); i++)
			{
				var image:XML = new XML(images[i]);
				
				//trace(album.attribute('tnPath') + image.attribute('src'));
				
				
				
				var tnPath:String = image.attribute('tn').length() == 0 ? 
										album.attribute('tnPath') + image.attribute('src') : album.attribute('tnPath') + image.attribute('tn');
										
				//trace(album);
				var imageShell:SSPCustomNavThumb = new SSPCustomNavThumb(tnPath,getThumbProperties());
				
				if(navOrientation == 'vertical')
				{
					imageShell.y = curPos;
					curPos += getThumbProperties().height + thumbMargin;
				}
				else
				{
					imageShell.x = curPos;
					curPos += getThumbProperties().width + thumbMargin;
				}
				
				//events and such
				imageShell.useHandCursor = true;
				imageShell.buttonMode = true;
				imageShell.addEventListener('click',onImageClick);
				addChild(imageShell);
			}
			
			dispatchEvent(new Event(SSPCustomNav.DRAW));
		}

iopred
Aug 14, 2005

Heli Attack!

The number one reason for events not firing are the loaders being garbage collected.

In this case it doesn't look like its doing that, it could be something about code on frames, make sure you put a stop() in there, could help, but unlikely.

Also anonymous functions are fairly terrible, try splitting it out like:
code:
portLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);

function completeHandler(event:Event):void {
}
If you keep having problems debugging, stick a trace in an ENTER_FRAME and trace out your loader, make sure its never being garbage collected.

Finally keep your event types the same, in one place you use: SSPCustomNav.DRAW and in another you just use 'draw'

5TonsOfFlax
Aug 31, 2001


There's nothing wrong with anonymous functions, used properly. But in this case a proper named method is better. Also, I find the use of bracket syntax to access properties a bad sign, and reaching up the display list via "parent.parent" (multiple times!) is awful. But not technically wrong.

Do make sure that the event constant SSPCustomNav.DRAW is exactly "draw" (case counts).

Your dispatchEvent line does not create a bubbling event, so I hope that that function is in your theNav instance and not some child clip.

I do not see the actual call to load in the code you posted. That means it might have already completed by the time you add the COMPLETE listener, and then the DRAW listener would never have been added.

Here's some updated code that fixes my pet peeves.

In wherever load is called:
code:
//Loader declaration goes here.
portLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, Bob.completeListener);
//call to load goes here.
I will refer to the instance containing this code as 'Bob'.
code:
trace("========================");
var theSite:MovieClip;

function completeListener(e:Event):void{
  theSite = MovieClip(LoaderInfo(e.currentTarget).content);

  trace('the site is ' + theSite.name);

  //use whatever the real type is.  Don't use bracket syntax if you don't have to,
  //that turns a compile-time error into a runtime error.  Doesn't help with 
  //dynamic classes like MovieClip, though.
  var theNav:MovieClip = theSite.customNav;

  theNav.addEventListener(SSPCustomNav.DRAW, onRedraw);
}
trace("========================");

//who the gently caress ever sets this to true?  I assume yet another class/instance
var redrawingNav:Boolean = false;

function onRedraw(e:Event):void{
  trace('redraw');
  redrawingNav = false;
}
I haven't done much with the code below except fix some ugly formatting and the loop which removes all children. Is that really necessary? Couldn't you just update them?
code:
public function draw():void{
  var images:XMLList = xml.album[currentAlbum].img;
  var album:XML = xml.album[currentAlbum];//new XML(xml.album[0]);
  var curPos:int = 0;
  while(numChildren > 0){
     removeChildAt(0);
  }
  for(var i:int = 0; i < images.length(); i++){
    //this shouldn't create a new XML object.  images[i] should already be one.
    //I'm not sure if you even need to cast.
    var image:XML = XML(images[i]);
    var tnPath:String = image.attribute('tn').length() == 0 ? album.attribute('tnPath') + image.attribute('src') : album.attribute('tnPath') + image.attribute('tn');
    var imageShell:SSPCustomNavThumb = new SSPCustomNavThumb(tnPath,getThumbProperties());
    //'vertical' should be a constant.
    if(navOrientation == 'vertical'){
	imageShell.y = curPos;
	curPos += getThumbProperties().height + thumbMargin;
    }else{
	imageShell.x = curPos;
	curPos += getThumbProperties().width + thumbMargin;
    }
		
    //events and such
    imageShell.useHandCursor = true;
    imageShell.buttonMode = true;
    //always use constants for event types.
    imageShell.addEventListener(MouseEvent.CLICK, onImageClick);
    addChild(imageShell);
  }
  //add the true argument if you need the event to bubble
  dispatchEvent(new Event(SSPCustomNav.DRAW, true));
}

iopred
Aug 14, 2005

Heli Attack!

5TonsOfFlax posted:

There's nothing wrong with anonymous functions, used properly.

Anonymous functions in general can be used for plenty of good, used in listeners is almost always a bad idea, forget to clear the listener in the function and you've made memory unclearable.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

I've got my basic movie player coded!
It passes the location of the mp4 as well as the color of the play/pause button through flashvars.

If, in HTML, I set the size of the SWF, the mp4 scales proportionally, leaving letterbox if it's not the right ratio. This is perfectly fine and what I want. However, the play/pause movie clips also understandable scale. I don't want that.

Is there a way either in flash or, preferably via flashvars, to set the play and pause movie clips to be a set pixel size regardless of how big the swf is?

iopred
Aug 14, 2005

Heli Attack!

The Merkinman posted:

I've got my basic movie player coded!
It passes the location of the mp4 as well as the color of the play/pause button through flashvars.

If, in HTML, I set the size of the SWF, the mp4 scales proportionally, leaving letterbox if it's not the right ratio. This is perfectly fine and what I want. However, the play/pause movie clips also understandable scale. I don't want that.

Is there a way either in flash or, preferably via flashvars, to set the play and pause movie clips to be a set pixel size regardless of how big the swf is?

Two ways to do it, either you set stage.scaleMode to StageScaleMode.NO_SCALE. If you do this you have to position your buttons correctly based on stage.stageWidth and stage.stageHeight, and scale your video in the same way.

The other way is to leave the scaling as normal, and calculate the current scale ratio yourself, with exportedWidth/Stage.stageWidth, and scale your buttons down by that amount.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

iopred posted:

Two ways to do it, either you set stage.scaleMode to StageScaleMode.NO_SCALE. If you do this you have to position your buttons correctly based on stage.stageWidth and stage.stageHeight, and scale your video in the same way.

The other way is to leave the scaling as normal, and calculate the current scale ratio yourself, with exportedWidth/Stage.stageWidth, and scale your buttons down by that amount.
The play and pause buttons are the exact center of the swf, even the registration for said buttons is the center.

It's all ratios?
There's no way to tell the play/pause to be exactly 50px in both width and height regardless of the scaled swf without doing math and manually putting in a scale percentage?

iopred
Aug 14, 2005

Heli Attack!

The Merkinman posted:

The play and pause buttons are the exact center of the swf, even the registration for said buttons is the center.

It's all ratios?
There's no way to tell the play/pause to be exactly 50px in both width and height regardless of the scaled swf without doing math and manually putting in a scale percentage?

Sorry to be the bearer of bad news You can set the height/width of the buttons to be 50px, but that still gets scaled, so you need to do 50 * ratio

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

iopred posted:

Sorry to be the bearer of bad news You can set the height/width of the buttons to be 50px, but that still gets scaled, so you need to do 50 * ratio
How do players like JWPLayer work? It seems the navigation is always the same height and the only interface that changes size is the scrub bar.

iopred
Aug 14, 2005

Heli Attack!

The Merkinman posted:

How do players like JWPLayer work? It seems the navigation is always the same height and the only interface that changes size is the scrub bar.

They set the stage to NO_SCALE and may or may not re-position everything in a CHANGED event. The only thing that needs to be scaled at that point is the video.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

iopred posted:

They set the stage to NO_SCALE and may or may not re-position everything in a CHANGED event. The only thing that needs to be scaled at that point is the video.
I see, well unfortunately I have no idea how to do any of that. I'm guessing the fact that I only have two movie clips (play and pause) and they're each in the exact center would make things easier?

iopred
Aug 14, 2005

Heli Attack!

The Merkinman posted:

I see, well unfortunately I have no idea how to do any of that. I'm guessing the fact that I only have two movie clips (play and pause) and they're each in the exact center would make things easier?

Heres an example, contains everything you need to know.

http://superinterwebnethighway.com/files/reposition.fla

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

iopred posted:

Heres an example, contains everything you need to know.

http://superinterwebnethighway.com/files/reposition.fla
Oh wow, thanks. I'll look at it now.

EDIT:
Made a few changes to the code, but it all works now, thanks!
The play pause buttons can have their size and color changed via flashvars and the video source is the same way. Now we can use this swf for a variety of sites and never have to edit it directly!

The Merkinman fucked around with this message at Oct 8, 2010 around 20:17

Hibame
Feb 20, 2008


How does one embed xml files in flash? I have seen a few ways but it seems very painful if there are more than a handful of xml files.

Adbot
ADBOT LOVES YOU

Pungent Mammy
Jul 29, 2003

The pig is a huge fat pig.


I'm trying to style some text in a dynamic text box using html. It accepts the coding and shows all the proper line breaks, but it overrides the text styling with the settings that are applied in the properties box on the stage, so it's not showing bolded text or size changes at all. I tried deleting those settings but it just defaults back to the last settings I had.

Ideas?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply
«37 »