Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
DS Flash Players:
external background file in dsplayer
elric



Joined: 20 Mar 2006
Posts: 160

Posted: 10/13/08 16:29 
Hi all,

I'm trying to setup so that I can use an external JPG for the background of my theme dsplayers.

It works great standalone:

The same file is embedded here, but it doesn't work in the theme:


I can't find anything in {function.jr_flash_player.php}...



Last edited by elric on 11/13/08 17:41; edited 1 time in total
Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 10/13/08 16:31 
I don't know how you're doing it, but if you're pointing something to an image file somewhere, make sure you are using an absolute path, and not a relative path.


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
elric



Joined: 20 Mar 2006
Posts: 160

Posted: 10/13/08 16:50 
the image is called out in action script inside the FLA file then compiled. So, using an absolute path won't work, as the hard coded JR variables will be compiled in the FLA as well. i'm doing this so that when I add new themes, I don't need to re-compile a new player with a new backround...make sense?

The image is in the same directory .swf file. Strange that it works when called directly but not through the theme.


smith.kyle:
I don't know how you're doing it, but if you're pointing something to an image file somewhere, make sure you are using an absolute path, and not a relative path.


Back to top
daddysylem
DS Flash Players


Joined: 30 Mar 2005
Posts: 4086
Location: Southern California

Posted: 10/14/08 08:45 
When you call the player into an Artist page, its going to be looking for everything in the media or members directories. And I think your problem is that you have the graphics in the Theme directory. Try changing your theme.cfg file so it creates a copy of your graphic in each artist directory that is using that theme and see if that helps.

And it might be easier to call your graphic into the player using the FlashVar function in the embed code instead of having it hard coded in the Fla. That way you could change the URL to the graphic whenever you wanted without recompiling the player.

Let me know......


_________________
I have no idea why I do this..................
Email: daddysylem[at]dsplayerskins.com
DSPlayerSkins.com
GCFireSprinkler.com
Back to top
elric



Joined: 20 Mar 2006
Posts: 160

Posted: 10/14/08 13:58 

daddysylem:
And it might be easier to call your graphic into the player using the FlashVar function in the embed code instead of having it hard coded in the Fla. That way you could change the URL to the graphic whenever you wanted without recompiling the player.

Let me know......


Hi Sylem, thanks for the clues. I LOVE this idea. Here is what I've done:

I added this:
<param name="bgimage" value="'. $params['bgimage'] .'"/>
to line 229 of {function.jr_flash_player.php}

