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.
  • 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!

RizieN posted:

I've got another quick question.

I have a movieclip in Scene1 and within that movieclip are lots of buttons and other menus. The buttons should go to a product specification page. I've got the Product Spec Pages in Scene2, each on their own frame.

In the movieclip the button's action is

code:
on(press){
          gotoAndStop("Scene2", 1);
}
But it seems to just go back to frame 1 of the movieclip. Does it not recognize scene 2 because its in a movieclip in Scene1? How can I get it to Load Scene2 frame 1?

I tried the same code on a button that wasn't in a movieclip and worked fine...

I'd appreciate any amount of help, thanks.

Since it's nested Flash is confused as to WHAT you want to gotoAndStop. Since you want the main timeline to do it you need to specify _root

code:
on(press){
          _root.gotoAndStop("Scene2", 1);
}
That should do the trick

Adbot
ADBOT LOVES YOU

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.

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.

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?

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

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?

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?

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.

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?

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

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 made that simple play pause player and it works great.
I'd like to re-purpose and basically just change it to play automatically. I can't for the life of me figure out how to do it.

I've tried making autoPlay true for the flv component called my_FLVPlybk in the component inspector
I've tried adding autoplay=true in the html file under flashvars
I've tried
code:
addEventListener(Event.ENTER_FRAME,myFunction);
function myFunction(event:Event) {
    my_FLVPlybk.play();
}
Nothing works.

The Merkinman
Apr 22, 2007

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

Here's all the code if it helps
code:
import flash.display.StageScaleMode;
import flash.display.StageAlign;
import flash.events.Event;

import fl.video.VideoEvent;

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeHandler);



var videoPlaying:Boolean = false;
var movieLocation:String = LoaderInfo(this.root.loaderInfo).parameters.videoSource;
var btnColor:String = LoaderInfo(this.root.loaderInfo).parameters.buttonColor;
var btnSize:Number = LoaderInfo(this.root.loaderInfo).parameters.buttonSize;

my_FLVPlybk.source = movieLocation;
//my_FLVPlybk.source = "clips/720p.mp4";



var myPlayColor:ColorTransform = playBtn.transform.colorTransform;
myPlayColor.color = int(btnColor);
playBtn.transform.colorTransform = myPlayColor; 
var myPauseColor:ColorTransform = stopBtn.transform.colorTransform;
myPauseColor.color = int(btnColor);
stopBtn.transform.colorTransform = myPauseColor; 

playBtn.width = int(btnSize);
playBtn.height = int(btnSize);
stopBtn.width = int(btnSize);
stopBtn.height = int(btnSize);


playBtn.addEventListener(MouseEvent.CLICK, playVideo);
playBtn.addEventListener(MouseEvent.MOUSE_OVER, displayButtons);
stopBtn.addEventListener(MouseEvent.MOUSE_OVER, displayButtons);
stopBtn.addEventListener(MouseEvent.CLICK, stopVideo);
cover.addEventListener(MouseEvent.MOUSE_OVER, displayButtons);
cover.addEventListener(MouseEvent.MOUSE_OUT, hideButtons);
my_FLVPlybk.addEventListener(VideoEvent.COMPLETE, videoComplete);
playBtn.buttonMode = stopBtn.buttonMode = true;

playBtn.visible = true;
stopBtn.visible = false;

function displayButtons(e:MouseEvent):void {
    //hideButtons(null);
    if (videoPlaying) {
        playBtn.visible = false;
        stopBtn.visible = true;
    } else {
        playBtn.visible = true;
        stopBtn.visible = false;
    }
}

function hideButtons(e:MouseEvent):void {
    playBtn.visible = stopBtn.visible = false;
}

function playVideo(e:MouseEvent):void {
    videoPlaying = true;
    displayButtons(null);
    my_FLVPlybk.play();
    my_FLVPlybk.autoRewind = false;
}

function stopVideo(e:MouseEvent):void {
    videoPlaying = false;
    displayButtons(null);
    my_FLVPlybk.stop();
    my_FLVPlybk.autoRewind = false;
}

