JavaScript to swap an img for an swf, need help...

Heya,
So I have an mp3 player that is generated dynamically, it
displays a compact play button beside each song an artist has
published. But what happens on the high content pages is the flash
just jams the browser. So I want to show an image to start, then,
when it's clicked, I want it to swap out the swf file, can anyone
help me out?
I'm confident I should be able to write it myself I am just
unsure of the proper syntax to use when writing it. I figure it
will look something like this...
When the page
loads {
display this image
but when it's
clicked swap it out with {
this swf
}

Sorry for the delayed response, I work with two other
programmers so often times they're not available to give input at
the time I post in here. Anyway, one of the other programmers
solved the problem. Here was the conclusion...
// Display functions: to be used in partials and bodies
function ocp_audio_player($uri, $compact = false, $return =
false) {
$player_path = $compact ? '/flash/compact_mp3_player.swf' :
'/flash/regular_mp3_player.swf';
$width = $compact ? '17' : '120';
$autostart = $compact ? 'true' : 'false';
$uri_for_player = $compact ? "' + uri + '" : $uri;
$player = <<<QQQ
<object width="{$width}" height="18"
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="
http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">
<param name="movie" value="{$player_path}" />
<param name="bgcolor" value="#fff" />
<param name="menu" value="false" />
<param name="quality" value="medium" />
<param name="flashvars"
value="file={$uri_for_player}&autostart={$autostart}&shuffle=false&shownavigation=false&d isplayheight=0&showicons=false&autoscroll=true&repeat=list"
/>
<embed src="{$player_path}" bgcolor="#ffffff"
menu="false" quality="medium" type="application/x-shockwave-flash"
pluginspage="
http://www.macromedia.com/go/getflashplayer"
height="19" width="{$width}"
flashvars="file={$uri_for_player}&autostart={$autostart}&shuffle=false&shownavigation=fal se&displayheight=0&showicons=false&autoscroll=true&repeat=list"
/>
</object>
QQQ;
if ($compact) {
$GLOBALS['player_counter'] =
isset($GLOBALS['player_counter'])
? $GLOBALS['player_counter'] + 1
: 0;
$player = str_replace("\t", "", $player);
$player = str_replace("\n", "", $player);
if(!$GLOBALS['audio_functions_displayed']) {
$GLOBALS['audio_functions_displayed'] = true;
$functions = <<<QQQ
<script type="text/javascript">
function activateAudioPlayer(id, uri) {
var player = '{$player}';
var playerImg = '<img
src="/ocpimages/compact_mp3_player.png" height="19"
onclick=\'activateAudioPlayer($("..", this).attr("id"), $("..",
this).attr("audio_uri"));\' />';
$('.compactAudioPlayer').empty().append(playerImg);
$('#' + id).empty().append(player);
</script>
QQQ;
$player = "{$functions}<div class=\"compactAudioPlayer\"
id=\"compactAudioPlayer{$GLOBALS['player_counter']}\"
audio_uri=\"{$uri}\" style=\"height: 19px;\"><img
src='/ocpimages/compact_mp3_player.png' height=\"19\"
onclick='activateAudioPlayer($(\"..\", this).attr(\"id\"),
$(\"..\", this).attr(\"audio_uri\"));'></div>";
if ($return) {
return $player;
} else {
print $player;
}

Similar Messages

  • How can I add a new Template to My Templates in Pages? I've read most of the discussions on the subject but it doesn't work for me. By the time I reach the Templates folder, I only see templates for Numbers and not for Pages. Need help, please.  Thanks

    How can I add a new Template to My Templates in Pages? I've read most of the discussions on the subject but it doesn't work for me. By the time I reach the Templates folder, I only see templates for Numbers and not for Pages. Need help, please.  Thanks

    Si vous avez utilisé la commande Save As Template depuis Pages, il y a forcément un dossier
    iWork > Pages
    contenant Templates > My Templates
    comme il y a un dossier
    iWork > Numbers
    contenant Templates > My Templates
    Depuis le Finder, tapez cmd + f
    puis configurez la recherche comme sur cette recopie d'écran.
    puis lancez la recherche.
    Ainsi, vous allez trouver vos modèles personnalisés dans leur dossier.
    Chez moi, il y en a une kyrielle en dehors des dossiers standards parce que je renomme wxcvb.template quasiment tous mes documents Pages et wxcvb.nmbtemplate à peu près tous mes documents Numbers.
    Ainsi, quand je travaille sur un document, je ne suis pas ralenti par Autosave.
    Désolé mais je ne répondrai plus avant demain.
    Pour moi il est temps de dormir.
    Yvan KOENIG (VALLAURIS, France)  mercredi 23 janvier 2011 22:39:28
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • Bought a Template for a customer Need Help

    I know HTML but the coding to change things baffles me.  I am out of help with the seller who is in Australia.
    This is what the .txt looks like that I change function with.
    &Home_txt8=<font color="#d0d0d0"><b>text goes here
    It looks straightforward but I cant use /*  */  or <!--  to deactivate stuff so I can try it out.
    Any help would be welcomed.
    the url of the site is www.danceations.com
    I have done some mods but want to do more.
    Joepd

    The replies are terse and don't come right away. I bought it from some 
    outfit in Australia.  When I asked how do I get rid of the pulldown phono  on
    the index page the answer was "remove the first page of the Flash.fla.  
    Except it took out the song I added and I would need tro recreate a Flash  Page.
    Ugh!
    Not a good experience.
    joepd
    In a message dated 2/9/2012 4:19:49 P.M. Eastern Standard Time, 
    [email protected] writes:
    Re:  Bought a Template for a customer Need Help
    created by John Waller (http://forums.adobe.com/people/John+Waller)  in 
    Dreamweaver - View the full  discussion
    (http://forums.adobe.com/message/4196974#4196974)

  • How could I convert a locked PDF file to Microsoft Word file?Uergency for exam!Need help!

    How could I convert a locked PDF file to Microsoft Word file? Because of locking, I could not print it. Uergency for examination! Need help from veteran!

    Adobe do not offer any products, or help, in hacking protected files.

  • Spinning progress wheel in Captivate 7 SWF - need help ASAP!

    We have created an SWF in Captivate 7 of a tutorial for a work project, but  a spinning progress wheel appears throughout the video, although the EXE and native Captivate version of the tutorial work fine. Need help with this by EOD to meet a crtical work deadline. Thanks!
    Hardware: HP EliteBook 8440p running Vista, as well as one running Windows 7.

    If you are testing this locally on a hard drive, check that your published folder location is a trusted location in Flash Global Security:
    http://www.infosemantics.com.au/adobe-captivate-troubleshooting/how-to-set-up-flash-global -security
    If that is not the issue, check the troubleshooting tips here:
    http://www.infosemantics.com.au/adobe-captivate-troubleshooting/basic-troubleshooting-tech niques

  • TS1702 how can I get anyone to give us answer on the iphone apps casino game we purchased few days ago which once the token was finished we were not able to reset and play just for fun and not for gambling. we need help and not to be charged additional

    few days ago I have purchased Iphone casino games from itunes apps store. One of the game was made by the company called "ARISTOCRAT" dragan game. Usually we will get basic tokens to play the game, and if we ran out of the tokens all we need to do is going into "manu" and "setting" selete "dream" and reset that we should be able to continue play the game with same amount of the basic tokens. The one game would not let us to go back to the game. There were msg came out said" game center requires an active connection to the internet"? I didn't feel comfortable because we purchased the game for $1.99 to play for fun and not to gamble. We do have credit card on your file. We don't want to be charged alot of money for something not in our well. I need help to answer the question on the following:
    1.  Are we able to ever play this game again without going to internet? We don't even know which site to go to, because when we press the ok button nothing else came out to direct us to any area.
    2. We only purchased the few days ago order ID: MGT74GN6V7 on 10/03/12. all the other games we purchased we were able to continue to play by doing the same setting.
    Thank you for your help and looking forward to hear from you!

    You need to contact itunes support
    We are all itunes users just like you.
    http://www.apple.com/support/contact/

  • Javascript has been shutoff on my mac, I need help.

    I can't figure out why Javascript is not running in my browsers. I predominantly use Safari, but as a test, I've tried Firefox. Javascripts just won't run on my computer.
    I suspect that a couple years back, I installed an application that protected my computer from a security hole that Apple had with Disk Images running scripts. Now for the life of me, I can't figure out which application it might have been, nor how to reverse the effects. Searches on VersionTracker haven't been fruitful.
    Perhaps someone can direct me to which files run at boot-up so I can trace down the culprit.
    Thank You,
    Lucio Cervantes
    iBook G4   Mac OS X (10.3.9)   1.07 GHz 768 MB DDR SDRAM Combo

    I present, for your viewing pleasure, more details regarding my system.
    The computer has all updates applied, currently running 10.3.9. The problem is global, i.e. I'm experiencing this problem on all my accounts, including newly created accounts. The JavaScript problem occurs on ALL websites that use JavaScript to link to other pages. I've run the /Applications/Utilities/Disk Utility.app, it said it repaired a few minor issues, but ofcourse did not repair my problem.
    I've given up on finding the software that is modifying my system, I think it's time to do a clean install. All my user documents should be fine, right?
    The great news is... I bought myself a new MacBook Pro, 2 GHz Intel Core Duo, 1GB DDR2 SDRAM, SuperDrive, etc, etc.
    The iBook G4 is now officially sole property of my wife. Which doesn't say much, since she claimed it as her own a long time ago. =)
    I say it's time for me to close this thread and admit defeat.
    If only there were some log of all the files that launch at startup...
    Thanks for all your help,
    Lucio Cervantes
    iBook G4   Mac OS X (10.3.9)   1.07 GHz 768 MB DDR SDRAM Combo
    iBook G4   Mac OS X (10.3.9)   1.07 GHz 768 MB DDR SDRAM Combo

  • Powerbook G4  looses settings for booting for firewire?Need Help

    I have a powerbook g4 17 inch al..
    1.67 pro
    2 gigs ram
    and I formatted a seagate firewire 800 drive to be my hdd replacment <<it died
    well its installed fine ( partations is for powerbook boot)
    however when i shut down it doesn't find the drive..
    I tried ... setting the startup disk in preferences
    disk repair... permissions repair...
    if i press the option it doesn't find the drive... however it might have once found it before i migrated all my settings from time machine to it...
    the only way it works for me right now is to use the cd and then disk utilities..then choose startup disk... then it stARTS...
    any help would be great...
    thanks stateapple

    war is still on because computer are the key to uniting this world and ending war...
    and at macs prices they will not be the choosen machine...
    the prices are still high... and the prices 15 years ago were out of control...
    you get what you pay for... well this forum is proof that macs as far as hardware is concerned is no different then a pc of the same caliber ...both break down
    only difference is the pc doesn't cost an arm and leg to get it working again...
    why do you think i am trying to boot from firewire...
    because my harddrive quit after 3 years..right after warrenty ends....hmmmm
    when will a computer company ofer the same lifetime warrenty i can get from sears for my tools....
    yea i need to renew it every few years but at least they stand behind there product as long as I choose...
    I would still have my mac under warranty... but it wasn't an option... what does that say about the product or the company selling it to you....( keep in mind Sears offers a warranty for all tools and I could keep the warranty going forever)
    but that not what i was asking....
    how do I get help online with a professional to help solve my computer issue?
    i live an hour and half from the closet apple store.... 2 hour round trip...
    thank you...

  • Java 1.4.1 - Could not reserve space for object heap - need help

    I know this problem has been posted before, but I thought this was fixed in release 1.3. I'm using Windows XP/Professional and do the following:
    C:java -Xmx2g
    Error occured during initialization of VM
    Could not reserve space for object heap
    C:java -version
    java version "1.4.1_02"My computer system has 1 GB of RAM and a 2 GB pagefile, expandable to 3.5 GB. I can get going with -verbose:gc -Xmx1600m -Xms200m, but the GC only gets to about 1 GB before I get an out of memory exception, not even close to 1.6 GB as specified.
    I'd really appreciate it if anyone can shed some light on this behavior.
    Cheers, Eric

    Hmm.
    I tried a mini no-operation application with jdk1.3.1 on Linux. It run okay like this:
    $ java -Xmx1934M u
    $ echo $?
    0
    $ java -version
    java version "1.3.1_07"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_07-b02)
    Java HotSpot(TM) Client VM (build 1.3.1_07-b02, mixed mode)
    $ cat u.java
    class u {
    public static void main(String a[]) {
    $This however fails miserably:
    $ java -Xmx1935M u
    Unexpected Signal : 11 occurred at PC=0x401a0cb7
    Function name=start_thread__2osP6Thread
    Library=/usr/lib/jdk1.3.1_07/jre/lib/i386/client/libjvm.so
    Current Java thread:
    Dynamic libraries:
    08048000-0804c000 r-xp 00000000 03:08 174723     /usr/lib/jdk1.3.1_07/bin/i386/native_threads/java
    0804c000-0804d000 rw-p 00003000 03:08 174723     /usr/lib/jdk1.3.1_07/bin/i386/native_threads/java
    40000000-40012000 r-xp 00000000 03:08 20686      /lib/ld-2.2.5.so
    40012000-40013000 rw-p 00011000 03:08 20686      /lib/ld-2.2.5.so
    ...This looks familiar:
    $ java -Xmx2000m u
    Error occurred during initialization of VM
    Could not reserve enough space for object heap

  • Simple layout structure for a webshop, need help, details inside

    Studied htmldb for abit. Still abit confused as how it all works. Read the user guide/done some of the examples in the 2day course pdf. Here is the thing. For starters I like to have two regions:
    sidebar with some kind of tree structure where it's possible to navigate from productgroup to productsupgroup. Where you can click the productsubgroup and the second region shows a select statement of all the articles in that productsubgroup. For now I only use one table, it's layout is as follows (simplified), it's imported from an excel sheet:
    Table layout
    Product group - Product Subgroup - Brand - Artnumber - Description - Price
    Sidebar region (left)
    Network (productgroup)
    ---Cables (productsubgroup)
    ---Routers (select routers, select statement shows select routers from table in the region next to the sidebar region)
    Report region showing the select statement based on the selection made from the sidebar region
    Router
    Brand - Artnumber - Description - Price
    3Com 1234 Wifi router 10eu
    Do you make two regions? Or one big one on the page? I over simplified the process. But I need to start somewhere and need some guidance. I think the only way to get to it, is by reading and experimenting. The side bar region should show up on every page and the report region only if someone makes a select on the sidebar. A good example of what I want to make in htmldb is:
    http://www.informatique.nl
    I wanted to make something like that in dreamweaver using asp or jsp. Connecting to the Oracle 10G database by odbc or dsn connection. But than found out about htmldb.
    Hope someone can help me in the right direction. All help is appreciated.
    Cheers
    Message was edited by:
    10G-Newbie
    Message was edited by:
    10G-Newbie

    Hello,
    So your basically asking people to build your site when what your asking for can be done using the builtin HTML DB wizards you don't even have to write anything other than a sql query or two get this to work and that you can get using the Query Builder.
    Try using the Shipped Sample Application as your starting point it has the basic functionality your looking for.
    And change your username, your not getting extra help because the newbie name it's just kinda annoying.
    Carl
    Carl
    Message was edited by:
    Carl Backstrom

  • Need to decompile a lone .swf, need help...

    Heya,
    So I'm working on this site:
    http://www.spencerhill.us/green-dragon/home
    and I'm picking up the pieces left by a previous developer.
    Unfortunately he didn't seem to leave the .fla file of the
    navigation .swf (it's the vines that border that page). So I'm left
    to either rebuild the .fla or decompile it but I don't have access
    to a decompiler. I was wondering if any of you might be able to
    help?
    Thanks!

    HI
    Read this
    http://www.flashjester.com/?section=faq&cPath=50#224
    Regards
    FlashJester Support Team
    e. - [email protected]
    w. - www.flashjester.com
    "This has been one of the most impressive and thoroughly
    pleasant
    experiences of customer support I have ever come across -
    astounding!"
    Director - hedgeapple

  • Bleed and crop marks for a magazine. need help

    Can anyone tell me how to place the crop marks for a multiple page project ?
    For example on a left page do i have to set the crop marks only on the left side of the page or all around it ?
    *i'm using PS because i have no experience with ID.
    Thanking you in advance

    jeffozan wrote:
    *i'm using PS because i have no experience with ID.
    You plan to use Photoshop to lay out an entire magazine? I'll say a prayer for you.

  • Setting Up a Document for a Billboard - Need Help

    Hope someone can help me out with this.
    I'm trying to design a billboard. I'll be working primarily in Illustrator.
    My issue is that I'm having trouble setting up my document due to the format and size. I know that it's going to be made to scale, perhaps 1:10 but I still can't figure out how to set it up.
    Here are the specs:
    Board Size: 14' (h) x 40' (w) - feet
    Layout Size: 7" (h) x 20" (w)- inches
    Bleed Size: 7.5" (h) x 20.5" (w) - inches
    Safety Size: 6.5" (h) x 19.5" (w) - inches
    What I don't understand is how, take for instance the bleed's height x width, translate to top bottom left right?
    Also, how do I set the safety size, layout size? Do these also translate into top bottom left right specs?
    Can someone please help!!

    Layout is the art board size. Subtract the art board size from the bleed size and divide by 2 to get the bleed amount. (in this case, 1/2 inch on each size)
    The Safety Size (also know sometimes as the Live Area) is the part of the billboard that your text should stay within.
    Like this

  • For those that need help.

    Hi all.
    I've been using GB for a few years now. I love this program.
    In my projects I felt like I needed a little more power so I upgraded to Logic Pro about a year ago. This program is so huge that I got my hands on a DVD video tutorial set by MacProVideo.com. I am learning something new by the minute. Really cool.
    Then I was looking at their site today and saw that they have a DVD for Garageband. I checked out the samples and found a tip that I was unaware of. I haven't learned anything new about GB in 6 months to a year, especially something as potentially useful as this:
    http://www.macprovideo.com/tutorial/garageBand101
    I'm sure some of you may already know about this (Hang, I'm looking at you) but I never did. This got me thinking that this DVD tutorial could help out anybody that's just starting out. You could have a thorough understanding of Garageband in an afternoon. And it's very reasonably priced for what you would be getting.
    I am in no way affiliated with MacProVideo.com. I am just passing on a way to learn that I don't think has been covered on this forum yet. The DVD series I have for Logic has done WONDERS for me, so I assume that the DVD for GB will do wonders for anybody just starting out.
    ....At least the tip was cool....
    X

    Sorry everybody...the link I was hoping to provide was once again the wrong one. Here's the link to the tip that I did not know before this:
    http://www.macprovideo.com/player/player.php?sid=sample_5e4b9b5b.mov&snum=4
    X

  • Converting videos for ipod trouble need help plz

    i always have to convert my videos for ipod but when i do, there is no more sound. how do i fix this?

    Julia,
    You need to format the iPod for Windows use.
    Download the iPod Updater, install this to your computer, restart the computer, run the Updater, then connect your iPod when prompted, then follow the set up procedure.

Maybe you are looking for

  • SharePoint Server 2013 single server installation licenses and system requirements

    We are thinking of setting up a SharePoint Server 2013 for the following features to be accessed by our test team (<100 users) Our requirements are as follows -  Total user access <100 users(starts with 50 and may be go upto 100) Mainly Access to Tea

  • Dreamweaver CC and incontext editing. No tools anymore?

    Hey, I've just updated to Dreamweaver CC to find out that the tools for integrating incontext editing tags into a page have been removed. I always found these tools extremly helpful for me as designer as well as I found incontext editing a major sell

  • JavaME SDK 3.0 EA Mac OSX: Preverify error :(

    Hi, Since my Windows box died on me recently I was extremely happy to learn that the JavaME SDK for Mac is in EA and downloaded and installed the whole thing. All went fine until I tried to compile my project and got preverification errors that don't

  • Questions about uninstalli​ng some preload stuff...

    Hi all, trying to slim down my system, a few questions if you can help... 1) Can I uninstall "Thinkpad Power Manager"? If yes, I gather I would have to leave "Thinkpad Power Management Driver" installed? I don't need all those power options, and I'm

  • Second window main page

    hi all         i am working in a smartform for sale order..i created the first page and get the things which i need in that form..my requirement is i have to create another page and i created it..but i donno how to create a mainwindow in the second p