I added this:
bgimage="`$JAMROOM_URL`/themes/Theme_Dev/images/`$SITE_STYLE`/playerControlBKG.jpg"
to the "{jr_flash_player player_type="`$JAMROOM_URL...} smarty tag.
of {common_header.tpl}

Rebuild the profiles, and checked the page. The image doesn't show up...but I view the source code of , and the new param is printing as expected:
<param name="bgimage" value="themes/Theme_Dev/images/Theme_Dev/playerControlBKG.jpg"/>

It feels like this is ~almost~ right....

~E



Last edited by elric on 11/13/08 17:43; edited 1 time in total
Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 10/14/08 14:04 
Did you add the flashvar in the actionscript/.fla file?


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
elric



Joined: 20 Mar 2006
Posts: 160

Posted: 10/14/08 14:09 

smith.kyle:
Did you add the flashvar in the actionscript/.fla file?


Hmm, didn't think I needed to do that, as this is similar to adding bgcolor=#fffff (for example)

Googling...

Back to top
elric



Joined: 20 Mar 2006
Posts: 160

Posted: 10/14/08 15:27 
ok, added this to the FLA file:
/* Specify default image in case there wasn't a value passed using FlashVars. */
var imgUrl:String = "/themes/Theme_Dev/images/Theme_Dev/playerBkg.jpg";
if (_level0.imgURL != undefined) {
// If image was specified, overwrite default value.
imgUrl = _level0.imgURL;
}

this.createEmptyMovieClip("img_mc", 10);
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip):Void {
target_mc._x = (Stage.width - target_mc._width) / 2;
target_mc._y = (Stage.height - target_mc._height) / 2;
}
mclListener.onLoadError = function(target_mc:MovieClip):Void {
target_mc.createTextField("error_txt", 1, 0, 0, 100, 20);
target_mc.error_txt.autoSize = "left";
target_mc.error_txt.text = "Error downloading specified image;\n\t" + target_mc._url;
}
var myMCL:MovieClipLoader = new MovieClipLoader();
myMCL.addListener(mclListener);
myMCL.loadClip(imgUrl, img_mc);


This DOES load the specified default image.

I added this to the function.jr_flash_player.php file:

<param name="FlashVars" value="'. $params['FlashVars'] .'"/>
and

FlashVars="'. $params['FlashVars'] .'"

This to the common_header.tpl:

FlashVars="imgUrl=`$JAMROOM_URL`/themes/Theme_Dev/images/`$SITE_STYLE`/playerControlBKG.jpg"

the code is rendering the variable correctly: mydomain.com/members/57/index.php but the image showing is still the default image.

2 steps forward, 1 step back...



Last edited by elric on 11/13/08 17:43; edited 1 time in total
Back to top
daddysylem
DS Flash Players


Joined: 30 Mar 2005
Posts: 4086
Location: Southern California

Posted: 10/14/08 17:32 
I'm not a flash expert and maybe Nate could give some better advice on this than me, but it looks to me like your first trying to load a default image into the player and then if there is a second image defined in the flash variable, load that instead ??

Why dont you just install a default image in the player to begin with so it doesnt have to be loaded. Then all you would have to do is worry about the code needed to load a second image "over" the default image if you want to change the default. I think the code needed would be allot simpler and all you would need to do is keep the second image the same size as the default image.

I already created a player that does this but I had issues having it pull the background graphic out of some kind of generic directory that could be used on anyones site. The problem I had was with the depth of the Jamroom directory in the URL which can be different on everyones site along with a few other issues related to using this idea in many different skins and themes.

But I basically just used this in the frame that held the default background image....
createEmptyMovieClip("contain",0);
contain.loadMovie("../switch_ls.jpg")

And then you dont need a Flashvar because you should be able to define where you want the player to look for the "switch_ls.jpg" and if one isn't there it just shows the default background image. The code above tells it to look 2-directories down the URL for a "switch_ls.jpg" file.

I don't know if this helps, but like I said I'm not a flash expert.......


_________________
I have no idea why I do this..................
Email: daddysylem[at]dsplayerskins.com
DSPlayerSkins.com
GCFireSprinkler.com
Back to top
elric



Joined: 20 Mar 2006
Posts: 160

Posted: 10/15/08 09:57 

daddysylem:
I'm not a flash expert and maybe Nate could give some better advice on this than me, but it looks to me like your first trying to load a default image into the player and then if there is a second image defined in the flash variable, load that instead ??


But I basically just used this in the frame that held the default background image....
createEmptyMovieClip("contain",0);
contain.loadMovie("../switch_ls.jpg")

And then you dont need a Flashvar because you should be able to define where you want the player to look for the "switch_ls.jpg" and if one isn't there it just shows the default background image. The code above tells it to look 2-directories down the URL for a "switch_ls.jpg" file.

I don't know if this helps, but like I said I'm not a flash expert.......


Unfortunately, Jamroom doesn't like relative linking like this. That's why I'm trying to use a FlashVar, so that the absolute link gets added at runtime. It should be simple enough, I just can't figure out what I'm missing.

Back to top
daddysylem
DS Flash Players


Joined: 30 Mar 2005
Posts: 4086
Location: Southern California

Posted: 10/15/08 15:20 

elric:

daddysylem:
I'm not a flash expert and maybe Nate could give some better advice on this than me, but it looks to me like your first trying to load a default image into the player and then if there is a second image defined in the flash variable, load that instead ??


But I basically just used this in the frame that held the default background image....
createEmptyMovieClip("contain",0);
contain.loadMovie("../switch_ls.jpg")

And then you dont need a Flashvar because you should be able to define where you want the player to look for the "switch_ls.jpg" and if one isn't there it just shows the default background image. The code above tells it to look 2-directories down the URL for a "switch_ls.jpg" file.

I don't know if this helps, but like I said I'm not a flash expert.......


Unfortunately, Jamroom doesn't like relative linking like this. That's why I'm trying to use a FlashVar, so that the absolute link gets added at runtime. It should be simple enough, I just can't figure out what I'm missing.


If I get some time this weekend I'll play with this and see if I can help. But right now I really dont know what to tell you.

Sorry......


_________________
I have no idea why I do this..................
Email: daddysylem[at]dsplayerskins.com
DSPlayerSkins.com
GCFireSprinkler.com
Back to top
elric



Joined: 20 Mar 2006
Posts: 160

Posted: 10/15/08 15:32 

daddysylem:


If I get some time this weekend I'll play with this and see if I can help. But right now I really dont know what to tell you.

Sorry......


No worries, man!! It's all a learning curve. If i figure out something, i'll post it. In the meantime, i just put my flash smarty code inside a div, set the style of a div with the {$JAMROOM_URL}/themes/Theme_Dev/images/{$SITE_STYLE}/playerControlBKG.jpg for the background, re-compiled my player with a transparent background, and it works quite nicely across IE6, IE7, Safari, and FireFox. It's not as sexy as I would have liked, but it's quite functional, and more importantly, scalable.


Have a great evening!
~E

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
DS Flash Players

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.