function videoComplete(e:VideoEvent):void{
    my_FLVPlybk.autoRewind = true;
    videoPlaying = false;
    displayButtons(null);
}




function resizeHandler(event:Event):void {
    reposition();
}
function reposition():void {

    var stageWidth:int = stage.stageWidth;
    var stageHeight:int = stage.stageHeight;

    /*playBtn.x = 0;*/
    /*playBtn.y = stageHeight - playBtn.height;*/
    playBtn.x = stageWidth / 2;
    playBtn.y = stageHeight / 2;
    
    stopBtn.x = stageWidth / 2;
    stopBtn.y = stageHeight / 2;

    my_FLVPlybk.x = 0;
    my_FLVPlybk.y = 0;
    my_FLVPlybk.width = stageWidth;
    my_FLVPlybk.height = stageHeight/* - Math.max(one.height, two.height)*/;
}

reposition();

The Merkinman
Apr 22, 2007

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

lostatsea posted:

From the looks of your code, your video is an mp4? Have you tried a simple flv/f4v? I've had problems with mp4's in the past and they wouldn't play until they were completely loaded.
Well that line is commented out, the video source is actually set via flashvars in the html. Still for an mp4 file though.

I hope I don't have to change it to flv as the flash is a fallback for a larger HTML5 based video player. The mp4 can either be served directly in Safari/Chrome or via Flash for other browsers no need to have multiple encodings.

I'll try it with an flv when I'm back at work on Monday though.

EDIT:
That doesn't seem to be the problem
videoforeverybody autoplays its mp4 file in Flash (Use IE 6 - 8 for it to load the Flash version)
EDIT 2:
Figured it out, I think I was looking at the wrong swf

The Merkinman fucked around with this message at Nov 2, 2010 around 14:19

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 am not a Flash developer

I made a video player that uses flashvars to dynamically pull in a movie through HTML rather than embedding it into the swf itself.

What do I have to do in order to take advantage of the new Stage Video optimizations?
Also I only have CS4, though a copy of CS5 is available if need be.

The Merkinman
Apr 22, 2007

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

Not sure if this is the correct thread or not:

I have two flash files in the same html page, but it's stacking them in the wrong order. $foo appears below $bar when I want it the other way around.
I have the z-index for $foo at 9998 and $bar at 2, both are set to transparent, but Flash just doesn't care

The Merkinman
Apr 22, 2007

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

willemw posted:

Do you have a page up somewhere with the code (or can you post the code for the html here)?

<style>
#main{
width:990px;
margin:auto;
background-color:#fff;
position:relative;
margin-bottom:100px;
}
#header{
height:<?php echo $headerheight; ?>px;
background-repeat:no-repeat;
}
#sitebody{
position:relative;
background-color:#fff;
}
#bodyimage{
background-image:url(<?php echo $bodyimage; ?>);
height:<?php echo $bodyheight; ?>px;
background-color:#fff;
}
#ad300250{
width:300px;
height:250px;
z-index:2;
position:absolute;
left:684px;
top:16px;
}
#ad72890{
width:728px;
height:90px;
margin:18px auto;
}
</style>
<body>
<div id="main">

<div id="overlayDisplayAd" style="display:none;position:absolute;top:165px;left:410px;z-index:9998;">
<!-- flash element I want on the complete top goes here -->

</div>
<div id="header">
</div>
<div id="sitebody">
<div id="bodyimage">
</div>
<div id="ad300250">
<!-- flash element I want UNDERNEATH the previous one goes here -->
</div>
<img src="../pushdown/images/footer.png"/>
</div>
</div>
</body>

The Merkinman
Apr 22, 2007

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

willemw posted:

I tested that code and it seems to work for me (using some standard <embed> code). The 'display: none' on the top flash is a bit strange though. Are you using javascript to show that div?
What standard embed code are you using? This is only for mockups so I guess I dont' have to use the exact embed code that's on the sites


Yeah it automatically comes in after 5sec. One of those full screen ad things.

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 hosted a version here.

The 300x250 is put in via swfobject, the overlay is output via a much bigger mess of document.write (that's what the company used long before I showed up).

It seems to work on the live sites, but not in this little mockup demo I've made, and I'm trying to figure out why.

The Merkinman
Apr 22, 2007

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

lostatsea posted:

Looks fine to me. Is there a specific browser scenario where it's not working?
I'm home now, but Firefox 5, Chrome 12 and 13 in both Ubuntu and Windows, can't test Opera or Safari right now. It does work fine in IE (6?) though.

EDIT: Works in the default browser for Android 2.2 as well.

EDIT2: Windows 7 - Works in IE (any version) and Safari, does not work in Chrome (12), Opera (11.50), or Firefox (5)

The Merkinman fucked around with this message at Jul 18, 2011 around 15:09

The Merkinman
Apr 22, 2007

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

Freelancepolice posted:

What's the general consensus from Flash pro's about the oncoming march of HTML 5? I'm no AS3 expert but I've been playing with flixel for a few months and I'm curious as to people's thoughts.

Depends on your audience and what you're going to make.
If it's simple enough that it could be done in javascript, then do that.
If it would require deciding between Flash and HTML5, then which market is more important, Internet Explorer (6-8) users, or iOS users?

The Merkinman
Apr 22, 2007

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

Back trying to do video in Flash. I don't know flash, but people are work just oh oh hey The Merkinman is the front end web developer so he'll just do it.

Anyway, really simple, just want a video to automatically play and be mute.

I started an AS3 file and dragged in teh FLVplayback component (instance name myvideo), muteButton (muteBtn) and PlayPauseButton (playBtn).

Under properties for myvideo I have autoPlay checked and volume at 0. My Action Script code in the first frame consists of:
code:
myvideo.muteButton = muteBtn;
myvideo.playPauseButton = playBtn;
Problem is play/pause works fine, but the mute button shows as if audio is playing so it's setting the volume to 0 when it already is.

Also how the heck do you do getURL in AS3? I put the following: (clilckTagBtn is the instance name of the button)
code:
clickTagBtn.addEventListener(MouseEvent.CLICK, onMouseClick);
function onMouseClick(e:MouseEvent):void
{
	var request:URLRequest = new URLRequest(clickTag);
	navigateToURL(request, "_blank");
}
And the video wouldn't play and the play/mute buttons were having an epileptic fit.

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:

Sounds like something threw an error. What was the error?

What is clickTag? It needs to be a String url.

Did you import flash.net.navigateToURL?
It's a variable pulled in through the html

No I didn't what is that?



Ignoring the clicktag stuff for now, if I comment all that out so my code is simply
code:
myvideo.muteButton = muteBtn;
myvideo.playPauseButton = playBtn;
The component parameters for FLVPlayBack AutoPlay checked and Volume 0, the video autoplays mute (which I want) but while the play/pause button works, the mute one doesn't. There are also no compiling errors.

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:

Post your FLA and one of us can take a look.
http://www.mediafire.com/?as0pq2fmha8d3of

The Merkinman fucked around with this message at Sep 21, 2011 around 14:13

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:

Can't open it, probably because it's a CS5 or higher FLA. You can try saving as an older version if you're up for it.

I got code from somewhere else using netstream that does what I need, but here is the file from before in a CS4 format so I can at least learn what I did wrong
http://www.mediafire.com/?0e73nxfdn5377u1

Adbot
ADBOT LOVES YOU

The Merkinman
Apr 22, 2007

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

We started doing video ads for clients. The type where it plays automatically but silent. The swf file pulls the .flv from the Akamai server and it works properly.

The problem is previewing.
Now I can save it somewhere and in the standalone flash player settings tell it to be a trusted location.

However, what is a good way to be able to preview the file for people that either don't have the standalone player or anything short of "CLICK HERE" is too complex of instructions?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply